-
Notifications
You must be signed in to change notification settings - Fork 22
Getting Started
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
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
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"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