Saturday, November 17, 2007

NAnt ...a short introduction by Nitin Reddy Katkam

What is NAnt?

NAnt is a tool used to compile source code without using an IDE. It is a command-line utility and runs with instructions written in XML. With the ability to perform most compilation tasks and to execute commands, just as shell scripts do, NAnt makes a useful addition to the tools used by any large .NET software project. NAnt is actually a .NET version of the popular Apache Ant for Java.

Getting Started

If you would like to install NAnt, you can download the binaries required from:

Compilation directives can be provided in the instruction file by either explicitly specifying the source files or by specifying the solution file from which all details required for compilation can be obtained. You can override solution settings by excluding projects from a solution.

You can find a sample build instruction file at:

How does NAnt work?

NAnt follows the 'build target' concept from Make that allows you to perform a sequence of steps by providing a parameter; if no parameter is found, the default target specified is built. As is the case with makefile, NAnt can run without any parameters by looking for an instruction file in the current directory; for NAnt, the instruction file ends with a .build extension.

The command line parameters you can provide are: , -buildfile:, -D:=


For reference, you will probably want to start off with looking at the tasks that you can provide to NAnt at:

You can get more at:

Additional Notes

When you build a project, NAnt compares the timestamp of the source code with that of the executables and only compiles if the timestamp of the source code is newer.

No comments: