Sunday 13 July 2008

Automating your project compilation,Testing & Documentation for developers

Project compilation,Testing & Documentation for developers; You must be wondering sometime if you can do all this in a just click.

Yes its possible through the usage of following tools
  • CruiseControl
  • NANT
  • Nunit
  • NDoc

CruiseControl very well integrates with these tools. I use Cruisecontrol to manage the build for all my projects. Use Nant to script my build process and NUnit to script my Test cases. NDoc will generate MSDN like help file with every build. Thats Cool!! It always keep my documentation in sync.

I will provide some sample scripts in my future post for your reference. I have script/ sample for all of these tools. And I am sure that will really help you guys in easily configuring the same for your projects.

Friday 4 July 2008

NANT Build for .Net 2.0 / 3.0 / 3.5

I have successfully automated the build process using Nant and Cruisecontrol tools for Framework 1.1. I am currently working on extending same for .Net Framework 2.0 , 3.0 and 3.5 .

NAnt 0.86 Beta 1 Release supports all the folowing Frameworks for .Net as per the release notes

.NET Framework 1.0
.NET Framework 1.1
.NET Framework 2.0
.NET Framework 3.5

Some of my collegues have faced problem in compiling VS 2005 projects with Nant and Cruisecontrol. They used something like this

<solution solutionfile="MySolution.sln" configuration="release" outputdir="c:\temp" />

I have spend some time to understand why they were facing problem in compiling these projects and found that some how Nant script was not interpreting the Solution files correctly and because of that they were facing issues.

The way i write build scripts for compiling is that rather than solution file in tag I specify a list of project files in a text file and mention that file in . And it works perfectly. Something like this

Option 1:


<solution configuration="release">
<projects>
<includesfile name="Myprojects.txt" />
</projects>
</solution>

OR
Option 2: You can also specify as follows


<solution configuration="release">
<projects>
<include name="Proj1\Proj1.vbproj" />
<include name="Proj2\Proj2.vbproj" />
</projects>
<referenceprojects>
<include name="ProjA\ProjA.vbproj" />
</referenceprojects>
</solution>

Option 1 is more flexible as you can easily add or remove projects or change order of compiling without touching your build script.

I will provide more samples in future post.

Today its "Happy Independence Day". So its time to enjoy fireworks.