Documentation ¶
Overview ¶
Package burrow contains utilities used for the burrow build system.
Index ¶
- Constants
- func Deprecation(target string, args ...[]string)
- func Exec(target string, comm string, args ...string) error
- func ExecDir(target string, dir string, comm string, args ...string) error
- func GetCodefiles() []string
- func GetCodefilesWithMtime(outputs []string) map[string]int64
- func GetSecondLevelArgs() cli.Args
- func IsTargetUpToDate(target string, outputs []string) bool
- func LoadConfig()
- func Log(level LogLevel, target string, format string, args ...interface{})
- func LogDeprecationMessage()
- func SaveConfig()
- func UpdateTarget(target string, outputs []string)
- func WrapAction(action func(*cli.Context, bool) error) func(*cli.Context) error
- type Configuration
- type LogLevel
- type Logger
Constants ¶
const ( // Burrow encountered no error, all actions were successful. EXIT_SUCCESS int = iota // Burrow encountered an error while reading the burrow.yaml. EXIT_CONFIG // Burrow encountered an error while running the specified action. EXIT_ACTION )
The EXIT_... constants describe the exit codes of burrow.
Variables ¶
This section is empty.
Functions ¶
func Deprecation ¶ added in v0.5.0
Deprecation marks a target for deprecation and provide underlying commands as args to the deprecation log.
func Exec ¶
Exec runs a given command (comm) with arguments (args) and redirects all output of stderr and stdout to a logger with the given target as logging target (tag/name). When the target is "" (empty string) stdout and stderr of the command will be directly mapped to the stdout and stderr of the application.
func ExecDir ¶ added in v0.3.0
ExecDir runs a given command (comm) with arguments (args) inside a given directory (dir) and redirects all output of stderr and stdout to a logger with the given target as logging target (tag/name). When the target is "" (empty string) stdout and stderr of the command will be directly mapped to the stdout and stderr of the application.
func GetCodefiles ¶
func GetCodefiles() []string
GetCodefiles returns a string array containing all paths of files that contain code inside the current burrow project.
func GetCodefilesWithMtime ¶
GetCodefilesWithMtime returns a map containing all paths of files that contain code inside the current burrow project. The paths get mapped to Unix modification times. The outputs parameter should contain additional non-code files that should also be contained in the map.
func GetSecondLevelArgs ¶
GetSecondLevelArgs returns the command line arguments that are located after a double dash (--).
func IsTargetUpToDate ¶
IsTargetUpToDate checks whether a given build target is up-to-date. This means that all build artifacts of the target were created from data with the same timestamp as the currently available sources.
The outputs parameter specifies which files are created (artifacts) by the target. If these files are not available all cache data is invalid.
func LoadConfig ¶
func LoadConfig()
LoadConfig loads the content of the burrow.yaml into the global Config variable and sets the isConfigLoaded flag on success.
func Log ¶
Log writes a log message to stderr which will be colored by the given log level and prefixed with the given target. The format parameter is a fmt.Printf parameter following the args for formatting.
func LogDeprecationMessage ¶ added in v0.5.0
func LogDeprecationMessage()
LogDeprecationMessage logs all accumulated deprecation messages to the console.
func SaveConfig ¶ added in v0.2.0
func SaveConfig()
SaveConfig save the current project configuration to the burrow.yaml.
func UpdateTarget ¶
UpdateTarget updates the cache of a target to match the timestamps of all currently available sources. The outputs parameter specifies which files are created (artifacts) by the target. Timestamps of the artifacts will also be stored.
Types ¶
type Configuration ¶
type Configuration struct { Name string Version string Description string Authors []string License string Package struct { Include []string } Args struct { Run string Go struct { Test string Build string Doc string Vet string Fmt string Get string } Git struct { Tag string Clone string } } }
The Configuration struct describes the layout of the burrow.yaml.
var Config Configuration = Configuration{}
Config is the global instance of the Configuration struct and contains the parsed data of the burrow.yaml.