1

I want to make the builds on a specific branch advance the version number in AssemblyInfo.cs files and in Package.nuspec files according to the Semantic Versioning convention (*).

In order to do this, when code is merged into this specific branch, I want to:

  1. Ask the merging user for a new version number, preferably during merge (then run build during check-in) or when the user runs a manual build, preferably displaying a custom dialog which displays current version number and asks if API has been broken, expanded or if changes do not affect API, then save the new version number aside.

  2. Apply version number to AssemblyInfo.cs file(s). (Related link)

  3. Apply version number to Package.nuspec file(s).

  4. Run build.

  5. Publish resulting NuGet packages.

I am not sure how to get the first step working, as it is interactive.

  • Has anyone tried such as approach before?
  • Are there any known solutions?
  • Any tips how to solve this?

(*) Semantic Versioning convention:
MAJOR version when you make incompatible API changes,
MINOR version when you add functionality in a backwards-compatible manner, and
PATCH version when you make backwards-compatible bug fixes.

2
  • This doesn't get you all the way there, but have you looked at the NuGetter build templates? The templates allow you to build, package and publish NuGet packages as part of the build process. You can also specify a "version seed file" in source control that will version the assemblies and nuspec. You can't enforce it without more TFS customization, but you could get developers to update the version in the seed file on checkin. The assemblies and package will then be versioned with such on build. HTH.
    – Pero P.
    Aug 8, 2013 at 17:21
  • @ppejovic Hi, I've looked at it and am considering it as an alternative to the packaging project template, but I would like to somehow force the version number (e.g. in the seed file) to change prior to builds, preferably by asking for the new version number. Aug 8, 2013 at 17:52

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.