Code generator that creates NAnt build scripts and master.build 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 master.build
How Do I Get Started?
- Open the .sln
- Set NantGenie project as the Startup Project.
- Open Program.cs
- 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.)
- Hit F5!
- In a command prompt, Run NAnt from your root working directory (where the master.build file is.)
What Does it Do?
- Search through all sub directories of the root directory, find all project files.
- Creates a NAnt http://nant.sourceforge.net projectFile.build file foreach project (unless it is an Excluded File)
- Then creates a master.build file (to be run from your Continuous Integration server.)
- The build files give you the option of just building the projects or build and test.
- 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 ExampleMaster 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 master.build 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