Merge "Allow locally disabling R8"
am: 017a894c6e
Change-Id: I8eb9e5ffaf1ca0a5de56ad92acc27490cf76c984
This commit is contained in:
@@ -264,6 +264,7 @@ LOCAL_TIDY_FLAGS:=
|
|||||||
LOCAL_UNINSTALLABLE_MODULE:=
|
LOCAL_UNINSTALLABLE_MODULE:=
|
||||||
LOCAL_UNSTRIPPED_PATH:=
|
LOCAL_UNSTRIPPED_PATH:=
|
||||||
LOCAL_USE_AAPT2:=$(USE_AAPT2)
|
LOCAL_USE_AAPT2:=$(USE_AAPT2)
|
||||||
|
LOCAL_USE_R8:=
|
||||||
LOCAL_USE_VNDK:=
|
LOCAL_USE_VNDK:=
|
||||||
LOCAL_VENDOR_MODULE:=
|
LOCAL_VENDOR_MODULE:=
|
||||||
LOCAL_VTSC_FLAGS:=
|
LOCAL_VTSC_FLAGS:=
|
||||||
|
20
core/java.mk
20
core/java.mk
@@ -15,6 +15,10 @@ endif
|
|||||||
endif # !PDK_JAVA
|
endif # !PDK_JAVA
|
||||||
endif #PDK
|
endif #PDK
|
||||||
|
|
||||||
|
ifndef LOCAL_USE_R8
|
||||||
|
LOCAL_USE_R8 := $(USE_R8)
|
||||||
|
endif
|
||||||
|
|
||||||
LOCAL_NO_STANDARD_LIBRARIES:=$(strip $(LOCAL_NO_STANDARD_LIBRARIES))
|
LOCAL_NO_STANDARD_LIBRARIES:=$(strip $(LOCAL_NO_STANDARD_LIBRARIES))
|
||||||
LOCAL_SDK_VERSION:=$(strip $(LOCAL_SDK_VERSION))
|
LOCAL_SDK_VERSION:=$(strip $(LOCAL_SDK_VERSION))
|
||||||
|
|
||||||
@@ -687,9 +691,9 @@ endif # no obfuscation
|
|||||||
endif # LOCAL_INSTRUMENTATION_FOR
|
endif # LOCAL_INSTRUMENTATION_FOR
|
||||||
|
|
||||||
proguard_flag_files := $(addprefix $(LOCAL_PATH)/, $(LOCAL_PROGUARD_FLAG_FILES))
|
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))
|
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))
|
LOCAL_PROGUARD_FLAGS += $(addprefix -include , $(proguard_flag_files))
|
||||||
|
|
||||||
ifdef LOCAL_TEST_MODULE_TO_PROGUARD_WITH
|
ifdef LOCAL_TEST_MODULE_TO_PROGUARD_WITH
|
||||||
@@ -712,7 +716,7 @@ endif
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(filter obfuscation,$(LOCAL_PROGUARD_ENABLED)),)
|
ifneq ($(filter obfuscation,$(LOCAL_PROGUARD_ENABLED)),)
|
||||||
ifneq ($(USE_R8),true)
|
ifneq ($(LOCAL_USE_R8),true)
|
||||||
$(full_classes_proguard_jar): .KATI_IMPLICIT_OUTPUTS := $(proguard_dictionary)
|
$(full_classes_proguard_jar): .KATI_IMPLICIT_OUTPUTS := $(proguard_dictionary)
|
||||||
else
|
else
|
||||||
$(built_dex_intermediate): .KATI_IMPLICIT_OUTPUTS := $(proguard_dictionary)
|
$(built_dex_intermediate): .KATI_IMPLICIT_OUTPUTS := $(proguard_dictionary)
|
||||||
@@ -720,7 +724,7 @@ endif
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
# If R8 is not enabled run Proguard.
|
# 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
|
# Changes to these dependencies need to be replicated below when using R8
|
||||||
# instead of Proguard + dx.
|
# instead of Proguard + dx.
|
||||||
$(full_classes_proguard_jar): PRIVATE_PROGUARD_INJAR_FILTERS := $(proguard_injar_filters)
|
$(full_classes_proguard_jar): PRIVATE_PROGUARD_INJAR_FILTERS := $(proguard_injar_filters)
|
||||||
@@ -728,10 +732,10 @@ $(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): 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)
|
$(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)
|
$(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.
|
# Running R8 instead of Proguard, proguarded jar is actually the pre-Proguarded jar.
|
||||||
full_classes_proguard_jar := $(full_classes_pre_proguard_jar)
|
full_classes_proguard_jar := $(full_classes_pre_proguard_jar)
|
||||||
endif # !USE_R8
|
endif # !LOCAL_USE_R8
|
||||||
|
|
||||||
else # LOCAL_PROGUARD_ENABLED not defined
|
else # LOCAL_PROGUARD_ENABLED not defined
|
||||||
proguard_flag_files :=
|
proguard_flag_files :=
|
||||||
@@ -743,7 +747,7 @@ $(built_dex_intermediate): PRIVATE_DX_FLAGS := $(LOCAL_DX_FLAGS)
|
|||||||
|
|
||||||
my_r8 :=
|
my_r8 :=
|
||||||
ifdef LOCAL_PROGUARD_ENABLED
|
ifdef LOCAL_PROGUARD_ENABLED
|
||||||
ifeq ($(USE_R8),true)
|
ifeq ($(LOCAL_USE_R8),true)
|
||||||
# These are the dependencies for the proguarded jar when running
|
# These are the dependencies for the proguarded jar when running
|
||||||
# Proguard + dx. They are used for the generated dex when using R8, as
|
# Proguard + dx. They are used for the generated dex when using R8, as
|
||||||
# R8 does Proguard + dx
|
# R8 does Proguard + dx
|
||||||
@@ -753,7 +757,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): 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)
|
$(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)
|
$(transform-jar-to-dex-r8)
|
||||||
endif # USE_R8
|
endif # LOCAL_USE_R8
|
||||||
endif # LOCAL_PROGUARD_ENABLED
|
endif # LOCAL_PROGUARD_ENABLED
|
||||||
|
|
||||||
ifndef my_r8
|
ifndef my_r8
|
||||||
|
Reference in New Issue
Block a user