Skip to content
This repository was archived by the owner on Aug 10, 2021. It is now read-only.

Getting Started

JeremySkinner edited this page Sep 13, 2010 · 3 revisions

Getting the Binaries

The latest stable release is always available from the downloads page on GitHub

Continuous builds are available to download as artefacts from the CI server

Creating a Target

Similar to other build systems such as NAnt and MSBuild, Phantom allows you to define targets that can be executed from the command line.

To create a simple build script, first create a file named build.boo and enter the following text:

target default:
   print "hello world"

Open a command window in the same directory you saved this file and run path\to\phantom.exe and you should see the output “hello world”.

You can create multiple targets by calling “target” multiple times:

target sayHello:
  print "hello"

target sayGoodbye:
  print "goodbye"

To specify that the ‘sayHello’ target should be executed, you can pass the name of that target to phantom.exe:

phantom.exe sayHello

You can access environment variables from inside a target by calling the env function. For example, on most systems calling env(“windir”) would return C:\Windows

Adding Dependencies

Targets can have dependences on other targets. For example, if we wanted our ‘sayHello’ target to always be invoked before ‘sayGoodbye’, they could be defined like this:

target sayHello:
  print "hello"

target sayGoodbye, sayHello:
  print "goodbye"

Now, if you invoke phantom.exe sayGoodbye the sayHello target will be invoked first followed by the sayGoodbye target:

Targets specified: sayGoodbye


sayHello:
hello

sayGoodbye:
goodbye

Multiple targets can be specified as dependences by using an array:

target sayGoodbye, (sayHello, someOtherTarget):
  print "goodbye"

Descriptions

Targets can be annotated with descriptions by calling desc before the target definition:

desc "Prints hello"
target sayHello:
  print "hello"

These descriptions can be displayed by invoking phantom.exe -t:

Targets in build.boo:
sayHello          Prints hello

Clone this wiki locally