|
CruiseControl.NET : Using CruiseControl.NET with MSBuild
This page last changed on Mar 15, 2007 by christian.
CruiseControl.NET includes an MSBuild Task to integrate MSBuild (.NET 2.0) projects. The MsBuild Task page is the reference for the task, so that will always contain the most up-to-date documentation, but this page acts as a tutorial. Decide what to buildNormally, you'll want to build your project's solution file, but you may want to build a specific project file instead. You'll also need to choose whether you want to build a specific target or not. By default, building your solution with no specific target is the best way to start. In any case, before trying to get CruiseControl.NET to work, make sure you can run MSBuild manually on the command line on your build server for your desired file/target combination. Once you've done this, move on to the next step. Get the XML LoggerCruiseControl.NET uses the XML files produces by various tools in order to produce styled results. Unfortunately, MSBuild does not come with a XML Logger by default, so you need to use an external logger to get this functionality. Luckily, Szymon Kobalczyk was good enough to write one, and donated it to the CruiseControl.NET project. If ThoughtWorks.CruiseControl.MSBuild.dll is not installed in your server folder, you can download it here. Place this dll in your working directory, which will usually be the one where your target file is located. Alternatively, you can specify the full path to the logger assembly in the <logger> node of the <msbuild> task. If you want to use an alternative logger (e.g. the improved MSBuild Logger), or use the provided logger in a different way, make sure to read up about the logger property of the MsBuild Task. Setup your CruiseControl.NET config fileWith all this in place, you can add an <msbuild /> task section to your project's config file. There are quite a few properties you can set, but making sure the working directory is correct should be the first thing you look at (and normally that will be the directory your target file is in.) By default, the <msbuild> task will instruct the logger to output to a file called msbuild-output.xml in your artifact directory. The msbuild task will automatically include the contents of this file in your build results (you don't need to use the File Merge Task). You might want to consider setting the buildArgs property to include the /noconsolelogger argument to suppress console (non XML) log output. Setup the DashboardWith the build server all setup, make sure to configure your Dashboard to show MSBuild results. You will need to make the following modifications to the dashboard.config file:
AlternativesYou can also use NAnt as your primary build tool, and call MSBuild from a NAnt script. Just make sure you use the MSBuild XMLLogger and include its output in your build log. References |
| Document generated by Confluence on Mar 14, 2009 02:55 |