Revert "Filter JUnit and android.test classes from applications using proguard"
This reverts commit f22aca1e47a4cb7833afb42a90eee363a2258cb5.
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
diff --git a/core/definitions.mk b/core/definitions.mk
index a20bf44..9bba4f8 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -2800,15 +2800,13 @@
###########################################################
ifdef TARGET_OPENJDK9
define transform-jar-to-proguard
-@echo Skipping Proguard: $<$(PRIVATE_PROGUARD_INJAR_FILTERS) $@
+@echo Skipping Proguard: $< $@
$(hide) cp '$<' $@
endef
else
define transform-jar-to-proguard
@echo Proguard: $@
-$(hide) $(PROGUARD) -injars '$<$(PRIVATE_PROGUARD_INJAR_FILTERS)' \
- -outjars $@ \
- $(PRIVATE_PROGUARD_FLAGS) \
+$(hide) $(PROGUARD) -injars $< -outjars $@ $(PRIVATE_PROGUARD_FLAGS) \
$(addprefix -injars , $(PRIVATE_EXTRA_INPUT_JAR))
endef
endif
@@ -2819,7 +2817,7 @@
###########################################################
define transform-jar-to-dex-r8
@echo R8: $@
-$(hide) $(R8_COMPAT_PROGUARD) -injars '$<$(PRIVATE_PROGUARD_INJAR_FILTERS)' \
+$(hide) $(R8_COMPAT_PROGUARD) -injars '$<' \
--min-api $(PRIVATE_MIN_SDK_VERSION) \
--force-proguard-compatibility --output $(subst classes.dex,,$@) \
$(PRIVATE_PROGUARD_FLAGS) \
diff --git a/core/java.mk b/core/java.mk
index 6c2eee5..96f6f76 100644
--- a/core/java.mk
+++ b/core/java.mk
@@ -700,19 +700,6 @@
extra_input_jar :=
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 ($(USE_R8),true)
$(full_classes_proguard_jar): .KATI_IMPLICIT_OUTPUTS := $(proguard_dictionary)
@@ -725,7 +712,6 @@
ifneq ($(USE_R8),true)
# Changes to these dependencies need to be replicated below when using R8
# 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_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)
@@ -750,7 +736,6 @@
# Proguard + dx. They are used for the generated dex when using R8, as
# R8 does Proguard + dx
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_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)