[DO NOT MERGE] Add RBE support for Javac, R8, and D8 if respective env vars are set. am: c9a030aa4d

Original change: https://googleplex-android-review.googlesource.com/c/platform/build/+/12468474

Change-Id: I4c8226d15b6dd6676b57e4c7c4295b294903cb06
This commit is contained in:
Ramy Medhat 2020-09-02 10:55:51 +00:00 committed by Automerger Merge Worker
commit 5507116c4a
3 changed files with 21 additions and 5 deletions

View file

@ -2247,7 +2247,7 @@ define transform-classes.jar-to-dex
@mkdir -p $(dir $@)
$(hide) rm -f $(dir $@)classes*.dex $(dir $@)d8_input.jar
$(hide) $(ZIP2ZIP) -j -i $< -o $(dir $@)d8_input.jar "**/*.class"
$(hide) $(DX_COMMAND) $(DEX_FLAGS) \
$(hide) $(D8_WRAPPER) $(DX_COMMAND) $(DEX_FLAGS) \
--output $(dir $@) \
$(addprefix --lib ,$(PRIVATE_D8_LIBS)) \
--min-api $(PRIVATE_MIN_SDK_VERSION) \
@ -2738,7 +2738,7 @@ endif
define transform-jar-to-dex-r8
@echo R8: $@
$(hide) rm -f $(PRIVATE_PROGUARD_DICTIONARY)
$(hide) $(R8_COMPAT_PROGUARD) $(DEX_FLAGS) \
$(hide) $(R8_WRAPPER) $(R8_COMPAT_PROGUARD) $(DEX_FLAGS) \
-injars '$<' \
--min-api $(PRIVATE_MIN_SDK_VERSION) \
--no-data-resources \

View file

@ -21,12 +21,25 @@ ifneq ($(filter-out false,$(USE_RBE)),)
else
rbe_dir := $(HOME)/rbe
endif
RBE_WRAPPER := $(rbe_dir)/rewrapper --labels=type=compile,lang=cpp,compiler=clang --env_var_whitelist=PWD
RBE_WRAPPER := $(rbe_dir)/rewrapper
RBE_CXX := --labels=type=compile,lang=cpp,compiler=clang --env_var_whitelist=PWD
# Append rewrapper to existing *_WRAPPER variables so it's possible to
# use both ccache and rewrapper.
CC_WRAPPER := $(strip $(CC_WRAPPER) $(RBE_WRAPPER))
CXX_WRAPPER := $(strip $(CXX_WRAPPER) $(RBE_WRAPPER))
CC_WRAPPER := $(strip $(CC_WRAPPER) $(RBE_WRAPPER) $(RBE_CXX))
CXX_WRAPPER := $(strip $(CXX_WRAPPER) $(RBE_WRAPPER) $(RBE_CXX))
ifdef RBE_JAVAC
JAVAC_WRAPPER := $(strip $(JAVAC_WRAPPER) $(RBE_WRAPPER) --labels=type=compile,lang=java,compiler=javac,shallow=true)
endif
ifdef RBE_R8
R8_WRAPPER := $(strip $(RBE_WRAPPER) --labels=type=compile,compiler=r8,shallow=true)
endif
ifdef RBE_D8
D8_WRAPPER := $(strip $(RBE_WRAPPER) --labels=type=compile,compiler=d8,shallow=true)
endif
rbe_dir :=
endif

View file

@ -140,6 +140,9 @@ $(call add_json_bool, MinimizeJavaDebugInfo, $(filter true,$(PRODUCT
$(call add_json_bool, UseGoma, $(filter-out false,$(USE_GOMA)))
$(call add_json_bool, UseRBE, $(filter-out false,$(USE_RBE)))
$(call add_json_bool, UseRBEJAVAC, $(filter-out false,$(RBE_JAVAC)))
$(call add_json_bool, UseRBER8, $(filter-out false,$(RBE_R8)))
$(call add_json_bool, UseRBED8, $(filter-out false,$(RBE_D8)))
$(call add_json_bool, Arc, $(filter true,$(TARGET_ARC)))
$(call add_json_list, NamespacesToExport, $(PRODUCT_SOONG_NAMESPACES))