build

package
v0.0.0-...-abeb386 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2016 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

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 Command

func Command() cli.Command

func ExecutableName

func ExecutableName(productName, goos string) string

func Products

func Products(products []string, osArchs cmd.OSArchFilter, buildCtx Context, cfg params.Project, wd string, stdout io.Writer) error

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 RunBuildFunc(buildActionFunc cmd.BuildFunc, cfg params.Project, products []string, wd string, stdout io.Writer) error

func SpecsWithDepsForArgs

func SpecsWithDepsForArgs(cfg params.Project, products []string, wd string) ([]params.ProductBuildSpecWithDeps, error)

Types

type Context

type Context struct {
	Parallel bool
	Install  bool
	Pkgdir   bool
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL