Merge "Allow locally disabling R8" am: 017a894c6e
am: 391a95da7e
Change-Id: I3c0a0d0eef90b3c824cce9c2e350714c0d00761f
This commit is contained in:
commit
475475ca3a
|
@ -270,6 +270,7 @@ LOCAL_TIDY_FLAGS:=
|
|||
LOCAL_UNINSTALLABLE_MODULE:=
|
||||
LOCAL_UNSTRIPPED_PATH:=
|
||||
LOCAL_USE_AAPT2:=$(USE_AAPT2)
|
||||
LOCAL_USE_R8:=
|
||||
LOCAL_USE_VNDK:=
|
||||
LOCAL_VENDOR_MODULE:=
|
||||
LOCAL_VTSC_FLAGS:=
|
||||
|
|
20
core/java.mk
20
core/java.mk
|
@ -15,6 +15,10 @@ endif
|
|||
endif # !PDK_JAVA
|
||||
endif #PDK
|
||||
|
||||
ifndef LOCAL_USE_R8
|
||||
LOCAL_USE_R8 := $(USE_R8)
|
||||
endif
|
||||
|
||||
LOCAL_NO_STANDARD_LIBRARIES:=$(strip $(LOCAL_NO_STANDARD_LIBRARIES))
|
||||
LOCAL_SDK_VERSION:=$(strip $(LOCAL_SDK_VERSION))
|
||||
|
||||
|
@ -698,9 +702,9 @@ endif # no obfuscation
|
|||
endif # LOCAL_INSTRUMENTATION_FOR
|
||||
|
||||
proguard_flag_files := $(addprefix $(LOCAL_PATH)/, $(LOCAL_PROGUARD_FLAG_FILES))
|
||||
ifeq ($(USE_R8),true)
|
||||
ifeq ($(LOCAL_USE_R8),true)
|
||||
proguard_flag_files += $(addprefix $(LOCAL_PATH)/, $(LOCAL_R8_FLAG_FILES))
|
||||
endif # USE_R8
|
||||
endif # LOCAL_USE_R8
|
||||
LOCAL_PROGUARD_FLAGS += $(addprefix -include , $(proguard_flag_files))
|
||||
|
||||
ifdef LOCAL_TEST_MODULE_TO_PROGUARD_WITH
|
||||
|
@ -710,7 +714,7 @@ extra_input_jar :=
|
|||
endif
|
||||
|
||||
ifneq ($(filter obfuscation,$(LOCAL_PROGUARD_ENABLED)),)
|
||||
ifneq ($(USE_R8),true)
|
||||
ifneq ($(LOCAL_USE_R8),true)
|
||||
$(full_classes_proguard_jar): .KATI_IMPLICIT_OUTPUTS := $(proguard_dictionary)
|
||||
else
|
||||
$(built_dex_intermediate): .KATI_IMPLICIT_OUTPUTS := $(proguard_dictionary)
|
||||
|
@ -718,17 +722,17 @@ endif
|
|||
endif
|
||||
|
||||
# If R8 is not enabled run Proguard.
|
||||
ifneq ($(USE_R8),true)
|
||||
ifneq ($(LOCAL_USE_R8),true)
|
||||
# Changes to these dependencies need to be replicated below when using R8
|
||||
# instead of Proguard + dx.
|
||||
$(full_classes_proguard_jar): PRIVATE_EXTRA_INPUT_JAR := $(extra_input_jar)
|
||||
$(full_classes_proguard_jar): PRIVATE_PROGUARD_FLAGS := $(legacy_proguard_flags) $(common_proguard_flags) $(LOCAL_PROGUARD_FLAGS)
|
||||
$(full_classes_proguard_jar) : $(full_classes_pre_proguard_jar) $(extra_input_jar) $(my_proguard_sdk_raise) $(common_proguard_flag_files) $(proguard_flag_files) $(legacy_proguard_lib_deps) | $(PROGUARD)
|
||||
$(call transform-jar-to-proguard)
|
||||
else # !USE_R8
|
||||
else # !LOCAL_USE_R8
|
||||
# Running R8 instead of Proguard, proguarded jar is actually the pre-Proguarded jar.
|
||||
full_classes_proguard_jar := $(full_classes_pre_proguard_jar)
|
||||
endif # !USE_R8
|
||||
endif # !LOCAL_USE_R8
|
||||
|
||||
else # LOCAL_PROGUARD_ENABLED not defined
|
||||
proguard_flag_files :=
|
||||
|
@ -740,7 +744,7 @@ $(built_dex_intermediate): PRIVATE_DX_FLAGS := $(LOCAL_DX_FLAGS)
|
|||
|
||||
my_r8 :=
|
||||
ifdef LOCAL_PROGUARD_ENABLED
|
||||
ifeq ($(USE_R8),true)
|
||||
ifeq ($(LOCAL_USE_R8),true)
|
||||
# These are the dependencies for the proguarded jar when running
|
||||
# Proguard + dx. They are used for the generated dex when using R8, as
|
||||
# R8 does Proguard + dx
|
||||
|
@ -749,7 +753,7 @@ $(built_dex_intermediate): PRIVATE_EXTRA_INPUT_JAR := $(extra_input_jar)
|
|||
$(built_dex_intermediate): PRIVATE_PROGUARD_FLAGS := $(legacy_proguard_flags) $(common_proguard_flags) $(LOCAL_PROGUARD_FLAGS)
|
||||
$(built_dex_intermediate) : $(full_classes_proguard_jar) $(extra_input_jar) $(my_support_library_sdk_raise) $(common_proguard_flag_files) $(proguard_flag_files) $(legacy_proguard_lib_deps) $(R8_COMPAT_PROGUARD)
|
||||
$(transform-jar-to-dex-r8)
|
||||
endif # USE_R8
|
||||
endif # LOCAL_USE_R8
|
||||
endif # LOCAL_PROGUARD_ENABLED
|
||||
|
||||
ifndef my_r8
|
||||
|
|
Loading…
Reference in New Issue