Documentation
¶
Index ¶
- Constants
- Variables
- type Call
- type Cmd
- type Dep
- type ErrInvalidPlatform
- type For
- type Glob
- type Include
- type IncludeElement
- type Includes
- type Location
- type MatchingTask
- type Matrix
- func (matrix *Matrix) DeepCopy() *Matrix
- func (matrix *Matrix) Get(key string) ([]any, bool)
- func (matrix *Matrix) Len() int
- func (matrix *Matrix) Range(f func(k string, v []any) error) error
- func (matrix *Matrix) Set(key string, value []any) bool
- func (matrix *Matrix) UnmarshalYAML(node *yaml.Node) error
- type MatrixElement
- type Output
- type OutputGroup
- type Platform
- type Precondition
- type Prompt
- type Requires
- type Task
- type TaskElement
- type Taskfile
- type TaskfileGraph
- type TaskfileVertex
- type Tasks
- func (t *Tasks) FindMatchingTasks(call *Call) []*MatchingTask
- func (tasks *Tasks) Get(key string) (*Task, bool)
- func (tasks *Tasks) Keys() []string
- func (tasks *Tasks) Len() int
- func (t1 *Tasks) Merge(t2 *Tasks, include *Include, includedTaskfileVars *Vars) error
- func (tasks *Tasks) Range(f func(k string, v *Task) error) error
- func (tasks *Tasks) Set(key string, value *Task) bool
- func (t *Tasks) UnmarshalYAML(node *yaml.Node) error
- func (tasks *Tasks) Values() []*Task
- type Var
- type VarElement
- type Vars
- func (vs *Vars) DeepCopy() *Vars
- func (vars *Vars) Get(key string) (Var, bool)
- func (vars *Vars) Len() int
- func (vars *Vars) Merge(other *Vars, include *Include)
- func (vars *Vars) Range(f func(k string, v Var) error) error
- func (vars *Vars) Set(key string, value Var) bool
- func (vars *Vars) ToCacheMap() (m map[string]any)
- func (vs *Vars) UnmarshalYAML(node *yaml.Node) error
- type VarsWithValidation
Constants ¶
const NamespaceSeparator = ":"
NamespaceSeparator contains the character that separates namespaces
Variables ¶
var ErrIncludedTaskfilesCantHaveDotenvs = errors.New("task: Included Taskfiles can't have dotenv declarations. Please, move the dotenv declaration to the main Taskfile")
ErrIncludedTaskfilesCantHaveDotenvs is returned when a included Taskfile contains dotenvs
var V3 = semver.MustParse("3")
Functions ¶
This section is empty.
Types ¶
type Call ¶
type Call struct { Task string Vars *Vars Silent bool Indirect bool // True if the task was called by another task }
Call is the parameters to a task call
type Cmd ¶
type Cmd struct { Cmd string Task string For *For Silent bool Set []string Shopt []string Vars *Vars IgnoreError bool Defer bool Platforms []*Platform }
Cmd is a task command
func (*Cmd) UnmarshalYAML ¶
type ErrInvalidPlatform ¶
type ErrInvalidPlatform struct {
Platform string
}
func (*ErrInvalidPlatform) Error ¶
func (err *ErrInvalidPlatform) Error() string
type For ¶
func (*For) UnmarshalYAML ¶
type Glob ¶
func (*Glob) UnmarshalYAML ¶
type Include ¶
type Include struct { Namespace string Taskfile string Dir string Optional bool Internal bool Aliases []string Excludes []string AdvancedImport bool Vars *Vars Flatten bool }
Include represents information about included taskfiles
func (*Include) DeepCopy ¶
DeepCopy creates a new instance of IncludedTaskfile and copies data by value from the source struct.
func (*Include) UnmarshalYAML ¶
type IncludeElement ¶ added in v3.41.0
An IncludeElement is a key-value pair that is used for initializing an Includes structure.
type Includes ¶
type Includes struct {
// contains filtered or unexported fields
}
Includes is an ordered map of namespaces to includes.
func NewIncludes ¶ added in v3.41.0
func NewIncludes(els ...*IncludeElement) *Includes
NewIncludes creates a new instance of Includes and initializes it with the provided set of elements, if any. The elements are added in the order they are passed.
func (*Includes) Get ¶ added in v3.41.0
Get returns the value the the include with the provided key and a boolean that indicates if the value was found or not. If the value is not found, the returned include is a zero value and the bool is false.
func (*Includes) Range ¶
Range calls the provided function for each include in the map. The function receives the include's key and value as arguments. If the function returns an error, the iteration stops and the error is returned.
func (*Includes) Set ¶ added in v3.41.0
Set sets the value of the include with the provided key to the provided value. If the include already exists, its value is updated. If the include does not exist, it is created.
func (*Includes) UnmarshalYAML ¶
UnmarshalYAML implements the yaml.Unmarshaler interface.
type MatchingTask ¶ added in v3.35.0
MatchingTask represents a task that matches a given call. It includes the task itself and a list of wildcards that were matched.
type Matrix ¶ added in v3.41.0
type Matrix struct {
// contains filtered or unexported fields
}
func NewMatrix ¶ added in v3.41.0
func NewMatrix(els ...*MatrixElement) *Matrix
func (*Matrix) UnmarshalYAML ¶ added in v3.41.0
type MatrixElement ¶ added in v3.41.0
type Output ¶
type Output struct { // Name of the Output. Name string `yaml:"-"` // Group specific style Group OutputGroup }
Output of the Task output
func (*Output) UnmarshalYAML ¶
type OutputGroup ¶
OutputGroup is the style options specific to the Group style.
func (*OutputGroup) IsSet ¶
func (g *OutputGroup) IsSet() bool
IsSet returns true if and only if a custom output style is set.
type Platform ¶
Platform represents GOOS and GOARCH values
func (*Platform) UnmarshalYAML ¶
UnmarshalYAML implements yaml.Unmarshaler interface.
type Precondition ¶
Precondition represents a precondition necessary for a task to run
func (*Precondition) DeepCopy ¶
func (p *Precondition) DeepCopy() *Precondition
func (*Precondition) UnmarshalYAML ¶
func (p *Precondition) UnmarshalYAML(node *yaml.Node) error
UnmarshalYAML implements yaml.Unmarshaler interface.
type Requires ¶
type Requires struct {
Vars []*VarsWithValidation
}
Requires represents a set of required variables necessary for a task to run
type Task ¶
type Task struct { Task string Cmds []*Cmd Deps []*Dep Label string Desc string Prompt Prompt Summary string Requires *Requires Aliases []string Sources []*Glob Generates []*Glob Status []string Preconditions []*Precondition Dir string Set []string Shopt []string Vars *Vars Env *Vars Dotenv []string Silent bool Interactive bool Internal bool Method string Prefix string IgnoreError bool Run string Platforms []*Platform Watch bool Location *Location // Populated during merging Namespace string IncludeVars *Vars IncludedTaskfileVars *Vars }
Task represents a task
func (*Task) DeepCopy ¶
DeepCopy creates a new instance of Task and copies data by value from the source struct.
func (*Task) UnmarshalYAML ¶
type TaskElement ¶ added in v3.41.0
A TaskElement is a key-value pair that is used for initializing a Tasks structure.
type Taskfile ¶
type Taskfile struct { Location string Version *semver.Version Output Output Method string Includes *Includes Set []string Shopt []string Vars *Vars Env *Vars Tasks *Tasks Silent bool Dotenv []string Run string Interval time.Duration }
Taskfile is the abstract syntax tree for a Taskfile
func (*Taskfile) UnmarshalYAML ¶
type TaskfileGraph ¶ added in v3.37.0
func NewTaskfileGraph ¶ added in v3.37.0
func NewTaskfileGraph() *TaskfileGraph
func (*TaskfileGraph) Merge ¶ added in v3.37.0
func (tfg *TaskfileGraph) Merge() (*Taskfile, error)
func (*TaskfileGraph) Visualize ¶ added in v3.37.0
func (tfg *TaskfileGraph) Visualize(filename string) error
type TaskfileVertex ¶ added in v3.37.0
A TaskfileVertex is a vertex on the Taskfile DAG.
type Tasks ¶
type Tasks struct {
// contains filtered or unexported fields
}
Tasks is an ordered map of task names to Tasks.
func NewTasks ¶ added in v3.41.0
func NewTasks(els ...*TaskElement) *Tasks
NewTasks creates a new instance of Tasks and initializes it with the provided set of elements, if any. The elements are added in the order they are passed.
func (*Tasks) FindMatchingTasks ¶ added in v3.35.0
func (t *Tasks) FindMatchingTasks(call *Call) []*MatchingTask
FindMatchingTasks returns a list of tasks that match the given call. A task matches a call if its name is equal to the call's task name or if it matches a wildcard pattern. The function returns a list of MatchingTask structs, each containing a task and a list of wildcards that were matched.
func (*Tasks) Get ¶ added in v3.41.0
Get returns the value the the task with the provided key and a boolean that indicates if the value was found or not. If the value is not found, the returned task is a zero value and the bool is false.
func (*Tasks) Range ¶ added in v3.41.0
Range calls the provided function for each task in the map. The function receives the task's key and value as arguments. If the function returns an error, the iteration stops and the error is returned.
func (*Tasks) Set ¶ added in v3.41.0
Set sets the value of the task with the provided key to the provided value. If the task already exists, its value is updated. If the task does not exist, it is created.
func (*Tasks) UnmarshalYAML ¶
type VarElement ¶ added in v3.41.0
A VarElement is a key-value pair that is used for initializing a Vars structure.
type Vars ¶
type Vars struct {
// contains filtered or unexported fields
}
Vars is an ordered map of variable names to values.
func NewVars ¶ added in v3.41.0
func NewVars(els ...*VarElement) *Vars
NewVars creates a new instance of Vars and initializes it with the provided set of elements, if any. The elements are added in the order they are passed.
func (*Vars) Get ¶ added in v3.41.0
Get returns the value the the variable with the provided key and a boolean that indicates if the value was found or not. If the value is not found, the returned variable is a zero value and the bool is false.
func (*Vars) Merge ¶
Merge loops over other and merges it values with the variables in vars. If the include parameter is not nil and its it is an advanced import, the directory is set set to the value of the include parameter.
func (*Vars) Range ¶
Range calls the provided function for each variable in the map. The function receives the variable's key and value as arguments. If the function returns an error, the iteration stops and the error is returned.
func (*Vars) Set ¶ added in v3.41.0
Set sets the value of the variable with the provided key to the provided value. If the variable already exists, its value is updated. If the variable does not exist, it is created.
func (*Vars) ToCacheMap ¶
ToCacheMap converts Vars to an unordered map containing only the static variables
func (*Vars) UnmarshalYAML ¶ added in v3.41.0
type VarsWithValidation ¶ added in v3.40.0
func (*VarsWithValidation) DeepCopy ¶ added in v3.40.0
func (v *VarsWithValidation) DeepCopy() *VarsWithValidation
func (*VarsWithValidation) UnmarshalYAML ¶ added in v3.40.0
func (v *VarsWithValidation) UnmarshalYAML(node *yaml.Node) error
UnmarshalYAML implements yaml.Unmarshaler interface.