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

FakeVar

This module contains helpers for managing build time variables

Functions and values

Function or valueDescription
FakeVar.define(name)
Signature: name:string -> (unit -> 'a option) * (unit -> unit) * ('a -> unit)
Type parameters: 'a

Define a named FakeVar providing the get, remove and set And of the functions will fail if there is no context

FakeVar.defineAllowNoContext(name)
Signature: name:string -> (unit -> 'a option) * (unit -> unit) * ('a -> unit)
Type parameters: 'a

Define a named FakeVar providing the get, remove and set Will use a local variable if there is no context

FakeVar.defineOrNone(name)
Signature: name:string -> (unit -> 'a option) * (unit -> unit) * ('a -> unit)
Type parameters: 'a

Define a named FakeVar providing the get, remove and set Will always return 'None' when no context is set and 'throw' on set

FakeVar.get(name)
Signature: name:string -> 'a option
Type parameters: 'a

Gets a strongly typed FakeVar by name returning an option type

FakeVar.getFrom name context
Signature: name:string -> context:FakeExecutionContext -> 'a option
Type parameters: 'a
FakeVar.getOrDefault name defaultValue
Signature: name:string -> defaultValue:'a -> 'a
Type parameters: 'a

Gets a strongly typed FakeVar by name will return default value if variable is not found

FakeVar.getOrFail(name)
Signature: name:string -> 'a
Type parameters: 'a

Gets a strongly typed FakeVar by name will fail if variable is not found

FakeVar.remove(name)
Signature: name:string -> unit

Removes a FakeVar by name

FakeVar.removeFrom name context
Signature: name:string -> context:FakeExecutionContext -> unit

Removes a FakeVar by name

FakeVar.set name v
Signature: name:string -> v:'a -> unit
Type parameters: 'a

Sets value of a FakeVar

FakeVar.setFrom name v context
Signature: name:string -> v:'a -> context:FakeExecutionContext -> unit
Type parameters: 'a

Sets value of a FakeVar