This page last changed on Mar 13, 2009 by dna.

Run Mono's Gendarme as part of your integration

Gendarme is a extensible rule-based tool to find problems in .NET applications and libraries. Gendarme inspects programs and libraries that contain code in ECMA CIL format (Mono and .NET) and looks for common problems with the code, problems that compiler do not typically check or have not historically checked.

Homepage: http://www.mono-project.com/Gendarme
Google Group: http://groups.google.com/group/gendarme

Run Gendarme as a CruiseControl.NET Task

The Gendarme task will be available after the 1.4.3 release.

You can also apply the patch from http://jira.public.thoughtworks.org/browse/CCNET-1401

See the Gendarme Task for common use.

Run Gendarme as part of your NAnt build

An alternative to get the results of Gendarme included in the CruiseControl.NET build results, you will need to call Gendarme through NAnt and include the Gendarme XML output file with a File Merge Task.

You can either use the <exec> or <gendarme> NAnt task.

<target name="runGendarme">
	<gendarme executable="${path::combine( path::combine('Tools', 'Gendarme'), 'gendarme.exe')}"
		outputType="XmlFile" outputFile="${path::combine(build.out.dir, 'gendarme-result.xml')}">
		<assemblies>
			<include name="${path::combine(build.out.dir, '*.dll')}" />
			<include name="${path::combine(build.out.dir, '*.exe')}" />
			<exclude name="${path::combine(build.out.dir, '*.config')}" />
		</assemblies>
	</gendarme>
</target>
Merge Gendarme results into your CruiseControl.NET results

The next step is to merge the Gendarme XML output file into the build result using the File Merge Task:

<tasks>
    <merge>
        <files>
            <file>d:\sourceforge\ccnet\build\Gendarme\gendarme-result.xml</file>
            <!-- Other files to merge for your build would also be included here -->
      	</files>
    </merge>
</tasks>
Configuring your Reporting Application to display Gendarme results
As soon as the Gendarme Task Patch is applied there is nothing else to do.

Copy the 2 xsl files from the Gendarme Task Patch to your webdashboard\xsl\ dictionary and add following entries to your webdashboard.config:

<buildPlugins>
    <buildReportBuildPlugin>
        <xslFileNames>
            ...
            <xslFile>xsl\gendarme-summary-ccnet.xsl</xslFile>
            ...
        </xslFileNames>
    </buildReportBuildPlugin>
    <buildLogBuildPlugin />
    ...
    <xslReportBuildPlugin description="Gendarme Report" actionName="GendarmeBuildReport" xslFileName="xsl\gendarme-report-ccnet.xsl"/>
    ...
Document generated by Confluence on Mar 14, 2009 02:55