Skip to end of metadata
Go to start of metadata

Part 19 - Using the Boo Compiler

The Boo Compiler is typically called in this fashion:
booc <options> <files>

Command-line Options






More Verbose


Most Verbose


Add a reference to your project


Type of file to generate, can be either exe or winexe to make executables (.exe files), or library to make a .dll file


Adds a step <pipeline> to the compile.


Sets which CultureInfo to use.


Sets the name of the output file


Specify where to find the source files.


Adds debug flags to your code. Good for non-production. (On by default)


Does not add debug flags to your code. Good for production environment.


See AST after each compilation step.


Add a resource file. <name> is optional.


Add an embedded resource file. <name> is optional.

So, for example, in order to compile your Database code that depends on the library System.Data.dll, you would type: booc -r:System.Data.dll -o:Database.dll -t:library

That would create a fully functional, working compilation of your library: Database.dll

Using NAnt

When working on a large project with multiple files or libraries, it is a lot easier to use NAnt. It is a free .NET build tool.

To do the same command as above, you would create the following build file:
$ nant
NAnt 0.85 (Build 0.85.1869.0; rc2; 2/12/2005)
Copyright (C) 2001-2005 Gerry Shaw

Buildfile: file:///path/to/
Target framework: Microsoft .NET Framework 1.1
Target(s) specified: build



     [booc] Compiling 1 file(s) to /path/to/bin/Database.dll.


Total time: 0.2 seconds.

And although that was a long and drawnout version of something so simple, it does make things a lot easier when dealing with multiple files.

It also helps that if you make a change to your source files, you don't have to type a long booc phrase over again.

The important part of the build file is the <booc> section. It relays commands to the compiler.
There are four attributes available to use in it:




Output type, one of library, exe, winexe. Optional. Default: exe.


The name of the output assembly. Required.


AssemblyQualifiedName for the CompilerPipeline type to use. Optional.


Enables compiler tracing, useful for debugging the compiler, one of: Off, Error, Warning, Info, Verbose. Optional. Default: Off.

You are most likely only to use target and output.

For nested elements, you have 3 possibilities:

Nested Element



Source files. Required.


Assembly references.


Embedded resources.

Inside these you are to put <include /> elements, as in the example.

This is merely a brief overview of NAnt, please go to their website for more information.

Go on to Part 20 - Structure of a Boo Project

  • No labels