File Merge Task

Merges external files into the build log.

Most build processes interact with external tools that write their output to file (e.g. NUnit, FxCop, or NCover). To make the output of these tools available to CruiseControl.NET to be used in the build process or displayed in the CruiseControl.NET web page or included in CruiseControl.NET emails, these files need to be merged into the CruiseControl.NET integration.


You should place your File Merge Tasks in the <publishers /> section of your Project Configuration Block before your Xml Log Publisher.


Available from version 1.0


 2  <files>
 3    <file>
 4      <!-- path to NUnit test file -->
 5    </file>
 6    <file>
 7      <!-- path to FxCop file -->
 8    </file>
 9  </files>
 2  <files>
 3    <file>Nunit*.xml</file>
 4    <file>FXCop.xml</file>
 5    <file>resources\**\*.xml</file>
 6    <file>E:\CruiseControl\BuildRoot\ProjectX\**\coderesults.xml</file>
 7    <file>E:\CruiseControl\BuildRoot\Project*\**\Business*.xml</file>
 8  </files>

Configuration Elements

Element Description Type Required Default Version
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
files The files to merge. Merge File array Yes n/a 1.0
target The folder to copy the files to. String No Project Artifact Directory 1.0


Merge actions

Prior to CruiseControl.NET 1.5.0, all files specified in this task are merged into the build log (this is the default behaviour if no action is specified.) Since the build log is XML data, all data that is merged needed to be treated as XML data. If the data was XML, it would be merged without any problems, otherwise the data would be embedded inside a CDATA block.

With CruiseControl.NET 1.5.0 it is now possible to control how the merge will work. There are three available actions:

* Merge: the default behaviour - merge to the build log as XML if possible, as CDATA if not possible  
* CData: always merge to the build log in a CDATA block  
* Copy: instead of merging the data into the build log, it will copy the specified files into a "build" folder under the artefacts folder for the project  

The following is an example of how to configure a "copy" action instead of merging:

 2  <files>
 3    <file>
 4      <!-- path to NUnit test file -->
 5    </file>
 6    <file action="Copy">
 7      <!-- path to NUnit images -->
 8    </file>
 9  </files>

The build folder will use the same name as the build label for the project. If this folder already exists, any files within this folder will be overwritten.

Why are the merged results not showing up in the Web Dashboard?

If you have set up the configuration for the File Merge Task as described above and you are still not ending up with the appropriate results showing up within the web application, please try the following steps:

1. Click the original log link and check to see if the merged content is included in the xml. If it is missing then got onto step 2. If it is present and is still not showing up in the web page then try emailing the CCNet users list .

2. Have you put the File Merge Tasks in the <publishers /> section of your Project Configuration Block before your Xml Log Publisher?

3. Check the folder that contains the files that should be merged. If they are not there then you need to dig into your build script to find out why they aren't getting created.

4. If the files are there but aren't getting merged, double-check your ccnet.config file. Is the configuration specified correctly as specified above? Remember that case matters in XML tag and attribute names.

5. Check the ccnet.log file. You should see Info-level log messages stating that the files have been merged.

6. Does the file contain valid XML data? The File Merge Task only expects to process XML files. It will attempt to clean up non-XML files and write errors to the ccnet.log file, but it isn't always successful.

Automatically Generated

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