Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var BuildHelpTemplate = `` /* 394-byte string literal not displayed */
BuildHelpTemplate holds the template used for generating the help message for a build TODO: Move this to /kar?
var ErrorNoSuchTask = fmt.Errorf("No Such Task")
ErrorNoSuchTask is returned when any of the given tasks does not exist.
var HelpTemplate *template.Template
Help templates hold both Build and Task help templates.
var TaskHelpTemplate = `` /* 239-byte string literal not displayed */
TaskTemplate holds the template used to generate the help message for a specific task.
Functions ¶
This section is empty.
Types ¶
type Build ¶
type Build struct {
Meta Meta
// contains filtered or unexported fields
}
Build is a simple build harness that you can register tasks and their dependencies and then run them.
func New ¶
func New() *Build
New returns a Build with a contex with no deadline or values and is never canceled.
func (*Build) Add ¶
Add registers the provided tasks to the build. Circular Dependencies are not allowed.
type Meta ¶
type Meta struct {
// The name of the program. Defaults to os.Args[0]
Name string
// Description of the program.
Usage string
// Version of the program
Version string
// Author
Author string
// Author e-mail
Email string
// License
License string
}
Meta holds information about the build.
type Task ¶
type Task struct {
// Taks name
Name string
// A short description of the task.
Usage string
// A long explanation of how the task works.
Description string
// List of dependencies.
// When running a task, the dependencies will be run in the order
Deps []string
// The function to call when the task is invoked.
Action Action
}
Task holds the meta information and an action.