Bazel Awesome
- bazelbuild/bazel-gazelle
- 生成 BUILD.bazel
- stellar/go
- Golang monorepo
- bazelbuild/bazelisk
- wrapper
- bazelbuild/bazel-watcher
- Watch change
- bazelbuild/intellij
- intellij 插件
- 目前还是早期版本 - 功能很弱
- bazelbuild/buildtools
- buildifier - BUILD & .bzl
- 商业产品服务
- atlassian/bazel-tools
- 已经归档, multirun 可用于聚合运行多个 target
go install github.com/bazelbuild/buildtools/buildifier@latest
buildifier --lint=fix path/to/file
bazel run //:buildifier
- $XDG_CACHE_HOME
- macOS $HOME/Library/Caches
- $HOME/.cache
- Windows %LocalAppData%
- Plan 9 $home/lib/cache
- cache
- ~/Library/Caches/bazelisk/downloads/bazelbuild/bazel-$VERSION-darwin-x86_64/bin/download3656661839
GOPROXY=https://goproxy.io,direct go install github.com/bazelbuild/bazelisk@latest
USE_BAZEL_VERSION=4.2.2 BAZELISK_BASE_URL=https://mirrors.huaweicloud.com/bazel `go env GOPATH`/bin/bazelisk info
tree ~/Library/Caches/bazelisk/downloads
Makefile
BAZEL=BAZELISK_BASE_URL=https://mirrors.huaweicloud.com/bazel `go env GOPATH`/bin/bazelisk
prepare:
command -v bazel > /dev/null || GOPROXY=https://goproxy.io,direct go install github.com/bazelbuild/bazelisk@latest
$(BAZEL) info
.PHONY: build
build:
$(BAZEL) build //cmd/...
showcase
- googleapis/googleapis
- proto 一次性编译 7 种语言
- 使用 googleapis/rules_gapic 生成