Documentation
¶
Index ¶
Constants ¶
const GopPackage = true
Variables ¶
This section is empty.
Functions ¶
func Gopt_ModuleF_Main ¶
Gopt_ModuleF_Main is main entry of this classfile.
Types ¶
type BuildResult ¶
type BuildResult struct {
// contains filtered or unexported fields
}
BuildResult represents the result of building a project.
func (*BuildResult) Errs ¶
func (b *BuildResult) Errs() []error
Errs returns all errors collected during build.
func (*BuildResult) Metadata ¶
func (b *BuildResult) Metadata() string
Metadata returns the build output metadata.
func (*BuildResult) SetMetadata ¶
func (b *BuildResult) SetMetadata(metadata string)
SetMetadata sets the build output metadata.
type Context ¶
type Context struct {
SourceDir string
// contains filtered or unexported fields
}
Context represents the build context.
func NewContext ¶
func NewContext(sourceDir, installDir, matrixStr string, getOutputDir func(string, module.Version) (string, error)) *Context
NewContext creates a Context with build-internal fields.
func (*Context) AddBuildResult ¶
func (c *Context) AddBuildResult(mod module.Version, result BuildResult)
AddBuildResult stores the build result for the given module.
func (*Context) BuildResult ¶
func (c *Context) BuildResult(mod module.Version) (BuildResult, bool)
BuildResult returns the stored build result for the module, if any.
func (*Context) CurrentMatrix ¶
CurrentMatrix returns the active build matrix for this context.
func (*Context) OutputDir__0 ¶
OutputDir__0 returns the current module's output (install) directory. In DSL: ctx.outputDir()
type Matrix ¶
type Matrix struct {
Require map[string][]string
Options map[string][]string
DefaultOptions map[string][]string
}
func (*Matrix) CombinationCount ¶
CombinationCount returns the total number of cartesian product combinations.
func (*Matrix) Combinations ¶
Combinations returns all cartesian product combinations of the matrix. Keys are sorted alphabetically, and combinations are built layer by layer. Require fields are joined with "-", then combined with options using "|".
type ModuleDeps ¶
type ModuleDeps struct {
// contains filtered or unexported fields
}
ModuleDeps represents the dependencies of a module.
func (*ModuleDeps) Deps ¶
func (p *ModuleDeps) Deps() []module.Version
Deps returns the collected module dependencies.
func (*ModuleDeps) Require ¶
func (p *ModuleDeps) Require(path, ver string)
Require declares that the module being built depends on the specified module (by its path and version).
type ModuleF ¶
ModuleF represents the build formula of a module.
func (*ModuleF) Id ¶
Id sets the module path that this formula serves. path should be in the form of "owner/repo".
func (*ModuleF) OnBuild ¶
func (p *ModuleF) OnBuild(f func(ctx *Context, proj *Project, out *BuildResult))
OnBuild event is used to instruct the Formula to compile a project.
func (*ModuleF) OnRequire ¶
func (p *ModuleF) OnRequire(f func(proj *Project, deps *ModuleDeps))
OnRequire event is used to retrieve all direct dependencies of a project (module). proj is the project being built, deps is used to declare dependencies.