gödel is a Go build tool that provides tasks for configuring, formatting, checking, testing, building and publishing Go projects in a declarative, consistent and reproducible manner across different platforms and environments. gödel can be used in both local development environments and for verifying the correctness of project in CI environments. gödel uses declarative configuration to define the parameters for a project and provides an executable that orchestrates build tasks using standard Go commands. It centralizes project configuration and eliminates the need for custom build scripts that conflate configuration with logic. gödel is designed to be portable, fast and lightweight -- adding it to a project consists of copying a single file and directory into the project and adds less than 50kb of version-controlled material.
gödel is also highly extensible and configurable. The core functionality of gödel is provided by plugins and assets, and it is easy to write new plugins or assets and to configure a gödel instance to use custom plugins or assets as needed.
The following features are provided by a default gödel installation (either as builtin tasks or default plugin tasks):
- Add to a project by running the
godelinitprogram ./godelw git-hooksinstalls Git commit hook that formats files on commit./godelw golandcreates and configures a GoLand project for the project- Supports configuring directories and files that should be excluded by the tool
./godelw formatformats all code in a project./godelw lintruns a variety of code linting checks on all the code in a project- Use
golangci-lintto run linters - The
golangci-lintexecutable that should be used (which can be one that is built with custom linters) can be configured as an asset
- Use
./godelw licenseapplies a specified license header to all Go files in a project- Supports configuring custom license headers for specific directories or files
./godelw testruns the tests in the project- Configuration can be used to define test sets (such as integration tests) and run specific test sets
- Supports outputting the test results in a JUnit XML format
./godelw buildbuilds executables formainpackages in the project- Supports cross-platform compilation
- Supports configuration of
ldflagfor version and other variables - Installs packages by default to speed up repeated builds
./godelw distcreates distribution files for products- Supports creating
tgzdistributions - Supports customizing creation of distribution using scripts
- Supports creating custom distributions using assets
- Supports creating
./godelw publishpublishes artifacts to Bintray, Artifactory or GitHub- Supports other forms of publishing using assets
palantir/godel/pkg/productspackage provides a mechanism to easily write integration tests for gödel projects- Provides a function that builds the product executable or distribution and provides a path to invoke it
./godelw updateupdates gödel to the version specified ingodel/config/godel.properties./godelw verifyruns all of the tasks that declare support for verification- Can be used locally as a single command to apply changes and run checks
- Can be used in CI to verify that a project is in the proper state without applying changes
./godelw github-wikimirrors a documents directory to a GitHub Wiki repository
This list is not exhaustive -- run ./godelw --help for a list of all of the available commands. Furthermore, custom
Documentation for this project is in the docs directory and the GitHub Wiki
(the GitHub Wiki mirrors the contents of the docs directory).
This project is made available under the Apache 2.0 License.