Documentation ¶
Overview ¶
Package make is a simple build system.
Index ¶
- Constants
- Variables
- func All(conds ...func() bool) func() bool
- func Any(conds ...func() bool) func() bool
- func Base(filename string) string
- func Dir(filename string) string
- func Exists(path string) bool
- func Fields(s string) []string
- func Flatten(strings ...interface{}) []string
- func Flattener(strings ...interface{}) func() []string
- func Getenv(key, defaultValue string) string
- func Getvar(key, defaultValue string) string
- func Glob(patterns ...string) []string
- func Globber(patterns ...string) func() []string
- func Install(destination, sourceName string, executable bool) error
- func InstallData(destName string, source io.Reader, executable bool) error
- func Join(elem ...string) string
- func LookPath(executables ...string) string
- func Main(getTargets func() Tasks, main string, deps ...string)
- func Missing(path string) func() bool
- func Outdated(target string, sources func() []string) func() bool
- func Println(strs ...interface{})
- func ReplaceSuffix(s, newSuffix string) string
- func Run(command ...string) error
- func RunIO(input io.Reader, command ...string) (output []byte, err error)
- func Setenv(key, value string)
- func Thunk(strings ...string) func() []string
- func Touch(filename string) error
- func Wrap(optional string, strings ...interface{}) []string
- type Env
- type Task
- func Command(command ...interface{}) Task
- func CommandWrap(optionalWrapper string, command ...interface{}) Task
- func Directory(dirpath string) Task
- func DirectoryOf(filename string) Task
- func Func(f func() error) Task
- func Group(tasks ...Task) Task
- func If(cond func() bool, tasks ...Task) Task
- func Installation(destName, sourceName string, executable bool) Task
- func Removal(directories ...string) Task
- func System(commandline string) Task
- func Target(name string, tasks ...Task) Task
- func TargetDefault(name string, tasks ...Task) Task
- type Tasks
Constants ¶
const ( GOARCH = runtime.GOARCH GOOS = runtime.GOOS )
Variables ¶
var Vars = make(map[string]string)
Vars specified on the command-line.
Functions ¶
func Flatten ¶
func Flatten(strings ...interface{}) []string
Flatten strings and string slices into single string slice. Flatten("foo", []string{"bar", "baz"}) returns []string{"foo", "bar", "baz"}. Flatten will panic if called with a type that is not string, []string, func() []string or []interface{}.
func Flattener ¶
func Flattener(strings ...interface{}) func() []string
Flattener is a lazy version of Flatten.
func Globber ¶
Globber returns a function which globs or terminates program on error. Results of multiple pattern will be concatenated.
func InstallData ¶
InstallData file.
func LookPath ¶
LookPath is like exec.LookPath(), but the first argument that is found is returned on success (not the expanded path). Empty string is returned on error.
func Println ¶
func Println(strs ...interface{})
Println prints space-separated strings and a newline. The arguments will be Flatten'ed.
func ReplaceSuffix ¶
ReplaceSuffix replaces the dot-separated suffix of the filename part of a path, or panics.
func Setenv ¶
func Setenv(key, value string)
Setenv is like os.Setenv(), but program is terminated on error.
Types ¶
type Task ¶
type Task struct {
// contains filtered or unexported fields
}
Task to run.
func CommandWrap ¶
CommandWrap task.
func Installation ¶
Installation task.