Instantly share code, notes, and snippets.

@jin /.bazelrc
Last active Nov 29, 2018

What would you like to do?
Android bazelrc configuration for remote execution and dynamic builds on GCP Remote Build Execution
# Requires Bazel built from HEAD (after
# ... import /path/to/bazel-toolchains/bazelrc/bazel-0.19.2.bazelrc
# Configuration to build Android apps remotely
# bazel build //android:app --config=android_remote
build:android_remote --config=remote # Reuse remote config from RBE bazelrc
build:android_remote --config=results # Reuse results config from RBE bazelrc
build:android_remote --noexperimental_check_desugar_deps # Workaround for a tool incompatibility with RBE
build:android_remote --strategy=CppCompile=remote # RBE C++ toolchain is built for RBE container
build:android_remote --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=0 # Autodetect local C++ toolchain (for Android only)
# Configuration to build Android apps dynamically
# Requires host and remote to be Linux
# bazel build //android:app --config=dynamic_android
build:dynamic_android --config=android_remote # load android_remote config
build:dynamic_android --experimental_spawn_scheduler # enable dynamic execution
build:dynamic_android --internal_persistent_busybox_tools # tell dynamic execution that resource processing supports workers
build:dynamic_android --strategy=DexBuilder=dynamic # force DexBuilder to use dynamic execution
build:dynamic_android --strategy=Javac=dynamic # force Javac to use dynamic execution
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment