Skip to main content

Bazel Awesome


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

Stories

参考项目