Skip to content

Directory.build.props file improvements #98

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

Merged
merged 3 commits into from
Dec 3, 2020

Conversation

AlexUstinov
Copy link
Contributor

This PR enables usage of the build number version component for custom versioning.
Also, the file is reorganized for simplicity.

@alex-kulakov
Copy link
Contributor

alex-kulakov commented Dec 1, 2020

This changes packages versioning globally. I don't really like it.

It is said that this is done for custom functionality but it is applied for our build server building process.
Old versioning set build number on build server, otherwise 0. Build number was also ignored for NuGet package version.

Custom versioning seems to be not really custom.

I assume you need build number to differentiate private packages between our public releases. Can we use something like following:

  • If $(BUILD_NUMBER) is not empty the building is considered to happen on a build server. In this case do not include build number to the package version.
  • if $(DoVersion) in Version.props contains build number then use it for assembly version and for package version. Consider this as custom build.
  • If none of previous items haven't set then build number is 0 an package version does not contain build number. This is usual build which is built on, for instance, developer machine.

Any problems for you in case of such algorithm?

As an option the build number from $(DoVersion) in Version.props can override everything (it will be placed as package version automatically), if it does not exist we use $(BUILD_NUMBER), then 0. Last two variants should have no effect on package version.

@AlexUstinov
Copy link
Contributor Author

I decided to always use the $(DoVersion) value as the Package Version. It is also being used as the Assembly File Version but in case the $(DoVersion) value lacks the revision component it is being complemented with 0. However, in case, the $(BUILD_NUMBER) parameter is defined it always overrides the revision component of the Assembly File Version.

This must keep the current behavior but could allow extending the package version with the Revision component when needed.

@alex-kulakov
Copy link
Contributor

Yes, such algorithm keeps current behavior for us.

@alex-kulakov alex-kulakov merged commit 5e0954e into master Dec 3, 2020
@alex-kulakov alex-kulakov deleted the directory-build-props branch December 3, 2020 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants