RSS

CruiseControl Labeller Plugin – MS Project Labeller

05 May

Releases

Introduction

I’ve been using CruiseControl.Net for a while now and use it’s labellers to create version numbers which I then use to label code in VSS and pass to NAnt build scripts which in turn set the assemblies internal version numbers.

There a number of labellers that come already with CC.Net they are:

  • Date Labeller
  • Default Labeller
  • Iteration Labeller
  • Remote Project Labeller
  • State File Labeller

There is nothing wrong with these labellers, but I quite like the versioning that Visual Studio uses when it builds your applications. Out of the provided labellers the Iteration Labeller came close, but it never seems to work the first time, without having to manually edit the state file. (I’ve had a look at the code and it only generates a version number if the last build status was sucessful. The problem is that it starts off as unknown)

The way that Visual Studio works is that it looks at the value of the AssemblyVersion property in the AssemblyInfo file.

If you have 1.0.*.* it will auto generate the build and revision number of the version.

The build number is calculated from:

(number of months since the project start date * 100) + the number of days from the start of the month.

The revision number is calculated from:

total number of seconds from midnight / 10

There is a NAnt contrib task which does this, but I wanted to get this working in CC.Net to intergrate with VSS better.

I’ve created a custom labeller that you can plugin to CC.Net that mirrors the above functionality.

Acknowledgments

I found an application called UpdateVersion by written by Matt Griffith and Scott Hanselman (extra feature added by Mike Gunderloy) which is a command line application for generating versions numbers which can be intergrated into VS and NAnt. This had much better code (readablity and less complex) in generating the build and revision numbers than my code (which did work fine).

Thanks also to Martin for the pointers on CCNet plugins.

Documentation

MS Project Labeller

The MS Project Labeller produces labels that match the version numbers that Visual Studio creates.

<project>
   <labeller type="msprojectlabeller">
     <incrementOnFailure>true</incrementOnFailure>
     <labelMajor>1</labelMajor>
<labelMinor>0</labelMinor>
<releaseStartDate>2005/6/24</releaseStartDate> </labeller> <!-- Other project configuration to go here --> </project>

Configuration Elements:

Node Description Type Required Default
incrementOnFailure Increments label if the previous project status is Failure or Exception boolean  false false 
labelMajor  Major Part of the Label / Version number  int  false
labelMinor  Minor Part of the Label / Version number  int  false
releaseStartDate The date which the build portion of the version number is calculated from datetime  false 01/01/2000 

Installation:

Extract zip file and copy dll to the C:Program FilesCruiseControl.NETserver directory

Releases

1.0.0.0 (5th May 2006)

About these ads
 
Leave a comment

Posted by on May 5, 2006 in 1121

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.

%d bloggers like this: