This project is read-only.
Project Description
Code generator that creates NAnt build scripts and file.

Given the base Dir of your dev tree it will create a .build file for every project file it finds.

The build files include 'build' and 'test' sections. Each individual .build is called from the

How Do I Get Started?

  1. Open the .sln
  2. Set NantGenie project as the Startup Project.
  3. Open Program.cs
  4. Set the root working directory (about line 25) to the root directory of your dev tree (where you keep all of your code projects, solutions etc.)
  5. Hit F5!
  6. In a command prompt, Run NAnt from your root working directory (where the file is.)

What Does it Do?

  1. Search through all sub directories of the root directory, find all project files.
  2. Creates a NAnt file foreach project (unless it is an Excluded File)
  3. Then creates a file (to be run from your Continuous Integration server.)
  4. The build files give you the option of just building the projects or build and test.
  5. Importantly it will try to find a matching test file for each project it finds (and doesn't create .build files for projects it thinks are test files.) The golden rule for this to work is, the name of the test project should be the same as the project being tested...with some kind of suffix, e.g. Tests.

Where are the Examples?

Build File Example
Master Build File Example

Where are the Templates?

There are not any templates as such. Just a class for each generator, which internally has methods to generate each 'section' of the generated code. Nothing wrong with templates, I just find it easier and (for me anyway) more intuitive to stay in visual studio and C# and generate code from there. Plus in visual studio I have the full power of .Net at my fingertips when generating the code without the limitations imposed by scripting languages.


  • When you run the build, the results will be put into a 'Build' folder which can found in the same directory as the build file you ran. E.g. if you ran the then you should now have a 'Build' directory in your root working directory.
  • You will need to download 'ThoughtWorks.CruiseControl.MSBuild.dll' (just Google it) and put it in a folder called C:\Build\CCLogger. The generator will run without it but the build files need it. Maybe with the newer version of Cruise Control this isn't necessary to have in the build file anymore...I haven't investigated. Of course you can easily change the generator so the build files don't require it.


There's nothing amazing about the build files, they're just what I've been using for years. Any suggestions for improvement are welcome :-)

Other Continuous Integration Tips

Checkout my blog articles

Last edited Feb 24, 2009 at 12:02 AM by wallism, version 15