There are basically three ways to compile your boo code:
booc -r:System.Windows.Forms -out:build/HelloForms.exe examples/helloforms.boo booc -t:library -out:build/MyLibrary.dll alibrary.boo |
booc -r:Utilities.dll MyProgram.boo |
booc -o:SpongeBob.exe MyProgram.boo |
will create an .exe file named SpongeBob.exe instead of MyProgram.exe
<booc target="winexe" output="build/HelloForms.dll">
<sources basedir="examples">
<include name="HelloForms.boo" />
</sources>
<references>
<include name="System.Window.Forms.dll" />
</references>
</booc>
|
Look here for details.
import Boo.Lang.Compiler
import Boo.Lang.Compiler.IO
import Boo.Lang.Compiler.Pipelines
// create a compiler object
compiler = BooCompiler()
// set the inputs
compiler.Parameters.Input.Add(StringInput("<script>", "print('Hello!')"))
// set the output
compiler.Parameters.OutputAssembly = "test.exe"
// configure the pipeline
compiler.Parameters.Pipeline = CompileToFile()
// run
result = compiler.Run()
// check for errors
print(join(result.Errors)) if len(result.Errors)
|
Here are instructions for running and compiling boo scripts that use Mono-only assemblies (such as Mono.GetOptions.dll or gtk-sharp.dll) on a Windows machine. I'm assuming you are already familiar with using the Windows command prompt (the open command here XP powertoy is helpful).
mono bin\booc.exe -r:gtk-sharp -out:bin\gtk.exe examples\gtk.boo mono bin\booc.exe -r:Mono.GetOptions -out:bin\GetOptions.exe examples\GetOptions.boo |
mono bin\GetOptions.exe |
Pretty much any application or dll library you compile in boo will depend on the Boo.Lang.dll. You need to include that dll with your application or library when distributing it.
You can use a tool called ILMerge to combine the Boo.Lang.dll into your exe or dll. See Merge Boo.Lang.dll into your exe or dll.