Running NAnt

Running NAnt is really simple. Just type

      
nant
      
    

from the project directory containing the build file of interest, and the default target is executed. The default target is specified in the default attribute of the <project> element. To use a particular target, just specify it after the nant command. It is also possible to specify more than one target at once:

      
nant target1 target2
      
    

When not otherwise specified, NAnt first looks for default.build, then for nant.build, and at the end, if none of them exist, NAnt processes the first file with the .build extension found in the current directory. Use the -find option to let NAnt search for build files in parent directories, up to the filesystem root:

      
nant -find target1 target2
      
    

To make NAnt process a specific build file, use the -buildfile:<text> option, where <text> specifies the build file to process:

      
nant -buildfile:another.build
      
    

To see which targets a build file supports, type

      
nant -projecthelp
      
    

This command also prints target descriptions, if available:

Default Target:

 build               Builds the current configuration

Main Targets:

 build               Builds the current configuration
 clean               Deletes the current configuration
 clean-all           Deletes all the configurations
 debug               Configures a debug build
 dist                Configures a distribution package
 init                Initializes building properties
 init-package        Initializes packaging properties
 install             Installs the current configuration
 package             Creates a zip archive ...
 release             Configures a release build
 src                 Configures a source package
 test                Tests the current configuration
 uninstall           Uninstalls the current configuration