taskfile

package
v3.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2021 License: MIT Imports: 5 Imported by: 9

Documentation

Index

Constants

View Source
const NamespaceSeparator = ":"

NamespaceSeparator contains the character that separates namescapes

Variables

View Source
var (
	// ErrCantUnmarshalCmd is returned for invalid command YAML
	ErrCantUnmarshalCmd = errors.New("task: can't unmarshal cmd value")
	// ErrCantUnmarshalDep is returned for invalid dependency YAML
	ErrCantUnmarshalDep = errors.New("task: can't unmarshal dep value")
)
View Source
var (
	// ErrCantUnmarshalIncludedTaskfile is returned for invalid var YAML.
	ErrCantUnmarshalIncludedTaskfile = errors.New("task: can't unmarshal included value")
)
View Source
var (
	// ErrCantUnmarshalPrecondition is returned for invalid precond YAML.
	ErrCantUnmarshalPrecondition = errors.New("task: Can't unmarshal precondition value")
)
View Source
var (
	// ErrCantUnmarshalTask is returned for invalid task YAML
	ErrCantUnmarshalTask = errors.New("task: can't unmarshal task value")
)
View Source
var (
	// ErrCantUnmarshalVar is returned for invalid var YAML.
	ErrCantUnmarshalVar = errors.New("task: can't unmarshal var 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
}

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
	AdvancedImport bool
}

IncludedTaskfile represents information about included tasksfile

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 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
	Method        string
	Prefix        string
	IgnoreError   bool
}

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     string
	Method     string
	Includes   *IncludedTaskfiles
	Vars       *Vars
	Env        *Vars
	Tasks      Tasks
	Silent     bool
	Dotenv     []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
}

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) 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