{"id":17957790,"url":"https://github.com/mat007/brique","last_synced_at":"2025-04-03T17:32:22.241Z","repository":{"id":91565066,"uuid":"142255895","full_name":"mat007/brique","owner":"mat007","description":"Build tool for Go projects.","archived":false,"fork":false,"pushed_at":"2018-12-02T15:19:12.000Z","size":152,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-02-09T06:16:27.159Z","etag":null,"topics":["build","go","golang","tool"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mat007.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-25T06:16:13.000Z","updated_at":"2018-12-02T15:19:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"c32b1117-0858-4715-af6d-333b60c46e65","html_url":"https://github.com/mat007/brique","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mat007%2Fbrique","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mat007%2Fbrique/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mat007%2Fbrique/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mat007%2Fbrique/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mat007","download_url":"https://codeload.github.com/mat007/brique/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247046916,"owners_count":20874739,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["build","go","golang","tool"],"created_at":"2024-10-29T10:57:27.837Z","updated_at":"2025-04-03T17:32:22.212Z","avatar_url":"https://github.com/mat007.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Brique\n\nA quest for the perfect build tool.\n\n## Why Brique?\n\nMany Go projects use `make` to drive the build, however it has several drawbacks including its severe lack of portability on the Windows platform.\n\nEven if it's possible to find an implementation of `make` for Windows, it's not as readily available as for Linux and Darwin.\nThe biggest problem however is that a `Makefile` usually relies on the underlying shell for most features and something as simple as `tar` or even `rm` is difficult to provide or write properly on Windows.\n\nFor any good size multi-platform project this often means ending up with build code difficult to maintain sometimes using multiple scripting languages (`Makefile`, `shell`, `bash`, `PowerShell`, `batch`, `python`, …).\n\nBrique aims at unifying all this by making it possible to use Go as the build code.\n\n## What is Brique?\n\nBrique is a build tool for Go projects made of three parts:\n* a Go binary called `b` (or `b.exe` on Windows) which creates and invokes on the fly a custom binary specifically tailored to build each project\n* a Go package of bricks (called `building`) to help with implementing the build features needed by each project\n* a Shell and a Batch script to bootstrap the build and allow to vendor the whole tool chain in each project\n\nThe goal of Brique is to create a build environment which is:\n* with a low barrier of entry (build written in Go, no tool chain to install)\n* fast (especially when nothing needs to be done)\n* extensible (linters, coverage, release, signing, …)\n* multi-platform (single code, cross-compilation, parallel builds)\n* build server friendly (reproducible, cleans after itself, no requirements other than `Docker`)\n\nUsing containers provides a nice way to fulfill most of these requirements, however they tend to be slow:  either project files must be baked into an image and artifacts copied back from a container, or volumes must be mounted to share project files with a container and they are quite slow (on Windows mainly and Darwin also).\n\nBrique works around this by providing build fallbacks.\nFor instance if a tool (e.g. `go`) is available it will be used directly, if not but `Docker` is available, Brique will spin a container to use the tool.\n\nThis flexibility allows for casual developpers on a project (or product managers or build servers) to build a project right away without having to figure out which tool chain is needed, while core developpers building more frequently will probably want to install most of the required tools to minimize the build times.\n\nBrique provides a library of build tools wrappers and is very easy to extend with more custom wrappers as needed.\n\n## How to get started with Brique?\n\nOf course Brique can be used on itself!\n\nFor a quick glance at a project build code using Brique look at [cmd/build/build.go](cmd/build/build.go).\n\nTo find out how to build simply invoke `./build.sh` or `build.bat` at the root of the project with the `-help` flag:\n```\n$ ./build.sh -help\nUsage: build [OPTIONS] [TARGETS]\n\nOptions:\n  -containers\n        always build in containers\n  -cross\n        build for all platforms (linux, darwin, windows)\n  -parallel\n        build in parallel\n  -q    quiet output\n  -test.run string\n        pattern to filter the tests\n  -v    verbose output\n\nTargets:\n  all   does everything\n  depends\n        retrieves the dependencies\n  test  runs the tests\n```\n\nThis output gets generated on the fly, a bit like what `go test` does with parsing files ending in `_test.go` to extract test functions matching the test designated signature, except here Brique looks for an exported `func Xyz(b *building.B)`.\n\nThe comments above target functions are used as descriptions for the targets listed in the help.\n\nThe first target in the Go build file becomes the default one, meaning here calling `./build.sh` or `build.bat` with no argument will invoke the `all` target, e.g.:\n```\n$ ./build.sh\nbuild started\n\u003e all\nrunning [dep ensure]\nrunning [go test -test.run  ./...]\nok      github.com/mat007/brique        (cached)\n?       github.com/mat007/brique/cmd/build      [no test files]\n\u003c all (took 19.5013775s)\nbuild finished (took 19.503879s)\n```\n\n## How to use Brique?\n\nBrique releases no binary because it's designed to be entirely vendored.\n\nTo add Brique to a project follow these steps:\n* Add both [build.sh](build.sh) and [build.bat](build.bat) to the project root folder\n* In both `build.sh` and `build.bat` change the `PACKAGE_NAME` variable to the project package name\n* Create a file `cmd/build/build.go` with the content:\n```go\npackage build\n\nimport (\n\t\"github.com/mat007/brique\"\n)\n\n// All does everything\nfunc All(b *building.B) {\n\tfmt.Println(\"OK!)\n}\n```\n* Use your vendoring tool to bring Brique in\n* Test by invoking `build.sh` or `build.bat` from the project root folder\n\n## Where to go next with Brique?\n\nThe project is still in alpha phase and has no stable API yet, meaning it may be a bit early to use in production.\nHowever the only way to gather feedback and shape it properly now would be to start using it in real world projects.\n\nIt also needs proper end-to-end tests, continuous integration, more documentation and also feedback, feedback and feedback!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmat007%2Fbrique","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmat007%2Fbrique","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmat007%2Fbrique/lists"}