-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prerelease version is ignored when generating YAML content #140
Comments
The plot thickens: it seems like the prerelease part of the version is LOST when loading an assembly and its dependencies from a NuGet package as you can see here: I'm loading a prerelease version of the Cake.MinVer assembly which references a prerelease version of Cake.Core but in both cases it shows "1.0.0". This explains why AddinDiscoverer emits "1.0.0" in the YAML instead of "1.0.0.xxxxx" as expected. |
Seems like |
@Jericho Correct. Unfortunately Most projects store the SemVer version in the In the case of Cake, it's being stored in the |
I came to the same conclusion: I am able to get an assembly's version by looking at the
|
There is a SemanticVersion class in the NuGet code base that may be of help: https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Core/NuGet.Versioning/SemanticVersion.cs |
Unfortunately not. We're need to know the reference of Cake.MinVer assembly to the Cake assembly. This is something which is (at least in most cases and by our best practices) not a NuGet package dependency. As it seems there's no way to find out the exact version through the assembly references ( |
NB: I'm happy to move the comments below to its own issue if it makes sense, but for now just discussing
@pascalberger This is interesting and if this is the case, then Any recent add-in that uses the SDK-style project & If marking |
ps: The good thing about creating a meta-package for add-ins, is that it opens the door for participating in the build process (*). For example, we could add a e.g. If add-ins automatically had the attribute * Which you prob. wouldn't want to do with Of course, it would take time for add-ins to move to using the meta-package, etc. it's a process... (perhaps another step for AddinDiscoverer to automate, create issue and/or submit PR to add-in repo as it does for other things today). |
@augustoproiete Cake-Contrib org has some guidelines regarding this. This is something which we maybe should make a first class citizen on cakebuild.net (cake-build/website#1049). There's also a CakeContrib.Guidelines project which provides analyzers for this. |
@pascalberger The documentation in the guidelines is great, and I remember reading it and doing it correctly for the initial version of the add-in targeting 0.33.0, but when I upgraded the add-in to target 1.0.0-rc0001 I copied the It would be a nice if I didn't have to worry about it every time I update an add-in to target a higher Cake version, and the Anyway, I'll check out the analyzers you mentioned as that seems useful. |
I really like the idea of meta package that can automatically set the references to be private and can also add a custom attribute to make it easy to detect the version of the reference Cake package. |
I put together a quick proof-of-concept to test embedding metadata in add-ins automatically. I created two NuGet packages: Cake.Extensions.PoC and Cake.Addins.Sample.
The Cake.Extensions.PoC package automatically embeds an It's the equivalent of adding If you read the add-in assembly inside the Cake.Addins.Sample package, you should be able to retrieve the attribute and read its value: The Cake.Addins.Sample package multi-targets to NB: I'm adding only one attribute per assembly for testing purposes, but I could add as many needed, just with different names. Let me know what you guys think (and if I missed anything). This is just a test, of course. If we were to move forward with it there's more work to do in terms of hardening and testing to ensure it works on VB .NET and FSharp projects, as well as the old csproj/packages.config kind of project. |
As @pascalberger mentioned here, prerelease is ignored when generating YAML content.
The text was updated successfully, but these errors were encountered: