Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a9cc25d7 authored by Ramy Medhat's avatar Ramy Medhat
Browse files

Add RBE support for Javac, R8, and D8 if respective env vars are set.

Test: aosp_crosshatch build with and without the new variables.
Change-Id: I252ff5dd8e372edf8c86e25348c8a2bfab41d70d
parent 9fe24798
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2200,7 +2200,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) \
@@ -2679,7 +2679,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 \
+16 −3
Original line number Diff line number Diff line
@@ -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
+3 −0
Original line number Diff line number Diff line
@@ -156,6 +156,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))