Thursday, May 20, 2004

NAnt Part 2

We'll I've successfully gotten my first build to work with NAnt and it works great. It took me a week to do what a full time contractor took a month to do previously. My build does the following:

Creates support directories:
Checks the entire build tree out of source control
Recursively compiles the code. (Using the solution task).
Runs NUnit on the output to execute the unit tests.
Runs NDoc to produce all of the product documentation.
Creates and installer.
Emails the development team about the state of the build.


So what is the secret? The secret for NAnt is that its tools are directly relevant to the task of building. For example for the NUnit task you simply specify the assembly containing the unit tests and the format you want your report in, and you're done.

The other key thing about NAnt is that it unifies the calling conventions for all of the tools you use in a build. To build a product you need compilers, test harnesses, source code control commands, and so on. Normally you have a learning curve for each one of these tools. You need to go through the documentation for each and learn the syntax and calling conventions for each tool. And to be certain each tool has a different calling convention.

With NAnt all of the hard work of how to call the tools is hidden. Instead there is a unified syntax for everything. I think that is the biggest reason that it is so easy to create build environments with this tool.

So here is a application design pattern: The Unified Syntax Pattern. With this pattern you take tools/components that are all used together and wrap them in a unifying syntax. The end result is orders of magnitude ease of use improvement.

No comments: