- Index
- »
- build
- »
- BuildScript
type
BuildScript
src
abstract class BuildScript : Obj
BuildScript is the base class for build scripts - it manages the command line interface, argument parsing, environment, and target execution.
See Build for details.
fields
devHomeDir |
Home directory of development installation. |
---|---|
log |
Log used for error reporting and tracing |
scriptDir |
The directory containing the this script |
scriptFile |
The source file of this script |
methods
applyMacros |
Apply a set of macro substitutions to the given pattern. |
---|---|
config |
Get a config property using the following rules |
configDir |
Get a |
configs |
Get the key/value map of config props which are loaded from "etc/build/config.props". |
dumpEnv |
Dump script environment for debug. |
fatal |
Log an error and return a FatalBuildErr instance |
main |
Run the script with the specified arguments. |
target |
Lookup a target by name. |
targets |
Get the list of published targets for this script. |
toStr |
Return this script's source file path. |
Slot Details
applyMacros
src
Str applyMacros(Str pattern, Str:Str macros := this.configs())
Apply a set of macro substitutions to the given pattern. Substitution keys are indicated in the pattern using "@{key}" and replaced by definition in macros map. If a substitution key is undefined then raise an exception. The configs
method is used for default macro key/value map.
config
configDir
configs
devHomeDir
src
const File devHomeDir := ...
Home directory of development installation. By default this value is initialized by devHome
config prop, otherwise Env.homeDir
is used.
dumpEnv
fatal
src
FatalBuildErr fatal(Str msg, Err? err := null)
Log an error and return a FatalBuildErr instance
log
main
scriptDir
scriptFile
target
src
TargetMethod? target(Str name, Bool checked := true)
Lookup a target by name. If not found and checked is false return null, otherwise throw an exception.
targets
src
virtual TargetMethod[] targets()
Get the list of published targets for this script. The first target should be the default. The list of targets is defined by all the methods with the Target
facet.