NAnt_
TeamCity supports NAnt 0.85 and NAnt 0.86 beta 1.
Setting the NAntHome Environment Variable
When selecting NAnt as the build runner, you need to specify the NAntHome environment variable on the agent machine with a path to the NAnt 0.85/0.86 beta 1 executables folder. This can be done by setting the environment variable on agent machine or by adding the env.NAntHome variable to the agent properties file or during the Properties and Environment Variables step when creating a build configuration.
MSBuild Task for NAnt
TeamCity NAnt runner includes a task called msbuild that allows NAnt to start MSBuild scripts. TeamCity msbuild task for NAnt has the same set of attributes as the NAntContrib package msbuild task. The MSBuild build processes started by NAnt will behave exactly as if they were launched by TeamCity MSBuild/SLN2005 build runner (i.e. NUnit and/or NUnitTeamCity MSBuild tasks will be added to build scripts and logs and error reports will be sent directly to the build server).
By default, NAnt msbuild task uses MSBuild 2.0 (from Microsoft .NET Framework 2.0), however you can use MSBuild 3.5 (from Microsoft .NET Framework 3.5) if you add the teamcity_dotnet_use_msbuild_v35 property with the value of true to your msbuild task in NAnt script. For example:
... <msbuild project="SimpleEcho.v35.proj"> <!-- this property enables MSBuild 3.5 --> <property name="teamcity_dotnet_use_msbuild_v35" value="true"/> ... </msbuild> ...
<nunit2> Task for NAnt
To test all of the assemblies without halting on first failed test please use:
<target name="build"> <nunit2 verbose="true" haltonfailure="false" failonerror="true" failonfailureatend="true"> <formatter type="Plain" /> <test haltonfailure="false"> <assemblies> <include name="dll1.dll" /> <include name="dll2.dll" /> </assemblies> </test> </nunit2> </target>
Below you can find reference information about NAnt Build Runner fields.
General Options
Option | Description |
|---|---|
Specify path relative to the Build Checkout Directory. | |
Select the option, if you want to use a different build script than the one listed in the settings of the build file. When the option is enabled, you have to type the build script in the text area. | |
Specify the names of build targets defined by the build script, separated by spaces. | |
Working directory | Specify the path to the Build Working Directory. By default, the build working directory is set to the same path as the build checkout directory. |
NAnt home | Enter a path to the |
Sets | |
Specify any additional parameters for | |
Reduce test failure feedback time | Use following option to instruct TeamCity to run some tests before others. |
Run recently failed tests first | If checked, in the first place TeamCity will run tests failed in previous finished or running builds as well as tests having high failure rate (a so called blinking tests) |
Code Coverage
To learn about configuring code coverage options, please refer to the Configuring .NET Code Coverage page.