CruiseControl.NET and Subversion Revision Numbers using NAnt


A while ago, I posted a simple stop-gap solution for retrieving Subversion revision numbers during a CruiseControl.NET build, and had hoped that functionality would shortly make it into a release.  Well, it hasn’t, and I have had to revisit this recently.  Here’s a better solution than the original (using Subversion 1.2.0):

  <echo message="Retrieving Subversion revision number"/>
  <property name="svn.revision" value="00"/>
    <exec
          program="svn.exe"
         commandline=’log "${project::get-base-directory()}" –xml –limit 1′
          output="_revision.xml"
          failonerror="false"/>
    <xmlpeek
          file="_revision.xml"
          xpath="/log/logentry/@revision"
          property="svn.revision"
          failonerror="false"/>
   <echo message="Using Subversion revision number: ${svn.revision}"/>

A little more generic, and much closer to the point–this one does a better job of getting the appropriate Subversion revision number.

About these ads

One Comment to “CruiseControl.NET and Subversion Revision Numbers using NAnt”

  1. you, sir, are a genius. thank you.

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 )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: