Create NuGet with Metalama

With source generators I have to add some MSBuild configuration, but with Metalama it seems I don't need it. My goal is to create a fabric that detects classes inheriting from BusinessException, and then apply an attribute/aspect to it, generating code. Then I'll publish a NuGet to nuget.org, and when I create it (dotnet build & pack), I'll pass the license key with an envinroment variable to MSBuild. And... just that? Will library users have to specify a license key? Do I have to publish the NuGet as an analyzer? Anything? Will they have Metalama code generation out-of-the-box inheriting from BusinessException? Thanks!
Petr Onderka
Petr Onderka•311d ago
Yeah, there are no other technical hurdles when publishing a package that exposes Metalama aspects or transitive project fabrics. Regarding licensing, your users will need a license, though the free license my be sufficient, depending on the number of aspects they use. Also, if you apply for the free redistribution license (see https://www.postsharp.net/metalama/pricing), then your whole library will count the same as a single aspect, so the free license will definitely be sufficient for your users.
Andreu
Andreu•311d ago
It's incredible the work you're doing with this framework. Thanks!
Andreu
Andreu•311d ago
It's a non-commercial open source library that will be used by companies. But then I have doubts reading the pricing model. When they add my nuget package, will they have to activate anything or not? "manual step"
No description
Petr Onderka
Petr Onderka•311d ago
Yes, they will eventually have to activate Metalama. When they first install your package from NuGet, their trial period will start automatically, no activation is necessary at this point. But after 45 days, they will need to activate a free license. That requires installing the metalama command line tool (dotnet tool install -g metalama.tool) and then activating the license (metalama license free).
Andreu
Andreu•311d ago
It seems annoying. Is there another option? Like a <PackageReference License="aaa"> in the csproj?
Gael Fraiteur
Gael Fraiteur•311d ago
Not at the moment. But we can reconsider. It's just a description of how it works now.
Gael Fraiteur
Gael Fraiteur•311d ago
GitHub
Reconsider the need for users of a redistribution license to regist...
The requirement to manually enable Metalama Free when using Metalama through a NuGet package is considered useless friction.
Gael Fraiteur
Gael Fraiteur•311d ago
You can like it 🙂
Want results from more Discord servers?
Add your server
More Posts
Override property with BuildAspectI create exceptions inheriting from Exception and putting the `[BusinessException]` attribute. I waView diff in RiderI don't use Visual Studio, and overall, I don't have Windows. Is there any way to see the source genOverride constructorIs it possible to override a constructor? I want to take my code: ``` public class BusinessExceptiDoes Metalama only support attributes?I navigated in all Metalama documentation, but I want to override a method for all types that inheriCan Metalama suppress compiler errors?Hello! I want to know if I can use Metalama in my library. The users of my library have to declare Eligibility rule based on target method not returning voidTypically eligibility rules I've put together are based on a specifically typed return or paramters.Follow up question from yesterday's meetupNow that I've had time to review what was discussed I think I can now ask the question I'd wanted toPlease cache licensing key rather than check every buildEvery time I attempt to build an aspect today, I'm getting an error that I've got an invalid licenseDocumentation: Bad linkAt https://doc.metalama.net/conceptual/using/fabrics there's a link at the bottom titled "ConfigurinCan one pass state between aspects?One can trivially pass arbitrary data between the aspect class and a template via the 'args' parametOrdering AspectsIn the documentation it states: 'Aspects must be ordered using the AspectOrderAttribute assembly-levThis error has me foxedIt's our old friend LAMA0001 Can't work out where it is getting Net Framework reference from. PrAddAspect RefactoringConsider the following scenario. There are two aspects that can potentially be added to a method (iRemoveAspectIfEligible?Thinking out loud here. Title should actually be RemoveAspectIfPresent? Is there a case for havingTesting FabricsShort of actually creating a project that covers all of the bases that one would want to cover is thEligibility MustNotHaveAspectOfTypeI want to have intellisense show a red squiggle under and attribute if it is added to a method that Test should surely either both pass or both failWithin the following repository (https://github.com/domsinclair/VtlSoftware.LoggingAspects) there arTesting IssueI've followed the basic instructions in the Documentation for testing Aspects (https://doc.metalama.Has anyone tried the Ctrl + . refactor menu recently?According to the documentation Invoking Ctrl + . to pull up the refactor menu should (if they are avIs it possible to mix aspects that call different parts of a class (ie Methods and Properties)?Pretty much as per the subject line. Consider the following scenario where one has aspects to log m