Documentation ¶
Overview ¶
Package gox provides a task for the github.com/mitchellh/gox Go module command. "gox" is a dead simple, no frills Go cross compile tool that behaves a lot like the standard Go toolchain "build" command.
See https://pkg.go.dev/github.com/mitchellh/gox for more details about "gox". The source code of the "gox" is available at https://github.com/mitchellh/gox.
Index ¶
- Constants
- Variables
- type Option
- func WithEnv(env map[string]string) Option
- func WithGoBuildOptions(goBuildOpts ...taskGoBuild.Option) Option
- func WithGoCmd(goCmd string) Option
- func WithGoOptions(goOpts ...taskGo.Option) Option
- func WithModulePath(path string) Option
- func WithModuleVersion(version *semver.Version) Option
- func WithOutputTemplate(outputTemplate string) Option
- func WithVerboseOutput(verbose bool) Option
- type Options
- type Task
Constants ¶
const ( // DefaultGoModulePath is the default module import path. DefaultGoModulePath = "github.com/mitchellh/gox" // DefaultGoModuleVersion is the default module version. DefaultGoModuleVersion = "v1.0.1" )
Variables ¶
var ( // DefaultCrossCompileBinaryNameTemplate is the default name template for cross-compilation binary artifacts. DefaultCrossCompileBinaryNameTemplate = func(name string) string { return name + "-{{.OS}}-{{.Arch}}" } // DefaultCrossCompileTargetPlatforms are the names of default cross-compile platform targets. // // See `go tool dist list` and https://github.com/golang/go/blob/master/src/cmd/dist/build.go // for more details and a list of supported platforms. DefaultCrossCompileTargetPlatforms = []string{ "darwin/amd64", "linux/amd64", "windows/amd64", } )
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Options)
Option is a task option.
func WithGoBuildOptions ¶
func WithGoBuildOptions(goBuildOpts ...taskGoBuild.Option) Option
WithGoBuildOptions sets Go toolchain "build" command task options.
func WithGoOptions ¶
WithGoOptions sets shared Go toolchain task options.
func WithModulePath ¶
WithModulePath sets the module import path. Defaults to DefaultGoModulePath.
func WithModuleVersion ¶
func WithModuleVersion(version *semver.Version) Option
WithModuleVersion sets the module version. Defaults to DefaultGoModuleVersion.
func WithOutputTemplate ¶
WithOutputTemplate sets the name template for cross-compile platform targets. Defaults to DefaultCrossCompileBinaryNameTemplate.
func WithVerboseOutput ¶
WithVerboseOutput indicates whether the output should be verbose.
type Options ¶
type Options struct { *taskGoBuild.Options // contains filtered or unexported fields }
Options are task options.
func NewOptions ¶
NewOptions creates new task options.
type Task ¶
type Task struct {
// contains filtered or unexported fields
}
Task is a task for the "github.com/mitchellh/gox" Go module command.
func (*Task) ID ¶
func (t *Task) ID() *project.GoModuleID
ID returns the identifier of the Go module.