gox

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2022 License: MIT Imports: 8 Imported by: 0

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

View Source
const (
	// DefaultGoModulePath is the default module import path.
	DefaultGoModulePath = "github.com/mitchellh/gox"

	// DefaultGoModuleVersion is the default module version.
	DefaultGoModuleVersion = "v1.0.1"
)

Variables

View Source
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 WithEnv

func WithEnv(env map[string]string) Option

WithEnv sets the task specific environment.

func WithGoBuildOptions

func WithGoBuildOptions(goBuildOpts ...taskGoBuild.Option) Option

WithGoBuildOptions sets Go toolchain "build" command task options.

func WithGoCmd

func WithGoCmd(goCmd string) Option

WithGoCmd sets the path to the Go toolchain executable.

func WithGoOptions

func WithGoOptions(goOpts ...taskGo.Option) Option

WithGoOptions sets shared Go toolchain task options.

func WithModulePath

func WithModulePath(path string) Option

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

func WithOutputTemplate(outputTemplate string) Option

WithOutputTemplate sets the name template for cross-compile platform targets. Defaults to DefaultCrossCompileBinaryNameTemplate.

func WithVerboseOutput

func WithVerboseOutput(verbose bool) Option

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

func NewOptions(opts ...Option) (*Options, error)

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 New

func New(ac app.Config, opts ...Option) (*Task, error)

New creates a new task for the "github.com/mitchellh/gox" Go module command.

func (*Task) BuildParams

func (t *Task) BuildParams() []string

BuildParams builds the parameters.

func (*Task) Env

func (t *Task) Env() map[string]string

Env returns the task specific environment.

func (*Task) ID

func (t *Task) ID() *project.GoModuleID

ID returns the identifier of the Go module.

func (*Task) Kind

func (t *Task) Kind() task.Kind

Kind returns the task kind.

func (*Task) Name added in v0.6.0

func (t *Task) Name() string

Name returns the task name.

func (*Task) Options

func (t *Task) Options() task.Options

Options returns the task options.

Jump to

Keyboard shortcuts

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