Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you manage an AssemblyInfo.cs that is stored in SVN and changes with each build

I've got the following scenario: An application is built via the IDE and via a build script. The build script is used for the initial setup (fetching dependencies, setting up environment), to generate the binaries and for the continuous integration process. I want the binaries to have as an AssemblyFileVersion the month and day on build, and svn revision on the revision. This causes the AssemblyInfo.cs to change on every revision, which creates a lot of noise in the source control log. I can ignore the files, but then as part of the setup I'd need to regenerate those.

I'd like to know if anyone has any other ideas, or what do you do in this case.

like image 371
Bruno Lopes Avatar asked Mar 27 '09 00:03

Bruno Lopes


1 Answers

Right now I'm settled on a solution inspired by Andy White's answer:

  • AssemblyInfo.cs is generated by the AssemblyInfo task from http://msbuildtasks.tigris.org/ and is kept outside the source control tree.
  • The version is [major].[minor].[month][day].[svn revision]. Major and Minor are set manually, the others are managed by the build script. The Community Tasks pack includes both tasks needed to get the working copy svn revision and date.

The downside:

  • When someone checks out a fresh copy the setup target of the build script must be run, otherwise Visual Studio will complain about missing files. This is a problem I'd like to remove in the future.
like image 200
Bruno Lopes Avatar answered Sep 22 '22 02:09

Bruno Lopes