forked from psake/psake
-
Notifications
You must be signed in to change notification settings - Fork 17
What is the structure of a psake build script?
jmatos edited this page Sep 13, 2010
·
9 revisions
A psake build script contains calls to functions that the psake build engine will execute.
The functions are the following:
Function | Description | Required |
Include() | Call this function to have psake include the functions of another file into your script | no |
Properties() | Call this function to set your properties | no |
Task() | This is the main function that you write to execute a step in your build script. NOTE: There can be only one task function that is named “default” in your psake script and it cannot contain any code. psake will throw an exception if it finds more than one default task function or if the default task function contains code | yes |
Exec() | Call a command-line program and throw an exception if it returns a non-zero DOS exit code | no |
Assert() | Use to simplify writing conditional statements | no |
FormatTaskName() | Allows you to reformat how psake displays the currently running task | no |
TaskSetup() | A function that will run before each task is executed | no |
TaskTearDown() | A function that will run after each task | no |
An example psake script:
Task default -Depends Test
Task Test -Depends Compile, Clean {
“This is a test”
}
Task Compile -Depends Clean {
“Compile”
}
Task Clean {
“Clean”
}