Documentation
¶
Index ¶
- Variables
- func DefaultBuildFile() (string, bool)
- func FindBuildFile(name string) (string, string, error)
- func GoStrSliceToTable(L *lua.LState, arr []string) *lua.LTable
- func LArrayToString(v *lua.LTable) string
- func LTableToString(v *lua.LTable) string
- func LToString(v lua.LValue) string
- func Run(out io.Writer, args []string, flags Flags) (string, error)
- type BasicPrinter
- type ErrMessage
- type Flags
- type LBuildSet
- type LRule
- type LRuleSet
- type LuaVM
- func (vm *LuaVM) DoFile(file string) (lua.LValue, error)
- func (vm *LuaVM) EnterDir(dir string) string
- func (vm *LuaVM) Err(err error)
- func (vm *LuaVM) ErrStr(err string)
- func (vm *LuaVM) Eval(r io.Reader, file string) (lua.LValue, error)
- func (vm *LuaVM) ExpandFuncs() (func(string) (string, error), func(string) (string, error))
- func (vm *LuaVM) LeaveDir(to string)
- func (vm *LuaVM) MakeTable(name string, vals []assign)
- func (vm *LuaVM) OpenDefaults()
- func (vm *LuaVM) OpenKnit()
- func (vm *LuaVM) SetVar(name string, val interface{})
- func (vm *LuaVM) Wd() string
- type ProgressPrinter
- type StepPrinter
- type UserFlags
Constants ¶
This section is empty.
Variables ¶
var ErrBuildFileNotFound = errors.New("build file not found")
var ErrNothingToDo = errors.New("nothing to be done")
var ErrQuiet = errors.New("quiet")
Functions ¶
func DefaultBuildFile ¶
func GoStrSliceToTable ¶ added in v0.2.0
func LArrayToString ¶
LArrayToString converts a Lua array (table with length) to a string.
func LTableToString ¶
LTableToString converts a Lua table to a string.
Types ¶
type BasicPrinter ¶ added in v0.0.4
type BasicPrinter struct {
// contains filtered or unexported fields
}
func (*BasicPrinter) Clear ¶ added in v0.0.4
func (p *BasicPrinter) Clear()
func (*BasicPrinter) Done ¶ added in v0.0.4
func (p *BasicPrinter) Done(string)
func (*BasicPrinter) NeedsUpdate ¶ added in v0.0.4
func (p *BasicPrinter) NeedsUpdate() bool
func (*BasicPrinter) Print ¶ added in v0.0.4
func (p *BasicPrinter) Print(cmd, dir string, name string, step int)
func (*BasicPrinter) SetSteps ¶ added in v0.0.4
func (p *BasicPrinter) SetSteps(int)
func (*BasicPrinter) Update ¶ added in v0.0.4
func (p *BasicPrinter) Update()
type ErrMessage ¶ added in v0.2.0
type ErrMessage struct {
// contains filtered or unexported fields
}
func (*ErrMessage) Error ¶ added in v0.2.0
func (e *ErrMessage) Error() string
type Flags ¶
type Flags struct { Knitfile string Ncpu int DryRun bool RunDir string Always bool Quiet bool Style string CacheDir string Hash bool Updated []string Shell string KeepGoing bool Tool string ToolArgs []string }
Flags for modifying the behavior of Knit.
type LBuildSet ¶ added in v0.2.0
type LBuildSet struct { Dir string // contains filtered or unexported fields }
An LBuildSet is a list of rules associated with a directory.
type LuaVM ¶
A LuaVM tracks the Lua state and keeps a stack of directories that have been entered.
func (*LuaVM) DoFile ¶ added in v0.0.3
DoFile executes the Lua code inside 'file'. The file will be executed from the current directory, but the filename displayed for errors will be relative to the previous working directory.
func (*LuaVM) EnterDir ¶ added in v0.2.0
EnterDir changes into 'dir' and returns the path of the directory that was changed out of.
func (*LuaVM) ErrStr ¶ added in v0.2.0
ErrStr causes the VM to Lua-panic with a string message 'err'.
func (*LuaVM) Eval ¶
Eval runs the Lua code in 'r' with the filename 'file' and all local/global variables available in the current context. Returns the value that was generated, or a possible error.
func (*LuaVM) ExpandFuncs ¶
ExpandFuncs returns a set of functions used for expansion. The first expands by looking up variables in the current Lua context, and the second evaluates arbitrary Lua expressions.
func (*LuaVM) LeaveDir ¶ added in v0.2.0
LeaveDir returns to the directory 'to' (usually the value returned by 'EnterDir').
func (*LuaVM) MakeTable ¶
MakeTable creates a global Lua table called 'name', with the key-value pairs from 'vals'.
func (*LuaVM) OpenDefaults ¶ added in v0.2.0
func (vm *LuaVM) OpenDefaults()
OpenDefaults opens all default Lua libraries: package, base, table, debug, io, math, os, string.
type ProgressPrinter ¶ added in v0.0.4
type ProgressPrinter struct {
// contains filtered or unexported fields
}
func (*ProgressPrinter) Clear ¶ added in v0.0.4
func (p *ProgressPrinter) Clear()
func (*ProgressPrinter) Done ¶ added in v0.0.4
func (p *ProgressPrinter) Done(name string)
func (*ProgressPrinter) NeedsUpdate ¶ added in v0.0.4
func (p *ProgressPrinter) NeedsUpdate() bool
func (*ProgressPrinter) Print ¶ added in v0.0.4
func (p *ProgressPrinter) Print(cmd, dir string, name string, step int)
func (*ProgressPrinter) SetSteps ¶ added in v0.0.4
func (p *ProgressPrinter) SetSteps(steps int)
func (*ProgressPrinter) Update ¶ added in v0.0.4
func (p *ProgressPrinter) Update()
type StepPrinter ¶ added in v0.0.4
type StepPrinter struct {
// contains filtered or unexported fields
}
func (*StepPrinter) Clear ¶ added in v0.0.4
func (p *StepPrinter) Clear()
func (*StepPrinter) Done ¶ added in v0.0.4
func (p *StepPrinter) Done(string)
func (*StepPrinter) NeedsUpdate ¶ added in v0.0.4
func (p *StepPrinter) NeedsUpdate() bool
func (*StepPrinter) Print ¶ added in v0.0.4
func (p *StepPrinter) Print(cmd, dir string, name string, step int)
func (*StepPrinter) SetSteps ¶ added in v0.0.4
func (p *StepPrinter) SetSteps(steps int)
func (*StepPrinter) Update ¶ added in v0.0.4
func (p *StepPrinter) Update()
type UserFlags ¶ added in v0.0.4
type UserFlags struct { Knitfile *string Ncpu *int DryRun *bool RunDir *string `toml:"directory"` Always *bool Quiet *bool Style *string CacheDir *string `toml:"cache"` Hash *bool Updated *[]string Shell *string KeepGoing *bool }
Flags that may be automatically set in a .knit.toml file.