CruiseControl.NET and Sandcastle Help File Builder

We're starting a new project on Monday and I wanted to be ahead of the game and have our agile systems in place, ready for the first sprint. Number one on that list is having an automatic, continuously integrated build. As many others have pointed out, F5 is not a build process, and it's something that I used to send a lot of time working on.

For this project, we're working with CruiseControl.NET. It's pitched right at .NET development, it's free and community driven, and seems to work well for small teams. And small teams don't get much smaller than two guys. We have three projects in the ccnet.config file, so it's not yet an unmanageable mess of XML.

The nicest feature of CC.NET is its ability to pull in log files from a number of tools. If the tool spits out XML, you can use the CC.NET built in .xsl transforms to pretty-format your logs to HTML or email or whatever.

However, if you use a tool that doesn't have a nice .xsl transform, you're on your own. And that seems to be where we are with Sandcastle.

Sandcastle is Microsoft's new replacement for NDoc. And it's pretty complicated to get formatted correctly. But adding Sandcastle Help File Builder (SHFB) on top of it makes it nearly trivial to generate your documentation. The downside was that I could not find a CruiseControl.NET .xsl transform for the SHFB log files.

So I wrote one. Get the files here.

It's based on the TransformBuildLog.xsl file that is distributed with SHFB, and since the package is Ms-PL-licensed, it's all free and ready to go.

  1. Add the ShfbReport.xsl and ShfbSummary.xsl to the webdashboard/xsl directory.
  2. Add the following lines to the dashboard.config file
    <buildPlugins>
        <buildReportBuildPlugin>
             <xslFileNames>
                 <!-- other stuff here -->
                 <xslFile>xsl\ShfbSummary.xsl</xslFile>
             </xslFileNames>
         </buildReportBuildPlugin>
         <!-- other stuff here -->
         <xslReportBuildPlugin description="SHFB Report" actionName="ShfbReport" xslFileName="xsl\ShfbReport.xsl" />
       
    
  3. Add lines to your ccnet.config file to call SHFB, and remember to merge the log into your build log
    <tasks>
        <exec>
            <executable>C:\Program Files\EWSoftware\Sandcastle Help File Builder\SandcastleBuilderConsole.exe</executable>
             <baseDirectory>C:\cruisecontrol\example\trunk\Source</baseDirectory>
             <buildArgs>"C:\cruisecontrol\example\trunk\Source\ExampleDoc.shfb"</buildArgs>
             <buildTimeoutSeconds>10800</buildTimeoutSeconds> <!-- 3 hours -->
         </exec>
     </tasks>
    
     <publishers>
         <merge>
             <files>
                 <file>ExampleHelp\LastBuild.log</file> <!-- Sandcastle Help File Builder. ExampleHelp/ directory is referenced in ExampleDoc.shfb -->
             </files>
         </merge>
         <xmllogger logDir="log" />
     </publishers>
          
    

Next up, using NSIS Installer with CruiseControl.NET

Post new comment

The content of this field is kept private and will not be shown publicly.