Documentation ¶
Index ¶
- func CheckDupes(info *parse.PkgInfo) (hasDupes bool, names map[string][]string)
- func Compile(path string, stdout, stderr io.Writer, gofiles []string) error
- func ExeName(files []string) (string, error)
- func GenerateMainfile(path string, info *parse.PkgInfo) error
- func Invoke(inv Invocation) int
- func Magefiles(dir string) ([]string, error)
- func Main() int
- func ParseAndRun(dir string, stdout, stderr io.Writer, stdin io.Reader, args []string) int
- func RunCompiled(inv Invocation, exePath string) int
- type Invocation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckDupes ¶
CheckDupes checks a package for duplicate target names.
func ExeName ¶
ExeName reports the executable filename that this version of Mage would create for the given magefiles.
func GenerateMainfile ¶
GenerateMainfile creates the mainfile at path with the info from
func Main ¶
func Main() int
Main is the entrypoint for running mage. It exists external to mage's main function to allow it to be used from other programs, specifically so you can go run a simple file that run's mage's Main.
func ParseAndRun ¶
ParseAndRun parses the command line, and then compiles and runs the mage files in the given directory with the given args (do not include the command name in the args).
func RunCompiled ¶
func RunCompiled(inv Invocation, exePath string) int
RunCompiled runs an already-compiled mage command with the given args,
Types ¶
type Invocation ¶
type Invocation struct { Dir string // directory to read magefiles from Force bool // forces recreation of the compiled binary Verbose bool // tells the magefile to print out log statements List bool // tells the magefile to print out a list of targets Help bool // tells the magefile to print out help for a specific target Keep bool // tells mage to keep the generated main file after compiling Timeout time.Duration // tells mage to set a timeout to running the targets Stdout io.Writer // writer to write stdout messages to Stderr io.Writer // writer to write stderr messages to Stdin io.Reader // reader to read stdin from Args []string // args to pass to the compiled binary }
Invocation contains the args for invoking a run of Mage.