Documentation
¶
Overview ¶
Package build provides a task for the Go toolchain "build" command.
Index ¶
Constants ¶
const (
// DefaultDistOutputDirName is the default directory name for production and distribution builds.
DefaultDistOutputDirName = "dist"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Options)
Option is a task option.
func WithBinaryArtifactName ¶
WithBinaryArtifactName sets the name for the binary build artifact.
func WithCrossCompileTargetPlatforms ¶
WithCrossCompileTargetPlatforms sets the names of cross-compile platform targets.
func WithFlags ¶
WithFlags sets additional flags to pass to the Go `build` command along with the base Go flags.
func WithGoOptions ¶
WithGoOptions sets shared Go toolchain task options.
func WithOutputDir ¶
WithOutputDir sets the output directory, relative to the project root, for compilation artifacts.
type Options ¶
type Options struct { *taskGo.Options // BinaryArtifactName is the name for the binary build artifact. BinaryArtifactName string // CrossCompileTargetPlatforms are the names of cross-compile platform targets. // // See `go tool dist list` and the `go` command documentations for more details: // - https://github.com/golang/go/blob/master/src/cmd/dist/build.go CrossCompileTargetPlatforms []string // Flags are additional flags to pass to the Go `build` command along with the base Go flags. // // See `go help build` and the Go command documentation for more details: // - https://golang.org/cmd/go/#hdr-Compile_packages_and_dependencies Flags []string // OutputDir is the output directory, relative to the project root, for compilation artifacts. OutputDir string // contains filtered or unexported fields }
Options are task options.
type Task ¶
type Task struct {
// contains filtered or unexported fields
}
Task is a task for the Go toolchain "build" command.
func (*Task) BuildParams ¶
BuildParams builds the parameters. Note that configured flags are applied after the "GOFLAGS" environment variable and could overwrite already defined flags.
See `go help environment`, `go help env` and the `go` command documentations for more details: