Skip to content

Commit

Permalink
feat(bazel): auto install on mac with brew
Browse files Browse the repository at this point in the history
  • Loading branch information
nmeier committed Oct 1, 2019
1 parent 52158b9 commit cae2f48
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions bazel.make
@@ -1,8 +1,18 @@
BAZEL_BUILD=bazel $(BAZEL_ARGS) build $(BAZEL_CMD_ARGS)

ifeq ($(UNAME_S),Darwin)
BAZEL = /usr/local/bin/bazel

$(BAZEL):
brew tap bazelbuild/tap
brew install bazelbuild/tap/bazel
endif

BAZEL ?= $(shell which bazel 2>/dev/null || echo bazel)

.PHONY: bazel.banner
bazel.banner:
bazel $(BAZEL_ARGS) run $(BAZEL_CMD_ARGS) //go/cmd/bertychat banner
bazel.banner: $(BAZEL)
$(BAZEL) $(BAZEL_ARGS) run $(BAZEL_CMD_ARGS) //go/cmd/bertychat banner

.PHONY: bazel.build
bazel.build:
Expand All @@ -14,12 +24,12 @@ bazel.test:
bazel $(BAZEL_ARGS) test $(BAZEL_CMD_ARGS) //api/... //go/...

.PHONY: bazel.clean
bazel.clean:
bazel clean
bazel.clean: $(BAZEL)
$(BAZEL) clean

.PHONY: bazel.expunge
bazel.expunge:
bazel clean --expunge
bazel.expunge: $(BAZEL)
$(BAZEL) clean --expunge

.PHONY: bazel.re
bazel.re: bazel.expunge
Expand Down

0 comments on commit cae2f48

Please sign in to comment.