Documentation
¶
Index ¶
- func ArtifactPaths(buildSpec params.ProductBuildSpec) map[osarch.OSArch]string
- func Command() cli.Command
- func ExecutableName(productName, goos string) string
- func Products(products []string, osArchs cmd.OSArchFilter, buildCtx Context, ...) error
- func Run(buildSpecs []params.ProductBuildSpec, osArchs cmd.OSArchFilter, ctx Context, ...) error
- func RunBuildFunc(buildActionFunc cmd.BuildFunc, cfg params.Project, products []string, ...) error
- func SpecsWithDepsForArgs(cfg params.Project, products []string, wd string) ([]params.ProductBuildSpecWithDeps, error)
- type Context
- type RequiresBuildInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArtifactPaths ¶
func ArtifactPaths(buildSpec params.ProductBuildSpec) map[osarch.OSArch]string
ArtifactPaths returns a map that contains the paths to the executables created by the provided spec. The keys in the map are the OS/architecture of the executable, and the value is the output path for the executable for that OS/architecture.
func ExecutableName ¶
func Run ¶
func Run(buildSpecs []params.ProductBuildSpec, osArchs cmd.OSArchFilter, ctx Context, stdout io.Writer) error
Run builds all of the executables specified by buildSpecs using the mode specified in ctx. If ctx.Parallel is true, then the products will be built in parallel with N workers, where N is the number of logical processors reported by Go. When builds occur in parallel, each (Product, OSArch) pair is treated as an individual unit of work. Thus, it is possible that different products may be built in parallel. If any build process returns an error, the first error returned is propagated back (and any builds that have not started will not be started). If ctx.PkgDir is true, a custom per-OS/Arch "pkg" directory is used and the "install" command is run before build for each unit, which can speed up compilations on repeated runs by writing compiled packages to disk for reuse.
func RunBuildFunc ¶
func SpecsWithDepsForArgs ¶
Types ¶
type Context ¶
func DefaultContext ¶
func DefaultContext() Context
type RequiresBuildInfo ¶
type RequiresBuildInfo interface { Specs() []params.ProductBuildSpec RequiresBuild(product string, osArch osarch.OSArch) bool // contains filtered or unexported methods }
func RequiresBuild ¶
func RequiresBuild(specWithDeps params.ProductBuildSpecWithDeps, osArchs cmd.OSArchFilter) RequiresBuildInfo
RequiresBuild returns a slice that contains the ProductBuildSpecs that have not been built for the provided ProductBuildSpecWithDeps matching the provided osArchs filter. A product is considered to require building if its output executable does not exist or if the output executable's modification date is older than any of the Go files required to build the product.