Versioning issue when using GlobalAssemblyInfo.cs

Hi, I have the following build process running from TeamCity using MSBuild as the build runner:

1. Code is checked out of Subversion by TeamCity
2. The version number is stored in a GlobalAssemblyInfo.cs which gets updated by the script as appropriate, and written back to the GlobalAssemblyInfo.cs file, and then this file is committed by the script via the SvnCommit MSBuild community task
3. The assemblies are built using the updated version number
4. The trunk is tagged in Subversion using the updated version number as the tag name, I have tried this by using the TeamCity labelling option on successful build, or by using the SvnCopy MSBuild community task

The issue is that the tagging appears to use the revision that was checked out in step 1 of the build above, therefore the tagged version, e.g. 1.0.0.1 contains the old GlobalAssemblyInfo.cs file marked as e.g. 1.0.0.0

Is there anyway for TeamCity to label the latest revision on successful build (or any scripting option I can use) so that the tag 1.0.0.1 contains the updated version of the GlobalAssemblyInfo.cs file?

TIA

1 comment
Comment actions Permalink

TeamCity labels the exact revision of sources that was sent to agent to run the build. In general it is not obvois to tell build commit from another user's commit. If you are dealing with commits from the build It will the the issue for you to call one more svn command to label sources.

But, don't forget to conside a case where some user check in some code between a build start and committing that patched info file. What whould you expect to see labelled?

Thanks!

0

Please sign in to leave a comment.