-
Notifications
You must be signed in to change notification settings - Fork 0
Tasks | Inner functions
These functions are available inside recipe { ... } blocks. All require do! or let! syntax.
Writes a message to the build log at the specified level.
do! trace Message "Build started"
do! trace Info "Compiling %s v%s" name version
do! trace Error "Failed: %s" errorMessageLevels: Message, Error, Command, Warning, Info, Debug, Verbose, Never.
Demands targets to be built. Pauses execution until all are ready. Records dependencies.
do! need ["lib.dll"; "utils.dll"]Same as need but accepts a Filelist instead of strings.
let! files = getFiles !! "src/**/*.fs"
do! needFiles filesDemands targets one at a time, waiting for each to complete before starting the next.
do! needSequentially ["build"; "test"; "deploy"]Evaluates a fileset to a file list and records a dependency on the result. The target reruns when files are added or removed.
let! files = getFiles <| fileset {
basedir "src"
includes "**/*.fs"
}Combines getFiles and needFiles — evaluates the fileset and demands all matching files.
do! dependsOn !! "src/**/*.fs"Get the current target's file. Only works for file rules.
let! file = getTargetFile() // File
let! fullPath = getTargetFullName() // stringGet all target files for multi-file rules.
let! [exeFile; xmlFile] = getTargetFiles()Extract named capture groups from the rule pattern.
"(dir:*)/(file:*).fs" ..> recipe {
let! dir = getRuleMatch "dir"
let! file = getRuleMatch "file"
let! allMatches = getRuleMatches() // Map<string,string>
}Gets a script variable value and records a dependency.
let! version = getVar "VERSION" // string optionFor new code, prefer typed variables over
getVar.
Gets an environment variable value and records a dependency.
let! user = getEnv "USERNAME" // string optionFor new code, prefer typed variables with
Var.env.
Gets the script execution options.
let! opts = getCtxOptions()
let root = opts.ProjectRootForces the target to rebuild regardless of dependencies.
do! alwaysRerun()