-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
project.json's version property should be extensible #4610
Comments
From @davidfowl on November 24, 2015 7:5 You could just use assembly attributes for this. Specifically |
From @AArnott on November 24, 2015 16:22 I don't think that resolves the issue. The values for these assembly metadata need to be computed at build time, and DNX (AFAIK) doesn't offer me a way to hook into that pipeline. |
From @guardrex on November 24, 2015 17:10 @AArnott You can script your way to a new version for each publish operation. You can run a PS script on "prepare" and provide whatever versioning logic you want. I needed a new patch version for each publish, so I whipped this up: https://github.com/GuardRex/net5-autoupdate-version |
From @AArnott on November 24, 2015 17:44 Thanks, @guardrex. But that requires a source code change to impact the build. Then to ensure the number keeps incrementing you have to check in the change. What I'm looking for is automation that can control the version without changing source code every time I build or publish. |
@muratg can you take a look at my comment on https://github.com/dotnet/cli/issues/549 and let me know if that does what you want? Making it possible for developers to make proper local builds that look just like CI builds was one of my aims. |
@PhilipDaniels This is actually my (@AArnott) issue, but @muratg copied it from a deprecated project. And no, #4608 doesn't come close to what I want. I don't want to have to make a commit in a git repo (or otherwise change any source code) in order to build a package with a different version number than the prior commit in git. I don't want to keep having to increment a patch version in project.json with every commit that I build. Besides adding tons of noise and overhead, it would introduce merge conflicts between branches that change the value. |
@AArnott take a look at the CLI repo itself. It implements a particular versioning strategy and uses existing --version-suffix capabilities to have that strategy respected throughout the CLI repo. If you think that there are better hooks to be exposed by CLI to enable other versioning strategies, perhaps you can suggest a design along with scenarios that it would address? |
I just looked into that. The For instance, I set my project.json
The position of the asterisk, and what values are allowed to be substituted in where the asterisk is, is extremely limited. Even if where it could appear can be expanded, having to specify the version to substitute in for each build is very burdensome. A proper build extension could automatically calculate the appropriate version on every build automatically. Also, there are multiple aspects to versions. There is package version, assembly version, assembly file version, etc. All these have their purpose and while corefx uses the same (or similar) version everywhere, a great many projects don't. Flexibility in this area is important, especially for desktop CLR targeted projects. You can see some of the flexibility folks require in the version.json that NB.GV supports. I think I read recently that dotnet CLI is adding some support for development/build dependency packages in project.json. I might have misinterpreted it, but it seemed like a great place to add a build extension. Ideally, I can adjust the NB.GV nuget package to also export whatever extensions it needs to plug into dotnet.exe so that it can supply all the version information, add source files to the compilation, etc. that it needs to so that people who migrate from msbuild to dotnet CLI can continue to have the automatic and flexible versioning policies that they are used to. |
NPM has the version command which lets you bump up each number. Having the same for |
The team is actively working on enabling MSBuild and the component affected will be superseded by the new project system, so I am closing this issue. |
…610.5 (#4610) Microsoft.FSharp.Compiler From Version 10.10.0-beta.20310.3 -> To Version 10.10.0-beta.20310.5 Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
From @AArnott on November 18, 2015 0:1
We want the libraries and packages we build with DNX to be stamped with a version as unique as the source code. And we want semver to roughly understand (assuming linear versioning) how to pick newer packages from older ones independent of a particular build server. We want reproducible builds, such that if I build a commit locally or in the cloud, the result is exactly the same, including the version that is calculated that is stamped onto the package and the assembly.
We also want to be able to backtrack from an assembly or package version to the source code that produced it.
This is encoded in Nerdbank.GitVersioning but this extends MSBuild to work its magic. DNX doesn't use MSBuild so we need another way to influence where DNX gets its package versions, and the several assembly versioning attributes it produces while compiling. I'd love for this Nerdbank.GitVersioning package to be applicable to DNX projects via adding as a dependency and have it automatically work with DNX to get the version right.
Copied from original issue: aspnet/dnx#3178
The text was updated successfully, but these errors were encountered: