Thing good thing is you don't have to use MSBuild as Eden indicates and the steps to get it working are really easy.
- First, get SourceMonitor and CCNet working together.
- Next, download the style sheets from Edens site and make the webdashboard changes.
- Then in your NAnt build script simply add a <style /> task after the <exec /> task for SourceMonitor as shown.
<!-- Execute the commands -->The <delete /> task is to clean up the sourcemonitor project file. The file grows over time so leaving it around on a busy build server is probably not a good idea and will just fill up space.
<exec program="${sourcemonitor.executable}" commandline="/C ${sourcemonitor.input}" failonerror="false" />
<style style="SourceMonitorSummaryGeneration.xsl" in="sm_details.xml" out="sm_top15.xml" />
<delete file="${codemetrics.output.dir}\sm_project.smp" failonerror="false" />
- Make sure you include the _sm_top15.xml file in your ccnet.config <merge /> task then build the project and you should see some numbers.
<xsl:when test="position() < 16" />and change the value 16 to 31.
Also, if you have nesting that goes to 9+ levels, then the summary won't show it. To get this showing you need to change the data-type to "text" in the Nesting Metrics section as shown here:
<xsl:sort select="metrics/metric[@id='M12']" order="descending" data-type="text" />Finally, you might want to change the labels in the dashboard.config and xsl\sourcemonitor.xsl files to reflect that you are showing a Top 30
Update: Eden has since fixed the stylesheet errors and made it easier to customise the number of items to show. Thanks mate!
Hi Richard. Thank you very much. Great post and thanks for spotting the bug in the summary generation. I have fixed the stylesheet.
ReplyDeleteHi ya. I have suggested to include this in the official CC.NET:
ReplyDeletehttp://jira.public.thoughtworks.org/browse/CCNET-1709
But they want your permission for using your work. Will you allow CC.NET to use your work ?
Kind regards
-Rolf Kristensen
@snakefoot No problem. Go ahead.
ReplyDelete