Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/anchore/go-make
https://github.com/anchore/go-make
Last synced: 3 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/anchore/go-make
- Owner: anchore
- License: apache-2.0
- Created: 2024-10-15T16:06:48.000Z (29 days ago)
- Default Branch: main
- Last Pushed: 2024-10-23T20:33:28.000Z (20 days ago)
- Last Synced: 2024-10-24T08:18:41.581Z (20 days ago)
- Language: Go
- Size: 48.8 KB
- Stars: 0
- Watchers: 11
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-make
A golang-based build script library, with a goals of having very few dependencies for fast execution time
and enabling consistent, cross-platform build scripts.## Example
```golang
package main // file: make/main.goimport (
. "github.com/anchore/go-make"
"github.com/anchore/go-make/golint"
"github.com/anchore/go-make/gotest"
)func main() {
Makefile(
golint.Tasks(), // centralize common task definitions
gotest.Test("unit"),
// define tasks that feel somewhat like configuration / scripts:
Task{
Name: "build",
Desc: "make a custom build task",
Deps: All("goreleaser:snapshot-buildfile"), // can ensure other specific tasks run first, like make dependencies
Run: func() {
// Run function supports: global template vars, quoting within strings,
// obtaining & providing binny-managed executable
Run(`goreleaser build --config {{TmpDir}}/goreleaser.yaml --clean --snapshot --single-target`)
},
},
Task{
Name: "custom-tests",
Desc: "do some custom formatting stuff",
Label: All("test"), // runs whenever "test" runs, e.g. make test
Run: func() {
// failed commands have convenient links here, in this file
Run(`go test ./test`)
},
},
)
}
```Also, see [the build definition in this repository](make/main.go)