Note: This is the migration API reference for FAKE 5. The new (modularized) API documentation can be found here. If the API is already migrated you can check here if exists in a module. More information regarding the migration can be found here

Target

Nested types and modules

TypeDescription
OptionalTargetContext

Optional TargetContext

ModuleDescription
WithContext

Run functions which don't throw and return the context after all targets have been executed.

Functions and values

Function or valueDescription
Target.activateBuildFailure(name)
Signature: name:string -> unit

Activates the build failure target.

Target.activateFinal(name)
Signature: name:string -> unit

Activates the final target.

Target.create name body
Signature: name:string -> body:(TargetParameter -> unit) -> unit

Creates a Target.

Target.createBuildFailure name body
Signature: name:string -> body:(TargetParameter -> unit) -> unit

Creates a target in case of build failure (not activated).

Target.createFinal name body
Signature: name:string -> body:(TargetParameter -> unit) -> unit

Creates a final target (not activated).

Target.deactivateBuildFailure(name)
Signature: name:string -> unit

Deactivates the build failure target.

Target.deactivateFinal(name)
Signature: name:string -> unit

deactivates the final target.

Target.DoNothing(_arg1)
Signature: _arg1:TargetParameter -> unit
Attributes:
[<Obsolete("Use ignore instead")>]
OBSOLETE

Use ignore instead

Do nothing - Can be used to define empty targets.

Target.get(name)
Signature: name:string -> Target
Target.getArguments()
Signature: unit -> string [] option

allows to retrieve the arguments passed into the current execution, when Target.run*withArguments overloads are used, see https://fake.build/core-targets.html#Targets-with-arguments This function should be used at the start of your fake script Alternatively, you can use Target.initEnvironment() instead, Note: This function usually returns Some [||], it will return None when No actual execution was requested (for example because of --list), you shouldn't execute any side effects when None is returned (you should never execute side effects but you can use this flag to check if needed)

Target.initEnvironment()
Signature: unit -> unit

allows to initialize the environment before defining targets This function should be used at the start of your fake script see https://github.com/fsharp/FAKE/issues/2283 Alternatively, you can use Target.getArguments() instead

Target.listAvailable()
Signature: unit -> unit

List all targets available.

Target.printDependencyGraph(...)
Signature: verbose:bool -> target:string -> unit

Writes a dependency graph.

Target.raiseIfError(context)
Signature: context:OptionalTargetContext -> unit

If TargetContext option is Some and has error, raise it as a BuildFailedException

Target.removeCollectStack
Signature: unit -> unit
Target.removeLastDescription
Signature: unit -> unit
Target.run parallelJobs targetName args
Signature: parallelJobs:int -> targetName:string -> args:string list -> unit

Runs a target and its dependencies

Target.runAndGetContext(...)
Signature: parallelJobs:int -> targetName:string -> args:string list -> TargetContext
Attributes:
[<Obsolete("Use Target.WithContext.run instead")>]
OBSOLETE

Use Target.WithContext.run instead

Runs a target and its dependencies and returns a TargetContext

Target.runOrDefault(defaultTarget)
Signature: defaultTarget:string -> unit

Runs the command given on the command line or the given target when no target is given

Target.runOrDefaultWithArguments(...)
Signature: defaultTarget:string -> unit

Runs the command given on the command line or the given target when no target is given

Target.runOrList()
Signature: unit -> unit

Runs the target given by the target parameter or lists the available targets

Target.runSimple name args
Signature: name:string -> args:string list -> TargetResult

This simply runs the function of a target without doing anything (like tracing, stopwatching or adding it to the results at the end)

Target.runSimpleWithContext name ctx
Signature: name:string -> ctx:TargetContext -> TargetResult

This simply runs the function of a target without doing anything (like tracing, stopwatching or adding it to the results at the end)

Target.setCollectStack
Signature: bool -> unit
Target.setLastDescription
Signature: string -> unit
Target.setPrintStackTraceOnError
Signature: bool -> unit
Target.updateBuildStatus(context)
Signature: context:OptionalTargetContext -> unit

Updates build status based on OptionalTargetContext Will not update status if OptionalTargetContext is MaybeSet with value None