This page last changed on Oct 31, 2005 by mroberts.

The following sections show you how to setup CruiseControl.NET to build a project using Ant as its build tool. This page was written testing against Ant version 1.6.5 .

Setting up the Build Server

At the present time, CruiseControl.NET does not have an Ant-specific task but using the <exec> task is sufficient. An example is as below:

<exec 
    executable="ant.bat" 
    buildArgs="-logger org.apache.tools.ant.XmlLogger -logfile build_log.xml build" 
/>

This example presumes the following:

  • ant.bat is in your path
  • Your project working directory contains your build.xml ant script, and that is also the directory you would normally run Ant in.

If either of these are not true adapt your call to <exec> as necessary.

If you use the ant.bat file to call Ant, make sure you edit the file to return to correct exit code. A simple way to do this is too add the following line to the end of the ant.bat file:
  • exit %ERRORLEVEL%

Assuming you are using Ant's XML output (as the example above does) you'll also need to merge the xml output. A typical example is as follows:

<publishers>
    <merge>
        <files>
            <file>build_log.xml</file>
        </files>
    </merge>
    <xmllogger />
</publishers>

Setting up the Dashboard

Assuming you are using Ant's XML output you can setup a XSL Report Build Plugin. An example for your dashboard.config is as below:

<xslReportBuildPlugin description="Ant Output" actionName="AntBuildReport" xslFileName="xsl\ant.xsl" />
Document generated by Confluence on Mar 14, 2009 02:55