0

Is there a way to reject a build of a .NET library if a public interface has changed (eg: deleting a public method from a public interface) and assembly version was not upgraded to a MAJOR? It would be better if there was a way to automatically bump the MAJOR/MINOR/PATCH in AssemblyInfo.cs according to the changes were made.

I assume that the build process would some need to know the ancestor branch so it compare version number.

burnt1ce
  • 14,387
  • 33
  • 102
  • 162
  • This is an interesting idea, but I feel part of the reason to use SemVer is to force the developer to stop and think how their changes will affect the version number. (See [this answer](https://semver.org/#if-even-the-tiniest-backwards-incompatible-changes-to-the-public-api-require-a-major-version-bump-wont-i-end-up-at-version-4200-very-rapidly) on the spec.) Automating the version bump removes this aspect. – Joe Sewell May 13 '19 at 18:18
  • 1
    Sure but it would be nice if the CI/CD system can warn a developer if they are bumping the patch version when they should clearly be bumping the major version – burnt1ce May 13 '19 at 20:51

1 Answers1

0

Did you try CakeBuild with AssemblyInfo modify or customize ? . Also you can looking for gitversion to help you manage release version.