taskfile

package
v3.14.1 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2022 License: MIT Imports: 7 Imported by: 17 modules, 9 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const NamespaceSeparator = ":"

NamespaceSeparator contains the character that separates namescapes

Variables

View Source
var (
	// ErrCantUnmarshalPrecondition is returned for invalid precond YAML.
	ErrCantUnmarshalPrecondition = errors.New("task: Can't unmarshal precondition value")
)

Functions

func Merge

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

Merge merges the second Taskfile into the first

Types

type Call

type Call struct {
	Task string
	Vars *Vars
}

Call is the parameters to a task call

type Cmd

type Cmd struct {
	Cmd         string
	Silent      bool
	Task        string
	Vars        *Vars
	IgnoreError bool
	Defer       bool
}

Cmd is a task command

func (*Cmd) UnmarshalYAML

func (c *Cmd) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements yaml.Unmarshaler interface

type Dep

type Dep struct {
	Task string
	Vars *Vars
}

Dep is a task dependency

func (*Dep) UnmarshalYAML

func (d *Dep) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements yaml.Unmarshaler interface

type IncludedTaskfile

type IncludedTaskfile struct {
	Taskfile       string
	Dir            string
	Optional       bool
	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) FullDirPath added in v3.14.1

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.14.1

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

FullTaskfilePath returns the fully qualified path to the included taskfile

func (*IncludedTaskfile) UnmarshalYAML

func (it *IncludedTaskfile) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements yaml.Unmarshaler interface

type IncludedTaskfiles

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

IncludedTaskfiles represents information about included tasksfiles

func (*IncludedTaskfiles) Len added in v3.1.0

func (tfs *IncludedTaskfiles) Len() int

Len returns the length of the map

func (*IncludedTaskfiles) Merge added in v3.1.0

func (tfs *IncludedTaskfiles) Merge(other *IncludedTaskfiles)

Merge merges the given IncludedTaskfiles into the caller one

func (*IncludedTaskfiles) Range added in v3.1.0

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.1.0

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

Set sets a value to a given key

func (*IncludedTaskfiles) UnmarshalYAML added in v3.1.0

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

UnmarshalYAML implements the yaml.Unmarshaler interface.

type Output added in v3.11.0

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.11.0

func (s *Output) IsSet() bool

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

func (*Output) UnmarshalYAML added in v3.11.0

func (s *Output) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements yaml.Unmarshaler It accepts a scalar node representing the Output.Name or a mapping node representing the OutputGroup.

type OutputGroup added in v3.11.0

type OutputGroup struct {
	Begin, End string
}

OutputGroup is the style options specific to the Group style.

func (*OutputGroup) IsSet added in v3.11.0

func (g *OutputGroup) IsSet() bool

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

type Precondition

type Precondition struct {
	Sh  string
	Msg string
}

Precondition represents a precondition necessary for a task to run

func (*Precondition) UnmarshalYAML

func (p *Precondition) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements yaml.Unmarshaler interface.

type Task

type Task struct {
	Task                 string
	Cmds                 []*Cmd
	Deps                 []*Dep
	Label                string
	Desc                 string
	Summary              string
	Sources              []string
	Generates            []string
	Status               []string
	Preconditions        []*Precondition
	Dir                  string
	Vars                 *Vars
	Env                  *Vars
	Silent               bool
	Interactive          bool
	Method               string
	Prefix               string
	IgnoreError          bool
	Run                  string
	IncludeVars          *Vars
	IncludedTaskfileVars *Vars
}

Task represents a task

func (*Task) Name

func (t *Task) Name() string

func (*Task) UnmarshalYAML

func (t *Task) UnmarshalYAML(unmarshal func(interface{}) error) error

type Taskfile

type Taskfile struct {
	Version    string
	Expansions int
	Output     Output
	Method     string
	Includes   *IncludedTaskfiles
	Vars       *Vars
	Env        *Vars
	Tasks      Tasks
	Silent     bool
	Dotenv     []string
	Run        string
}

Taskfile represents a Taskfile.yml

func (*Taskfile) ParsedVersion

func (tf *Taskfile) ParsedVersion() (float64, error)

ParsedVersion returns the version as a float64

func (*Taskfile) UnmarshalYAML

func (tf *Taskfile) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements yaml.Unmarshaler interface

type Tasks

type Tasks map[string]*Task

Tasks represents a group of tasks

type Var

type Var struct {
	Static string
	Live   interface{}
	Sh     string
	Dir    string
}

Var represents either a static or dynamic variable.

func (*Var) UnmarshalYAML

func (v *Var) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements yaml.Unmarshaler interface.

type Vars

type Vars struct {
	Keys    []string
	Mapping map[string]Var
}

Vars is a string[string] variables map.

func (*Vars) Len added in v3.3.0

func (vs *Vars) Len() int

Len returns the size of the map

func (*Vars) Merge

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

Merge merges the given Vars into the caller one

func (*Vars) Range

func (vs *Vars) Range(yield func(key string, value Var) error) error

Range allows you to loop into the vars in its right order

func (*Vars) Set

func (vs *Vars) Set(key string, value Var)

Set sets a value to a given key

func (*Vars) ToCacheMap

func (vs *Vars) ToCacheMap() (m map[string]interface{})

ToCacheMap converts Vars to a map containing only the static variables

func (*Vars) UnmarshalYAML

func (vs *Vars) UnmarshalYAML(node *yaml.Node) error

UnmarshalYAML implements the yaml.Unmarshaler interface.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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