MSBuild Task

The <msbuild> task is used to execute MsBuild projects, which are the default project format for Visual Studio 2005 projects and can also be compiled by using the MSBuild application that ships with the .NET 2 Framework.

In order to work with the results of MsBuild it is important to use a custom xml logger to format the build results. For details on this, and a tutorial on how to use the task, see Using CruiseControl.NET with MSBuild.

tip

To see build progress information in the CCNet 1.5 WebDashboard remove the "/noconsolelogger" argument.

Version

Available from version 1.0

Examples

Minimalist example

1<msbuild />

Full example

 1<msbuild>
 2  <executable>C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\MSBuild.exe</executable>
 3  <workingDirectory>C:\dev\ccnet</workingDirectory>
 4  <projectFile>CCNet.sln</projectFile>
 5  <buildArgs>/p:Configuration=Debug /v:diag</buildArgs>
 6  <targets>Build;Test</targets>
 7  <timeout>900</timeout>
 8  <logger>C:\Program Files\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MsBuild.dll</logger>
 9</msbuild>

Configuration Elements

Element Description Type Required Default Version
buildArgs Any extra arguments to pass through to MSBuild. String No None 1.0
description Description used for the visualisation of the buildstage, if left empty the process name will be shown. String No The task/publisher name. 1.5
dynamicValues The dynamic values to use for the task. Dynamic Values array No None 1.5
environment A set of environment variables set for commands that are executed.
Each variable should be specified as
1<variable name="name" value="value" />

.
Environment Variable array No
executable The location of the MSBuild.exe executable. String No MSBuild with .NET Framework, xbuild on Unix with Mono. 1.0
logger The full path to the assembly containing the custom logger to use. Contrary to the usual MSBuild command line, arguments MUST NOT be passed to the logger by appending them after the logger name separated by a semicolon. You MUST use the loggerParameters property for this. Only if the assembly contains more than one logger implementation you need to specify the logger class (see MSBuild reference): \[LoggerClass,\]LoggerAssembly String No ThoughtWorks.CruiseControl.MsBuild.XmlLogger, ThoughtWorks.CruiseControl.MsBuild.dll 1.0
loggerParameters The parameters to be given to the custom logger String array No Empty 1.0
priority The priority class of the spawned process. String - one of:
* Normal
* Idle
* High
* RealTime
* BelowNormal
* AboveNormal
No Normal 1.5
projectFile The name of the build project to run, relative to the workingDirectory. String No Default MSBuild file. 1.0
targets A semicolon-separated list of the targets to run. String No Default project target. 1.0
timeout Number of seconds to wait before assuming that the process has hung and should be killed. Int32 No 600 1.0
workingDirectory The directory to run MSBuild in - this is generally the directory containing your build project. If relative, is a subdirectory of the Project Working Directory. String No Project Working Directory 1.0

Notes

Integration Properties

Label Description Example Version
CCNetArtifactDirectory The project artifact directory (as an absolute path) C:\Program Files\CruiseControl.NET\Server\MyProject\Artifacts 1.0
CCNetBuildCondition The condition used to trigger the build, indicating if the build was triggered by new modifications or if it was forced. Legal values are: IfModificationExists or ForceBuild ForceBuild 1.0
CCNetBuildDate The date of the build (in yyyy-MM-dd format) 2005-08-10 1.0
CCNetBuildTime The time of the start of the build (in HH:mm:ss format) 08:45:12 1.0
CCNetFailureTasks The list of name of tasks which have contributed to the current build failure. When the description of the task is filled in, this will be shown. Exec Task 1.7
CCNetFailureUsers The list of users who have contributed modifications to a sequence of builds that has failed. John, Smith 1.0
CCNetIntegrationStatus The status of the current integration. Could be Success, Failure, Exception or Unknown Success 1.0
CCNetLabel The label used to identify the CCNet build. This label is generated by the CCNet labeller. 1.0.2.120 1.0
CCNetLastIntegrationStatus The status of the previous integration. Could be Success, Failure, Exception or Unknown Success 1.0
CCNetListenerFile View build progress : task output that shows how far the build is c:\Project\Artifact\listener.xml 1.4.0
CCNetModifyingUsers The list of users who have contributed to the current build only Smith 1.0
CCNetNumericLabel Contains the label as an integer if conversion is possible, otherwise zero. 1 1.0
CCNetProject The name of the CCNet project that is being integrated. MyProject 1.0
CCNetProjectUrl The URL where the project is located http://myhost/ccnet/server/ 1.0
CCNetRequestSource The source of the integration request; this will generally be the name of the trigger that raised the request. IntervalTrigger 1.1.0
CCNetUser The user who forced the build. If security is off, or the build is not forced, then this will not be set. John Doe 1.5.0
CCNetWorkingDirectory The project working directory (as an absolute path) C:\Program Files\CruiseControl.NET\Server\MyProject\WorkingDirectory 1.0

Many thanks to Szymon Kobalczyk for helping out with this part of CruiseControl.NET.

Automatically Generated

Documentation generated on Monday, 26 May 2014 at 7:18:04 AM