go-james: github.com/pieterclaerhout/go-james/cmd/builder Index | Files

package builder

import "github.com/pieterclaerhout/go-james/cmd/builder"

Index

Package Files

main.go

Variables

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

Package builder imports 3 packages (graph) and is imported by 1 packages. Updated 2019-12-09. Refresh now. Tools for package owners.