-
Notifications
You must be signed in to change notification settings - Fork 148
Boo Primer: [Part 19] Using the Boo Compiler
Added by Cameron Kenneth Knight
The Boo Compiler is typically called in this fashion:
booc <options> <files>
Option |
Description |
---|---|
|
Verbose |
|
More Verbose |
|
Most Verbose |
|
Add a reference to your project |
|
Type of file to generate, can be either |
|
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. |
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:
<?xml version="1.0" ?>
<project name="Goomba" default="build">
<target name="build" depends="database" />
<target name="database">
<mkdir dir="bin" />
<booc output="bin/Database.dll" target="library">
<references basedir="bin">
<include name="System.Data.dll" />
</references>
<sources>
<include name="Database.boo" />
</sources>
</booc>
</target>
</project>
$ nant
NAnt 0.85 (Build 0.85.1869.0; rc2; 2/12/2005)
Copyright (C) 2001-2005 Gerry Shaw
http://nant.sourceforge.net
Buildfile: file:///path/to/default.build
Target framework: Microsoft .NET Framework 1.1
Target(s) specified: build
build:
database:
[booc] Compiling 1 file(s) to /path/to/bin/Database.dll.
BUILD SUCCEEDED
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:
Attribute |
Description |
---|---|
|
Output type, one of |
|
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 |
Description |
---|---|
|
Source files. Required. |
|
Assembly references. |
|
Embedded resources. |
Inside these you are to put elements, as in the example.
This is merely a brief overview of NAnt, please go to their website http://nant.sourceforge.net for more information.
Go on to Part 20 - Structure of a Boo Project
Back to: Home | Boo Primer