views:

1811

answers:

4

I'm working through the process of installing CruiseControl.net and converting an Msbuild script to work with it. I'd like our build number to reflect the Subversion revision number. It appears as though the LastChangeLabeller should work, but all I get is "unknown".

My ultimate goal is to format the build number with both a build number (incrementing by 1) and the subversion revision. But for now I'd settle for the revision number.

Clarification: I'm trying to get the CruiseControl.Net build number updated. Not just the version numbers in the compiled results.

A: 

The MSBuild Community Tasks project has a subversion task which will aid you in this endeavor.

The tasks: http://msbuildtasks.tigris.org/servlets/ProjectDocumentList

Article describing components: http://weblogs.asp.net/pwelter34/archive/2006/03/31/441613.aspx

palehorse
I'm using the MSBuild Community Tasks in the MSBuild script, but I'm needing to update the CC.net build number.
Rick
Ah, I see. I'm uncertain how to do that. It could be possible to write a custom task to modify the file?
palehorse
A: 

The SVN FAQ has an example of how to accomplish this using GNU make. I'm sure it can be easily adapted.

rmeador
A: 

If you are wanting to change the build number in CC.Net, I believe you want to use a labeller block - possibly a Last Change labeller, though I've not used it myself.

Pedro
+4  A: 

I found a duplicate question. Use svn revision to label build in ccnet. This lead me to svnRevisionLabeller available on Google Code

This seems to be the best solution for me. I modified the code slightly because I wanted the subversion revision number to be last number in the version number. major.minor.build.revision. This labeller by default does major.minor.revision.build.

Rick