Automating the build process using Visual Studio.Net 2003, CruiseControl.Net, NAnt, and NDoc

I like the idea of automated builds a lot. Cory Foy taught me a lot about the idea, and I've only recently really had a lot of time to dedicate to learning more about the whole process of setting up an automated build. Today I decided to fire off NDoc during a CCNet build. It took awhile to get it down-pat (and required a little help from Cory, to boot). In the spirit of trying to make life as easy as possible, here's the code to do it in as simple-and-direct-a-method as I could come up with.

First of all, here's the CruiseControl.Net server configuration file in its entirety.

    1 <cruisecontrol>

    2     <projectname="CCNetSample">

    3         <tasks>

    4             <devenv>

    5                 <solutionfile>C:\CCNetSample\CCNetSample.sln</solutionfile>

    6                 <configuration>Debug</configuration>

    7             </devenv>

    8             <nant>

    9                 <executable>c:\nant\bin\nant.exe</executable>

   10                 <baseDirectory>C:\CCNetSample\</baseDirectory>

   11                 <buildFile>build.xml</buildFile>

   12                 <targetList>

   13                     <target>doc</target>

   14                 </targetList>

   15             </nant>

   16         </tasks>

   17     </project>

   18 </cruisecontrol>

Finally, the build.xml file.

    1 <projectname="CCNetSample"default="doc"basedir=".">

    2     <targetname="doc">

    3         <ndoc>

    4             <assembliesbasedir="C:\CCNetSample\CCNetSample.Client\bin\Debug\">

    5                 <includename="CCNetSample.Client.exe"/>

    6                 <includename="CCNetSample.Lib.dll"/>

    7             </assemblies>

    8             <documenters>

    9                 <documentername="MSDN">

   10                 </documenter>

   11             </documenters>

   12         </ndoc>

   13     </target>

   14 </project>

Hope that helps someone who's ever in the same need.