Skip to content

habibmasuro/custombuild

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 

Repository files navigation

custombuild

A fairly simple package that makes it easier to generate custom builds of your Go programs. This package is still experimental.

It takes as input three things:

  • Path to the repository which will be customized
  • A function that performs code generation to customize the build
  • List of packages that are new dependencies of the modified code base

Example

// Prepare a custom build that uses two new packages the original project doesn't use
builder, err := custombuild.New("../myproject", codeGenFunc, []string{
	"github.com/fizz/fizz",
	"github.com/foo/foo",
})
defer builder.Teardown() // always do this, even if error
if err != nil {
	log.Fatal(err)
}

// Build for 64-bit Windows
err = builder.Build("windows", "amd64", "./windows_build.exe")
if err != nil {
	log.Fatal(err)
}

// Build for ARMv6 Linux
err = builder.BuildARM("linux", 6, "./arm_build")
if err != nil {
	log.Fatal(err)
}

Requirements

This tool requires the go tool to be installed and in your PATH. Since this tool calls go get -u, it requires any necessary version control system to be installed also (usually git).

About

Easily automate custom builds of your Go programs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%