builder

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BuildCmd = climax.Command{
	Name:  "build",
	Brief: "Build the main executable of your project",
	Help:  "Build the main executable of your project",
	Flags: []climax.Flag{
		{
			Name:     "output",
			Short:    "o",
			Usage:    `--output=<output-path>`,
			Help:     `The path where the executable should be stored`,
			Variable: true,
		},
		{
			Name:     "goos",
			Short:    "",
			Usage:    `--goos=<os>`,
			Help:     `The goos to build for`,
			Variable: true,
		},
		{
			Name:     "goarch",
			Short:    "",
			Usage:    `--goarch=<arch>`,
			Help:     `The goarch to build for`,
			Variable: true,
		},
		{
			Name:     "verbose",
			Short:    "v",
			Usage:    `--verbose`,
			Help:     `print the names of packages as they are compiled.`,
			Variable: false,
		},
	},
	Handle: func(ctx climax.Context) int {

		output, _ := ctx.Get("output")
		goos, _ := ctx.Get("goos")
		goarch, _ := ctx.Get("goarch")
		verbose := ctx.Is("verbose")

		tool := builder.Builder{
			OutputPath: output,
			GOOS:       goos,
			GOARCH:     goarch,
			Verbose:    verbose,
		}

		executor := internal.NewExecutor("")
		return executor.RunTool(tool, true)

	},
}

BuildCmd defines the build command

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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