taskfile

package
v3.33.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const NamespaceSeparator = ":"

NamespaceSeparator contains the character that separates namespaces

Variables

View Source
var (
	V3 = semver.MustParse("3")
	V2 = semver.MustParse("2")
)
View Source
var ErrCantUnmarshalPrecondition = errors.New("task: Can't unmarshal precondition value")

ErrCantUnmarshalPrecondition is returned for invalid precond YAML.

Functions

func Merge

func Merge(t1, t2 *Taskfile, includedTaskfile *IncludedTaskfile, namespaces ...string) error

Merge merges the second Taskfile into the first

Types

type Call added in v3.33.3

type Call struct {
	Task   string
	Vars   *Vars
	Silent bool
	Direct bool // Was the task called directly or via another task?
}

Call is the parameters to a task call

type Cmd added in v3.33.3

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) DeepCopy added in v3.33.3

func (c *Cmd) DeepCopy() *Cmd

func (*Cmd) UnmarshalYAML added in v3.33.3

func (c *Cmd) UnmarshalYAML(node *yaml.Node) error

type Dep added in v3.33.3

type Dep struct {
	Task   string
	Vars   *Vars
	Silent bool
}

Dep is a task dependency

func (*Dep) DeepCopy added in v3.33.3

func (d *Dep) DeepCopy() *Dep

func (*Dep) UnmarshalYAML added in v3.33.3

func (d *Dep) UnmarshalYAML(node *yaml.Node) error

type ErrInvalidPlatform added in v3.33.3

type ErrInvalidPlatform struct {
	Platform string
}

func (*ErrInvalidPlatform) Error added in v3.33.3

func (err *ErrInvalidPlatform) Error() string

type For added in v3.33.3

type For struct {
	From  string
	List  []any
	Var   string
	Split string
	As    string
}

func (*For) DeepCopy added in v3.33.3

func (f *For) DeepCopy() *For

func (*For) UnmarshalYAML added in v3.33.3

func (f *For) UnmarshalYAML(node *yaml.Node) error

type Glob added in v3.33.3

type Glob struct {
	Glob   string
	Negate bool
}

func (*Glob) UnmarshalYAML added in v3.33.3

func (g *Glob) UnmarshalYAML(node *yaml.Node) error

type IncludedTaskfile added in v3.33.3

type IncludedTaskfile struct {
	Taskfile       string
	Dir            string
	Optional       bool
	Internal       bool
	Aliases        []string
	AdvancedImport bool
	Vars           *Vars
	BaseDir        string // The directory from which the including taskfile was loaded; used to resolve relative paths
}

IncludedTaskfile represents information about included taskfiles

func (*IncludedTaskfile) DeepCopy added in v3.33.3

func (it *IncludedTaskfile) DeepCopy() *IncludedTaskfile

DeepCopy creates a new instance of IncludedTaskfile and copies data by value from the source struct.

func (*IncludedTaskfile) FullDirPath added in v3.33.3

func (it *IncludedTaskfile) FullDirPath() (string, error)

FullDirPath returns the fully qualified path to the included taskfile's working directory

func (*IncludedTaskfile) FullTaskfilePath added in v3.33.3

func (it *IncludedTaskfile) FullTaskfilePath() (string, error)

FullTaskfilePath returns the fully qualified path to the included taskfile

func (*IncludedTaskfile) UnmarshalYAML added in v3.33.3

func (it *IncludedTaskfile) UnmarshalYAML(node *yaml.Node) error

type IncludedTaskfiles added in v3.33.3

type IncludedTaskfiles struct {
	Keys    []string
	Mapping map[string]IncludedTaskfile
}

IncludedTaskfiles represents information about included tasksfiles

func (*IncludedTaskfiles) Len added in v3.33.3

func (tfs *IncludedTaskfiles) Len() int

Len returns the length of the map

func (*IncludedTaskfiles) Range added in v3.33.3

func (tfs *IncludedTaskfiles) Range(yield func(key string, includedTaskfile IncludedTaskfile) error) error

Range allows you to loop into the included taskfiles in its right order

func (*IncludedTaskfiles) Set added in v3.33.3

func (tfs *IncludedTaskfiles) Set(key string, includedTaskfile IncludedTaskfile)

Set sets a value to a given key

func (*IncludedTaskfiles) UnmarshalYAML added in v3.33.3

func (tfs *IncludedTaskfiles) UnmarshalYAML(node *yaml.Node) error

UnmarshalYAML implements the yaml.Unmarshaler interface.

type Location added in v3.33.3

type Location struct {
	Line     int
	Column   int
	Taskfile string
}

func (*Location) DeepCopy added in v3.33.3

func (l *Location) DeepCopy() *Location

type Output added in v3.33.3

type Output struct {
	// Name of the Output.
	Name string `yaml:"-"`
	// Group specific style
	Group OutputGroup
}

Output of the Task output

func (*Output) IsSet added in v3.33.3

func (s *Output) IsSet() bool

IsSet returns true if and only if a custom output style is set.

func (*Output) UnmarshalYAML added in v3.33.3

func (s *Output) UnmarshalYAML(node *yaml.Node) error

type OutputGroup added in v3.33.3

type OutputGroup struct {
	Begin, End string
	ErrorOnly  bool `yaml:"error_only"`
}

OutputGroup is the style options specific to the Group style.

func (*OutputGroup) IsSet added in v3.33.3

func (g *OutputGroup) IsSet() bool

IsSet returns true if and only if a custom output style is set.

type Platform added in v3.33.3

type Platform struct {
	OS   string
	Arch string
}

Platform represents GOOS and GOARCH values

func (*Platform) DeepCopy added in v3.33.3

func (p *Platform) DeepCopy() *Platform

func (*Platform) UnmarshalYAML added in v3.33.3

func (p *Platform) UnmarshalYAML(node *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler interface.

type Precondition added in v3.33.3

type Precondition struct {
	Sh  string
	Msg string
}

Precondition represents a precondition necessary for a task to run

func (*Precondition) DeepCopy added in v3.33.3

func (p *Precondition) DeepCopy() *Precondition

func (*Precondition) UnmarshalYAML added in v3.33.3

func (p *Precondition) UnmarshalYAML(node *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler interface.

type Requires added in v3.33.3

type Requires struct {
	Vars []string
}

Requires represents a set of required variables necessary for a task to run

func (*Requires) DeepCopy added in v3.33.3

func (r *Requires) DeepCopy() *Requires

type Task added in v3.33.3

type Task struct {
	Task                 string
	Cmds                 []*Cmd
	Deps                 []*Dep
	Label                string
	Desc                 string
	Prompt               string
	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
	IncludeVars          *Vars
	IncludedTaskfileVars *Vars
	IncludedTaskfile     *IncludedTaskfile
	Platforms            []*Platform
	Location             *Location
	Watch                bool
}

Task represents a task

func (*Task) DeepCopy added in v3.33.3

func (t *Task) DeepCopy() *Task

DeepCopy creates a new instance of Task and copies data by value from the source struct.

func (*Task) Name added in v3.33.3

func (t *Task) Name() string

func (*Task) UnmarshalYAML added in v3.33.3

func (t *Task) UnmarshalYAML(node *yaml.Node) error

type Taskfile added in v3.33.3

type Taskfile struct {
	Location   string
	Version    *semver.Version
	Expansions int
	Output     Output
	Method     string
	Includes   *IncludedTaskfiles
	Set        []string
	Shopt      []string
	Vars       *Vars
	Env        *Vars
	Tasks      Tasks
	Silent     bool
	Dotenv     []string
	Run        string
	Interval   time.Duration
}

Taskfile represents a Taskfile.yml

func (*Taskfile) UnmarshalYAML added in v3.33.3

func (tf *Taskfile) UnmarshalYAML(node *yaml.Node) error

type Tasks added in v3.33.3

type Tasks struct {
	orderedmap.OrderedMap[string, *Task]
}

Tasks represents a group of tasks

func (*Tasks) UnmarshalYAML added in v3.33.3

func (t *Tasks) UnmarshalYAML(node *yaml.Node) error

type Var added in v3.33.3

type Var struct {
	Value any
	Live  any
	Sh    string
	Dir   string
}

Var represents either a static or dynamic variable.

func (*Var) UnmarshalYAML added in v3.33.3

func (v *Var) UnmarshalYAML(node *yaml.Node) error

type Vars added in v3.33.3

type Vars struct {
	orderedmap.OrderedMap[string, Var]
}

Vars is a string[string] variables map.

func (*Vars) DeepCopy added in v3.33.3

func (vs *Vars) DeepCopy() *Vars

DeepCopy creates a new instance of Vars and copies data by value from the source struct.

func (*Vars) Len added in v3.33.3

func (vs *Vars) Len() int

Wrapper around OrderedMap.Len to ensure we don't get nil pointer errors

func (*Vars) Merge added in v3.33.3

func (vs *Vars) Merge(other *Vars)

Wrapper around OrderedMap.Merge to ensure we don't get nil pointer errors

func (*Vars) Range added in v3.33.3

func (vs *Vars) Range(f func(k string, v Var) error) error

Wrapper around OrderedMap.Set to ensure we don't get nil pointer errors

func (*Vars) ToCacheMap added in v3.33.3

func (vs *Vars) ToCacheMap() (m map[string]any)

ToCacheMap converts Vars to a map containing only the static variables

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL