blob: f9317a324f71f96f24b89b887a400d44266ca8a6 [file] [log] [blame]
Kousik Kumar4faa2a52020-03-05 14:08:09 -08001source build/envsetup.sh
2
3# This function prefixes the given command with appropriate variables needed
4# for the build to be executed with RBE.
5function use_rbe() {
6 local RBE_LOG_DIR="/tmp"
Luca Stefanicf82af22020-06-13 22:38:56 +02007 local RBE_BINARIES_DIR="prebuilts/remoteexecution-client/latest"
Kousik Kumar4faa2a52020-03-05 14:08:09 -08008 local DOCKER_IMAGE="gcr.io/androidbuild-re-dockerimage/android-build-remoteexec-image@sha256:582efb38f0c229ea39952fff9e132ccbe183e14869b39888010dacf56b360d62"
9
10 # Do not set an invocation-ID and let reproxy auto-generate one.
11 USE_RBE="true" \
12 FLAG_server_address="unix:///tmp/reproxy_$RANDOM.sock" \
13 FLAG_exec_root="$(gettop)" \
14 FLAG_platform="container-image=docker://${DOCKER_IMAGE}" \
15 RBE_use_application_default_credentials="true" \
16 RBE_log_dir="${RBE_LOG_DIR}" \
17 RBE_reproxy_wait_seconds="20" \
18 RBE_output_dir="${RBE_LOG_DIR}" \
19 RBE_log_path="text://${RBE_LOG_DIR}/reproxy_log.txt" \
20 RBE_CXX_EXEC_STRATEGY="remote_local_fallback" \
21 RBE_cpp_dependency_scanner_plugin="${RBE_BINARIES_DIR}/dependency_scanner_go_plugin.so" \
22 RBE_DIR=${RBE_BINARIES_DIR} \
23 RBE_re_proxy="${RBE_BINARIES_DIR}/reproxy" \
24 $@
25}
Patrice Arrudad990f702020-07-10 23:22:49 +000026
27# This function detects if the uploader is available and sets the path of it to
28# ANDROID_ENABLE_METRICS_UPLOAD.
29function _export_metrics_uploader() {
30 local uploader_path="$(gettop)/vendor/google/misc/metrics_uploader_prebuilt/metrics_uploader.sh"
31 if [ -x "${uploader_path}" ]; then
32 export ANDROID_ENABLE_METRICS_UPLOAD="${uploader_path}"
33 fi
34}
35
36_export_metrics_uploader