bazel__book/p30_33/compare.bash

19 lines
651 B
Bash

#!/usr/bin/env bash
# Locate the profile out of the cleaned area to avoid errors
# bazel clean --expunge --profile=/tmp/clean.gz
bazel clean
# Compiles everything
# time bazel build //inc_demo:app --execution_log_json_file=/tmp/log.json
bazel build //inc_demo:app -s --noshow_progress
sed -i.bak 's/a \+ b/a + b + 0/g' inc_demo/add.cc
# upper.cc and its libraries are now cache hits, only add.cc and link are rebuilt
bazel build //inc_demo:app -s --noshow_progress
sed -i.bak 's/a \+ b/a + b + 0/g' inc_demo/add.cc
# upper.cc and its libraries are now cache hits, only add.cc and link are rebuilt
bazel build //inc_demo:app -s --noshow_progress