How to build NUnit from source using NAnt
We consider the NAnt build script to be the primary method for building NUnit. All distributed releases are built using NAnt and certain functions - like generating source files and creating an install package - are only available through the script.
The complete download source package, available from our repository, includes the necessary NAnt binaries. If you build using the source code distributed with each release, you will have to install NAnt yourself. You need version 0.90 or higher to build NUnit.
The simplest build is created by using the 'build' target by itself:
This will build a debug version of NUnit using the default runtime on your system, which depends on the particular runtimes you have installed. To see the defaults that will be used on your system, enter the 'nant' command without any arguments.
To build a release version of NUnit, use the command
nant release build
To build a version that uses a particular runtime, use
nant RUNTIME build
where RUNTIME may be any of the following:
- net, net-1.0, net-1.1, net-2.0
- mono, mono-1.0, mono-2.0
The specified runtime and sdk must be installed on your system in order for the build to succeed. The build output is placed in a subdirectory of the build directory, named according to the configuration and runtime, for example: build/net/2.0/release.
Here are some additional examples of build commands…
Do a clean release build using .NET 2.0.
nant net-2.0 release clean build
Build the default (debug) config for all supported runtimes
Clean, build and run tests using the default (debug) config and runtime.
nant clean build test
Use nant -projecthelp to see a full list of targets.