-
Notifications
You must be signed in to change notification settings - Fork 4
Tasks | Inner functions
Prints the message to output log. The message is printed if output verbosity level includes message level.
- Level parameter must take one of the following values: Level.Message, Level.Error, Level.Command, Level.Warning, Level.Info, Level.Debug, Level.Verbose, Level.Never
do! trace Level.Info "Using csc compiler version %s" "1.0"
getTargetFile
returns the File of the currently executing target. getTargetFullName
return full name of that file.
let! targetFileName = getTargetFullName()
do! trace Level.Info "Compiling %s..." targetFileName
Get the matched part of the target file.
See the part of the file name is put in brackets and supplied a group name "root":
"(root:*).exe" ..> recipe {
let! name = getRuleMatch "root"
do! csc {src (!!(name + ".cs") ++ "ver.cs")}
}
need
function is widely used internally and it is a key element for dependency tracking. Calling need
ensures the requested files are built according to rules.
The action is paused until all dependencies are resolved and built.
do! need ["bin/app.exe"; "bin/app.exe.config"]
needFiles
function is similar but it accepts list of File objects instead of strings.
Gets action context.
Gets the script variable value (and records dependency!).
let! dotnetFwk = getVar "NETFX"
where NETFX
variable is defined as:
do xake {ExecOptions.Default with Vars = ["NETFX", "4.5"] } {
...
// or
do xakeScript {
var "NETFX" "4.5"
...
or passed via command line:
fsi build.fsx -- build -d NETFX=4.5
This command alse records that currently executing target depends on the value of this variable. In case the value of the variable is different from the value of that variable during previous build, the target will be rebuilt.
Gets environment variable (and records dependency!).
let! dotnetFwk = getEnv "USERNAME"
Evaluates the fileset to a list of files (of File
type). Filesets are always resolved using project root folder (passed in script arguments).
let! (Filelist files) = (!!"hello*.cs") |> getFiles
This command also records dependency and the target will rerun if result of getFiles
call is changed during the next run: wheter files were added or removed, or if timestamp of any file is changed.
Instructs Xake to rebuild the target even if dependencies are not changed. this is expecially important for phony actions which do not produce a file.
do! alwaysRerun()
- Creating simple script
- Running the first build
- What the rule and recipe is?
- Filesets defined
- Editing the script
- Configure your project and CI
- Defining filesets
- Recipe computation
- Declaring the rules
- Error handling and exceptions
- Script and environment settings
- Command line interface (CLI)
- Writing cross-platform scripts
- Build-in functions
- .NET tasks
- System tasks
- Other
- ...