Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrTooManyArguments = errors.New("too many arguments") ErrMissingGoFile = errors.New("missing target .go file") ErrUnexpectedParams = errors.New("unexpected list of parameters") ErrNoMatchedPlatform = errors.New("no matched platform") )
Here defines a set of standard errors
View Source
var CmdCross = &cobra.Command{ Use: "cross [common go build flags] [file] [darwin|linux|windows|freebsd|netbsd|all] [amd64|386|arm|s390x|mips|mipsle|mips64|mips64le|all]", Short: "agile and fast cross compiling", Long: ` Usage: gos cross [common go build flags] [-e] [go file] [os] [arch] [common go build flags] you can use any standard flag for go build here, such as /-tags="..."/-a/-o/..., as you would with native go build [-e] when you specify -e, compilation errors will be printed [file] the go file you wanna to build [os] the OS such as linux/darwin/windows/freebsd/netbsd/openbsd/android/dragonfly/nacl/solaris/plan9, you can also use "all" to compile all OS [arch] the Arch such as amd64/386/arm/arm64/s390x/mips/mipsle/mips64/mips64le, you can also use "all" to compile all Arch - Compile all platform gos cross main.go all all - Compile all linux arch gos cross main.go linux all - Compile windows/amd64 gos cross main.go windows amd64 - Compile with standard go build flags gos cross -tags="prod" -ldflags="-s -w" -a main.go all all - Compile with error info printed gos cross -e main.go all all `, DisableFlagParsing: true, }
CmdCross is the command line for cross compilation
Functions ¶
Types ¶
type Options ¶
type Options struct { // * Cross will parse an -e identifier to determine // * if a compilation error message needs to be printed. The default is not to print. StandardGO []string Output string Package string Platform // * ShowErr will be true when the -e identifier is present ShowErr bool // contains filtered or unexported fields }
Options defines the structure of compilation options
func NewOptions ¶
NewOptions is used to parse cmd args
func (*Options) GetCompileWorkhorse ¶
GetCompileWorkhorse is used to get all compilation tasks
type Platforms ¶
type Platforms []Platform
Platforms defines a set of compilation platforms
func (Platforms) FilterByArch ¶
FilterByArch filters the platform by type of arch
func (Platforms) FilterByOS ¶
FilterByOS filters the platform by type of OS
Click to show internal directories.
Click to hide internal directories.