https://github.com/abiosoft/custombuild
Automate custom builds of Go programs. Highly experimental.
https://github.com/abiosoft/custombuild
Last synced: 6 months ago
JSON representation
Automate custom builds of Go programs. Highly experimental.
- Host: GitHub
- URL: https://github.com/abiosoft/custombuild
- Owner: abiosoft
- License: mit
- Created: 2015-06-14T05:45:02.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2016-06-09T14:24:29.000Z (about 10 years ago)
- Last Synced: 2025-01-23T14:49:55.084Z (over 1 year ago)
- Language: Go
- Homepage:
- Size: 17.6 KB
- Stars: 0
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
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
```go
// 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).