Revert "Filter JUnit and android.test classes from applications using proguard"

This reverts commit f22aca1e47.

Switching to use -systemjars instead of -libraryjars means that it is no longer
necessary to filter out the junit and android.test classes from jars to which
Proguard is being applied.

Bug: 30188076
Bug: 69156675
Test: make checkbuild
Change-Id: I36e14d28e01517927b458d69ade8ccb2c79a3340
This commit is contained in:
Paul Duffin
2017-11-10 11:54:07 +00:00
parent 47970225d2
commit f492ebdbd1
2 changed files with 3 additions and 20 deletions

View File

@@ -2800,15 +2800,13 @@ endef
########################################################### ###########################################################
ifdef TARGET_OPENJDK9 ifdef TARGET_OPENJDK9
define transform-jar-to-proguard define transform-jar-to-proguard
@echo Skipping Proguard: $<$(PRIVATE_PROGUARD_INJAR_FILTERS) $@ @echo Skipping Proguard: $< $@
$(hide) cp '$<' $@ $(hide) cp '$<' $@
endef endef
else else
define transform-jar-to-proguard define transform-jar-to-proguard
@echo Proguard: $@ @echo Proguard: $@
$(hide) $(PROGUARD) -injars '$<$(PRIVATE_PROGUARD_INJAR_FILTERS)' \ $(hide) $(PROGUARD) -injars $< -outjars $@ $(PRIVATE_PROGUARD_FLAGS) \
-outjars $@ \
$(PRIVATE_PROGUARD_FLAGS) \
$(addprefix -injars , $(PRIVATE_EXTRA_INPUT_JAR)) $(addprefix -injars , $(PRIVATE_EXTRA_INPUT_JAR))
endef endef
endif endif
@@ -2819,7 +2817,7 @@ endif
########################################################### ###########################################################
define transform-jar-to-dex-r8 define transform-jar-to-dex-r8
@echo R8: $@ @echo R8: $@
$(hide) $(R8_COMPAT_PROGUARD) -injars '$<$(PRIVATE_PROGUARD_INJAR_FILTERS)' \ $(hide) $(R8_COMPAT_PROGUARD) -injars '$<' \
--min-api $(PRIVATE_MIN_SDK_VERSION) \ --min-api $(PRIVATE_MIN_SDK_VERSION) \
--force-proguard-compatibility --output $(subst classes.dex,,$@) \ --force-proguard-compatibility --output $(subst classes.dex,,$@) \
$(PRIVATE_PROGUARD_FLAGS) \ $(PRIVATE_PROGUARD_FLAGS) \

View File

@@ -700,19 +700,6 @@ else
extra_input_jar := extra_input_jar :=
endif endif
# If building against the current SDK version then filter out the junit,
# android.test and c.a.i.u.Predicate classes that are to be removed from
# the Android API as part of b/30188076 but which are still present in
# the Android API. This is to allow changes to be made to the build to
# statically include those classes into the application without
# simultaneously removing those classes from the API.
proguard_injar_filters :=
ifdef LOCAL_SDK_VERSION
ifeq (,$(filter-out current system_current test_current, $(LOCAL_SDK_VERSION)))
proguard_injar_filters := (!junit/framework/**,!junit/runner/**,!junit/textui/**)
endif
endif
ifneq ($(filter obfuscation,$(LOCAL_PROGUARD_ENABLED)),) ifneq ($(filter obfuscation,$(LOCAL_PROGUARD_ENABLED)),)
ifneq ($(USE_R8),true) ifneq ($(USE_R8),true)
$(full_classes_proguard_jar): .KATI_IMPLICIT_OUTPUTS := $(proguard_dictionary) $(full_classes_proguard_jar): .KATI_IMPLICIT_OUTPUTS := $(proguard_dictionary)
@@ -725,7 +712,6 @@ endif
ifneq ($(USE_R8),true) ifneq ($(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_EXTRA_INPUT_JAR := $(extra_input_jar) $(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)
@@ -750,7 +736,6 @@ ifeq ($(USE_R8),true)
# 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
my_r8 := true my_r8 := true
$(built_dex_intermediate): PRIVATE_PROGUARD_INJAR_FILTERS := $(proguard_injar_filters)
$(built_dex_intermediate): PRIVATE_EXTRA_INPUT_JAR := $(extra_input_jar) $(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)