Skip to content

Commit

Permalink
Speedup builds with bazel remote disk caching (#62)
Browse files Browse the repository at this point in the history
This PR adds remote disk caching to all make / CI builds
  • Loading branch information
jerrymarino authored Nov 9, 2018
1 parent f109dd1 commit 77e2d25
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,10 @@ os:
- osx
before_install:
- sudo gem install cocoapods
cache:
directories:
- $HOME/.bazelenv
- $HOME/Library/Caches/Bazel
- $HOME/.bazel_pod_store
osx_image: xcode10
script: make ci
9 changes: 7 additions & 2 deletions Examples/Example.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,20 @@ BAZEL_WRAPPER=$(RULES_PODS_DIR)/tools/bazelwrapper
# Currently `bazelwrapper` relies on pwd, which causes issues here
BAZEL=~/.bazelenv/versions/0.18.0/bin/bazel

# Override the repository to point at the source. It does a source build of the
# current code.
BAZEL_OPTS=--override_repository=rules_pods=$(RULES_PODS_DIR) \
--disk_cache=$(HOME)/Library/Caches/Bazel

all: fetch build

# Build everything in this workspace
.PHONY: build
build: info
$(BAZEL) build :* --override_repository=rules_pods=$(RULES_PODS_DIR)
$(BAZEL) build :* $(BAZEL_OPTS)

test: info
$(BAZEL) test :* --override_repository=rules_pods=$(RULES_PODS_DIR)
$(BAZEL) test :* $(BAZEL_OPTS)

# Fetch vendored pods if there's a Pods.WORKSPACE. In normal operation it isn't
# expected to run `update_pods` along with a build.
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ ci: clean

release:
@tools/bazelwrapper build \
--disk_cache=$(HOME)/Library/Caches/Bazel \
--spawn_strategy=standalone \
-c opt \
--swiftcopt=-whole-module-optimization :RepoTools :Compiler
@ditto bazel-bin/RepoTools bin/RepoTools
Expand Down

0 comments on commit 77e2d25

Please sign in to comment.