My favorites | Sign in
Project Logo
                
Code license: Artistic License/GPL
Labels: ccnet, plug-in, svn
People details
Project owners:
  davidkeaveny
Project committers:
happycodr, m.tontini

SVN Revision Labeller is a plugin for CruiseControl.NET (CC.NET) that allows you to generate version labels for your builds, based upon the revision number of your Subversion working copy. This can be customised with a prefix and/or major/minor version numbers.

Requirements

Mandatory

Optional

Installation

The precompiled build provides a release build only. If you want to run a debug build, you will need to grab a copy of the source and build it yourself. Otherwise, just drop the file ccnet.SvnRevisionLabeller.plugin.dll into the CC.NET server folder. The CC.NET configuration will need to be updated, and the server optionally restarted (depending on your configuration).

Configuration

Below is a sample configuration for svnRevisionLabeller, showing the mandatory fields:

<labeller type="svnRevisionLabeller">
	<major>7</major>
	<minor>11</minor>
	<url>svn://localhost/repository/trunk</url>
</labeller>

The following sample configuration shows the complete set of fields:

<labeller type="svnRevisionLabeller">
	<major>8</major>
	<minor>2</minor>
	<build>0</build>
	<pattern>Prerelease {major}.{minor}.{build}.{revision}</pattern>
	<incrementOnFailure>false</incrementOnFailure>
	<resetBuildAfterVersionChange>false</resetBuildAfterVersionChange>
	<url>https://localhost/repository/branches/dev-project</url>
	<executable>C:\Svn\Bin\svn.exe</executable>
	<username>ccnetuser</username>
	<password>ccnetpassword</password>
</labeller>

Usage

When CruiseControl.NET begins a project build, it generates a label for the build and stores it in the property CCNetLabel - this property can then be used by NAnt or MSBuild to generate the AssemblyInfo.cs for your assemblies, so that CC.NET displays as its label the same version that the assemblies are built with. So, if the configuration for the labeller is set as:

<labeller type="svnRevisionLabeller">
	<major>7</major>
	<minor>11</minor>
	<url>svn://localhost/repository/trunk</url>
</labeller>

and the latest Subversion revision number is 920, the CCNetLabel will be set to 7.11.0.920. Forcing a build without any changes to the repository will not make any changes to the label. A subsequent commit to the repository would then set the label to 7.11.0.921, and so on.

If you want to generate a more complex label, you use the Pattern field. This contains a number of tokens for the Major, Minor, Build, Revision and Rebuilt numbers,and you can effectively create any label you want. For instance:

<labeller type="svnRevisionLabeller">
	<major>1</major>
	<minor>2</minor>
	<pattern>Labelling is as easy as {major} - {minor} - 3 - {revision}. See?</pattern>
	<url>svn://localhost/repository/trunk</url>
</labeller>

and the current revision is 4, then the generated build label be "Labelling is as easy as 1 - 2 - 3 - 4. See?"

The available tokens are:

History









Hosted by Google Code