Boo Compiler Options

There are lots of options for building Boo.

I got fed up having to look up the options so I have them all here.

Usage is: booc [options] file1 …
Options:
 -c:CULTURE           Sets the UI culture to be CULTURE
 -debug[+|-]          Generate debugging information (default: +)
 -define:S1[,Sn]      Defines symbols S1..Sn with optional values (=val) (-d:)
 -delaysign           Delays assembly signing
 -ducky               Turns on duck typing by default
 -checked[+|-]        Turns on or off checked operations (default: +)
 -embedres:FILE[,ID]  Embeds FILE with the optional ID
 -lib:DIRS            Adds the comma-separated DIRS to the assembly search path
 -noconfig            Does not load the standard configuration
 -nostdlib            Does not reference any of the default libraries
 -nologo              Does not display the compiler logo
 -p:PIPELINE          Sets the pipeline to PIPELINE
 -o:FILE              Sets the output file name to FILE
 -keyfile:FILE        The strongname key file used to strongname the assembly
 -keycontainer:NAME   The key pair container used to strongname the assembly
 -reference:ASS       References the specified assembly (-r:ASS)
 -srcdir:DIR          Adds DIR as a directory where sources can be found
 -target:TYPE         Sets the target type (exe, library or winexe)
 -resource:FILE[,ID]  Embeds FILE as a resource
 -pkg:P1[,Pn]         References packages P1..Pn (on supported platforms)
 -utf8                Source file(s) are in utf8 format
 -v, -vv, -vvv        Sets verbosity level from warnings to very detailed
 -wsa                 Enables white-space-agnostic build

Direct compile line:

booc -t:library bender.boo

booc wpfdemo.boo -r:PresentationCore.dll -r:PresentationFramework.dll -r:WindowsBase.dll

Note you can supply multiple boo source files to split the project.

Nant build script:

<?xml version=”1.0″ ?>
<project name=”wpfdemo” default=”build”>
<property name=”boo.dir” value=”C:/boo/bin” />
    <target name=”build” depends=”wpfdemo” />
    <target name=”wpfdemo”>
        <loadtasks assembly=”${boo.dir}/Boo.NAnt.Tasks.dll” />
                 <booc output=”wpfdemo.exe” target=”winexe”>
            <references>
                <include name=”C:/Program Files/Reference Assemblies/Microsoft/Framework/v3.0/*.dll” />
            </references>
            <sources>
                <include name=”wpfdemo.boo” />
            </sources>
        </booc>
    </target>
</project>

You can also use msbuild:

<Project DefaultTargets=”Build” xmlns=”http://schemas.microsoft.com/developer/msbuild/2003″&gt;
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <RootNamespace>Bake.Example</RootNamespace>
    <AssemblyName>Bake.Example</AssemblyName>
    <Configuration Condition=” ‘$(Configuration)’ == ” “>Debug</Configuration>
    <Platform Condition=” ‘$(Platform)’ == ” “>AnyCPU</Platform>
    <ProjectGuid>{707667FA-CDCB-4756-9EF0-96DB18A53DCD}</ProjectGuid>
    <NoStdLib>False</NoStdLib>
    <Ducky>False</Ducky>
  </PropertyGroup>
  <PropertyGroup Condition=” ‘$(Configuration)’ == ‘Debug’ “>
    <BaseIntermediateOutputPath>obj</BaseIntermediateOutputPath>
    <IntermediateOutputPath>objDebug</IntermediateOutputPath>
    <OutputPath>….bin</OutputPath>
    <Optimize>False</Optimize>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>Full</DebugType>
  </PropertyGroup>
  <PropertyGroup Condition=” ‘$(Configuration)’ == ‘Release’ “>
    <BaseIntermediateOutputPath>obj</BaseIntermediateOutputPath>
    <IntermediateOutputPath>objRelease</IntermediateOutputPath>
    <OutputPath>….bin</OutputPath>
    <Optimize>True</Optimize>
    <DefineConstants>TRACE</DefineConstants>
    <DebugSymbols>false</DebugSymbols>
    <DebugType>None</DebugType>
  </PropertyGroup>
  <ItemGroup>
    <Compile Include=”Program.boo” />
  </ItemGroup>
  <ItemGroup>
    <Content Include=”example.boobs” />
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include=”..bake.engineBake.Engine.booproj”>
      <Project>{B86E7336-0498-486D-A199-FC19ED9740AF}</Project>
      <Name>Bake.Engine</Name>
    </ProjectReference>
  </ItemGroup>
  <Import Project=”$(BooBinPath)Boo.Microsoft.Build.targets” />
</Project>

Bake:

import Bake.IO.Extensions

Task(“default”, [“test”])

Task(“compile”, [“codeGen”]) do:
    print “> do compile stuff”

Task(“dataLoad”, [“codeGen”]) do:
    print “> do dataLoad stuff”

Task(“codeGen”) do:
    print “> do codeGen stuff”

Task(“test”, [“compile”, “dataLoad”]) do:
    print “> do test stuff”
    print Configuration.test

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s