Documentation
¶
Index ¶
- func AssertIsAnalyzeTarget(iface AnalyzeInterface)
- func AssertIsBuildableTarget(iface BuildInterface)
- func AssertIsCoverageTarget(iface CoverageInterface)
- func AssertIsReportTarget(iface ReportInterface)
- func AssertIsRunnableTarget(iface RunInterface)
- func AssertIsTestableTarget(iface TestInterface)
- func CompileTemplate(tmpl, name string, data interface{}) string
- func CompileTemplateFile(tmplFile string, data interface{}) string
- func Fatal(format string, a ...interface{})
- func GeneratorMain(vars map[string]interface{})
- type AnalyzeInterface
- type BoolFlag
- type BuildInterface
- type BuildRule
- type BuildStep
- type BuildStepWithRule
- type Context
- type CopyFile
- type CoverageInterface
- type ExpandTemplate
- type ExtendedRunInterface
- type ExtendedTestInterface
- type FloatFlag
- type GlobalPath
- type IntFlag
- type OutPath
- type Path
- type PkgPath
- type Pool
- type ReportInterface
- type RunInterface
- type StringFlag
- type StringPath
- type StringString
- type TargetRule
- type TestInterface
- type TranslationUnit
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertIsAnalyzeTarget ¶
func AssertIsAnalyzeTarget(iface AnalyzeInterface)
func AssertIsBuildableTarget ¶
func AssertIsBuildableTarget(iface BuildInterface)
func AssertIsCoverageTarget ¶
func AssertIsCoverageTarget(iface CoverageInterface)
func AssertIsReportTarget ¶
func AssertIsReportTarget(iface ReportInterface)
func AssertIsRunnableTarget ¶
func AssertIsRunnableTarget(iface RunInterface)
func AssertIsTestableTarget ¶
func AssertIsTestableTarget(iface TestInterface)
func CompileTemplate ¶
Compile a go text template, execute it, and return the result as a string
func CompileTemplateFile ¶ added in v1.1.0
Compile a go text template from a file, execute it, and return the result as a string
func GeneratorMain ¶
func GeneratorMain(vars map[string]interface{})
Types ¶
type AnalyzeInterface ¶ added in v1.11.3
type AnalyzeInterface interface { TranslationUnits(ctx Context) []TranslationUnit AnalysisDeps(ctx Context) []AnalyzeInterface }
AnalyzeInterface is an interface for targets compatible with static analysis
type BoolFlag ¶
type BuildInterface ¶
type BuildInterface interface {
Build(ctx Context)
}
type BuildStep ¶
type BuildStep struct { Out OutPath Outs []OutPath In Path Ins []Path Depfile OutPath Cmd string Script string Data string DataFileMode os.FileMode Descr string Phony bool Pool *Pool }
BuildStep represents one build step (i.e., one build command). Each BuildStep produces `Out` and `Outs` from `Ins` and `In` by running `Cmd`.
type BuildStepWithRule ¶ added in v1.7.0
type Context ¶
type Context interface { AddBuildStep(BuildStep) AddBuildStepWithRule(BuildStepWithRule) Cwd() OutPath BuildChild(c BuildInterface) // WithTrace calls the given function, with the given value added // to the trace. WithTrace(id string, f func(Context)) // Trace returns the strings in the current trace (most recent last). Trace() []string // Rules to be collected in a compilation database. Their name must be unique RegisterCompDbRule(rule *BuildRule) // Obtains a registered rule (if it exists). The boolean is true if it exists GetCompDbRule(name string) (*BuildRule, bool) // contains filtered or unexported methods }
type CoverageInterface ¶ added in v1.11.2
type ExpandTemplate ¶
ExpandTemplate expands `Template` by performing `Substitutions` and storing the result in `Out`.
func (ExpandTemplate) Build ¶
func (tmpl ExpandTemplate) Build(ctx Context)
BuildSteps for ExpandTemplate.
func (ExpandTemplate) Output ¶
func (tmpl ExpandTemplate) Output() OutPath
type ExtendedRunInterface ¶
type ExtendedRunInterface interface { RunInterface RunDeps() []Path }
An interface for runnables that depend on some other set of targets to run, but not to build For example, when using a test wrapper.
type ExtendedTestInterface ¶
type ExtendedTestInterface interface { TestInterface TestDeps() []Path }
An interface for tests that depend on some other set of targets to run, but not to build For example, when using a test wrapper.
type FloatFlag ¶
type IntFlag ¶
type OutPath ¶
type OutPath interface { Path // contains filtered or unexported methods }
OutPath is a path relative to the workspace build directory.
func GetSortedOutPaths ¶ added in v1.2.0
Get paths from a path map sorted by key
func NewOutPath ¶
NewOutPath creates an OutPath for a path relativ to the build directory.
type Path ¶
type Path interface { Absolute() string Relative() string String() string WithExt(ext string) OutPath WithPrefix(prefix string) OutPath WithSuffix(suffix string) OutPath }
Path represents an on-disk path that is either an input to or an output from a BuildStep (or both).
func GetSortedPaths ¶ added in v1.2.0
Get paths from a path map sorted by key
func SourcePath ¶
SourcePath returns a path relative to the source directory.
type ReportInterface ¶
type ReportInterface interface {
Report(allTargets []interface{}, selectedTargets []interface{}) BuildInterface
}
type RunInterface ¶
type StringFlag ¶
type StringFlag struct { Name string Description string AllowedValues []string DefaultFn func() string // contains filtered or unexported fields }
func (StringFlag) Register ¶
func (flag StringFlag) Register() *StringFlag
func (*StringFlag) Value ¶
func (flag *StringFlag) Value() string