Documentation ¶
Index ¶
- Variables
- func Assert(cond bool, format string, a ...interface{})
- func BuildDir() string
- func Fatal(format string, a ...interface{})
- func Flag(name string) string
- func LockBuildFlags()
- func SourceDir() string
- func WorkingDir() string
- type BuildStep
- type Context
- type CopyFile
- type ExpandTemplate
- type Flags
- type GlobalPath
- type ListTargetsContext
- type NinjaContext
- type OutPath
- type Path
- type Paths
Constants ¶
This section is empty.
Variables ¶
var BuildFlags = map[string]string{}
Functions ¶
func Assert ¶
Assert can be used in build rules to abort build file generation with an error message if `cond` is true.
func Fatal ¶
func Fatal(format string, a ...interface{})
Fatal can be used in build rules to abort build file generation with an error message unconditionally.
func WorkingDir ¶
func WorkingDir() string
WorkingDir returns the directory the build command was executed in.
Types ¶
type BuildStep ¶
BuildStep represents one build step (i.e., one build command). Each BuildStep produces `Out` from `Ins` and `In` by running `Cmd`.
type ExpandTemplate ¶
ExpandTemplate expands `Template` by performing `Substitutions` and storing the result in `Out`.
func (ExpandTemplate) Build ¶
func (tmpl ExpandTemplate) Build(ctx Context) OutPath
BuildSteps for ExpandTemplate.
type ListTargetsContext ¶
type ListTargetsContext struct{}
func (*ListTargetsContext) AddBuildStep ¶
func (ctx *ListTargetsContext) AddBuildStep(step BuildStep)
func (*ListTargetsContext) AddTarget ¶
func (ctx *ListTargetsContext) AddTarget(name string, target interface{})
type NinjaContext ¶
type NinjaContext struct {
// contains filtered or unexported fields
}
func (*NinjaContext) AddBuildStep ¶
func (ctx *NinjaContext) AddBuildStep(step BuildStep)
func (*NinjaContext) AddTarget ¶
func (ctx *NinjaContext) AddTarget(name string, target interface{})
type OutPath ¶
type OutPath struct {
// contains filtered or unexported fields
}
OutPath is a path relative to the workspace build directory.
func NewOutPath ¶
NewOutPath creates an OutPath for a path relativ to the build directory.
func (OutPath) WithExt ¶
WithExt creates an OutPath with the same relative path and the given extension.
func (OutPath) WithPrefix ¶
WithPrefix creates an OutPath with the same relative path and the given prefix.
func (OutPath) WithSuffix ¶
WithSuffix creates an OutPath with the same relative path and the given suffix.