taskfile

package
v3.11.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2022 License: MIT Imports: 5 Imported by: 0

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
}

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

func (tfs *IncludedTaskfiles) Len() int

Len returns the length of the map

func (*IncludedTaskfiles) Merge

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

Merge merges the given IncludedTaskfiles into the caller one

func (*IncludedTaskfiles) Range

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

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

Set sets a value to a given key

func (*IncludedTaskfiles) UnmarshalYAML

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

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

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