@@ -7,6 +7,9 @@ BAZEL_FILES = $(shell find . -type f -name "*BUILD" -o -name "*.bzl")
77COMMIT_HASH = $(shell git log -1 --format=% h)
88COPYRIGHT = "Garena Online Private Limited"
99BAZELOPT =
10+ BAZELISK_BIN = $(shell command -v bazelisk 2>/dev/null || echo $(HOME ) /go/bin/bazelisk)
11+ BAZEL_VERSION = 6.0.0
12+ BAZEL = USE_BAZEL_VERSION=$(BAZEL_VERSION ) $(BAZELISK_BIN )
1013DATE = $(shell date "+% Y-% m-% d")
1114DOCKER_TAG = $(DATE ) -$(COMMIT_HASH )
1215DOCKER_USER = trinkle23897
@@ -42,7 +45,7 @@ go-install:
4245 command -v go || (sudo apt-get install -y golang-1.18 && sudo ln -sf /usr/lib/go-1.18/bin/go /usr/bin/go)
4346
4447bazel-install : go-install
45- command -v bazel || ( go install github.com/bazelbuild/bazelisk@latest && ln -sf $( HOME ) /go/bin/bazelisk $( HOME ) /go/bin/bazel)
48+ command -v bazelisk || go install github.com/bazelbuild/bazelisk@latest
4649
4750buildifier-install : go-install
4851 command -v buildifier || go install github.com/bazelbuild/buildtools/buildifier@latest
@@ -105,28 +108,28 @@ bazel-pip-requirement-release:
105108 cd third_party/pip_requirements && (cmp requirements.txt requirements-release.txt || ln -sf requirements-release.txt requirements.txt)
106109
107110clang-tidy : clang-tidy-install bazel-pip-requirement-dev
108- bazel build $(BAZELOPT ) //... --config=clang-tidy --config=test
111+ $( BAZEL ) build $(BAZELOPT ) //... --config=clang-tidy --config=test
109112
110113bazel-debug : bazel-install bazel-pip-requirement-dev
111- bazel run $(BAZELOPT ) //:setup --config=debug -- bdist_wheel
114+ $( BAZEL ) run $(BAZELOPT ) //:setup --config=debug -- bdist_wheel
112115 mkdir -p dist
113116 cp bazel-bin/setup.runfiles/$(PROJECT_NAME ) /dist/* .whl ./dist
114117
115118bazel-build : bazel-install bazel-pip-requirement-dev
116- bazel run $(BAZELOPT ) //:setup --config=test -- bdist_wheel
119+ $( BAZEL ) run $(BAZELOPT ) //:setup --config=test -- bdist_wheel
117120 mkdir -p dist
118121 cp bazel-bin/setup.runfiles/$(PROJECT_NAME ) /dist/* .whl ./dist
119122
120123bazel-release : bazel-install bazel-pip-requirement-release
121- bazel run $(BAZELOPT ) //:setup --config=release -- bdist_wheel
124+ $( BAZEL ) run $(BAZELOPT ) //:setup --config=release -- bdist_wheel
122125 mkdir -p dist
123126 cp bazel-bin/setup.runfiles/$(PROJECT_NAME ) /dist/* .whl ./dist
124127
125128bazel-test : bazel-install bazel-pip-requirement-dev
126- bazel test --test_output=all $(BAZELOPT ) //... --config=test --spawn_strategy=local --color=yes
129+ $( BAZEL ) test --test_output=all $(BAZELOPT ) //... --config=test --spawn_strategy=local --color=yes
127130
128131bazel-clean : bazel-install
129- bazel clean --expunge
132+ $( BAZEL ) clean --expunge
130133
131134# documentation
132135
0 commit comments