diff --git a/core/clear_vars.mk b/core/clear_vars.mk index 8863fe6b8..241926034 100644 --- a/core/clear_vars.mk +++ b/core/clear_vars.mk @@ -105,6 +105,7 @@ LOCAL_EMMA_INSTRUMENT:= LOCAL_PROGUARD_ENABLED:= # '',full,custom,nosystem,disabled,obfuscation,optimization LOCAL_PROGUARD_FLAGS:= LOCAL_PROGUARD_FLAG_FILES:= +LOCAL_TEST_MODULE_TO_PROGUARD_WITH:= LOCAL_EMMA_COVERAGE_FILTER:= LOCAL_WARNINGS_ENABLE:= LOCAL_FULL_MANIFEST_FILE:= diff --git a/core/definitions.mk b/core/definitions.mk index 7c29e307e..9774a689d 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -1929,7 +1929,8 @@ endif ########################################################### define transform-jar-to-proguard @echo Proguard: $@ -$(hide) $(PROGUARD) -injars $< -outjars $@ $(PRIVATE_PROGUARD_FLAGS) +$(hide) $(PROGUARD) -injars $< -outjars $@ $(PRIVATE_PROGUARD_FLAGS) \ + $(addprefix -injars , $(PRIVATE_EXTRA_INPUT_JAR)) endef ########################################################### diff --git a/core/java.mk b/core/java.mk index 95ec8f53c..8863ac22b 100644 --- a/core/java.mk +++ b/core/java.mk @@ -435,8 +435,14 @@ endif # LOCAL_PROGUARD_ENABLED is not nosystem proguard_flag_files := $(addprefix $(LOCAL_PATH)/, $(LOCAL_PROGUARD_FLAG_FILES)) LOCAL_PROGUARD_FLAGS += $(addprefix -include , $(proguard_flag_files)) +ifdef LOCAL_TEST_MODULE_TO_PROGUARD_WITH +extra_input_jar := $(call intermediates-dir-for,APPS,$(LOCAL_TEST_MODULE_TO_PROGUARD_WITH),,COMMON)/classes.jar +else +extra_input_jar := +endif +$(full_classes_proguard_jar): PRIVATE_EXTRA_INPUT_JAR := $(extra_input_jar) $(full_classes_proguard_jar): PRIVATE_PROGUARD_FLAGS := $(proguard_flags) $(LOCAL_PROGUARD_FLAGS) -$(full_classes_proguard_jar) : $(full_classes_jar) $(proguard_flag_files) | $(ACP) $(PROGUARD) +$(full_classes_proguard_jar) : $(full_classes_jar) $(extra_input_jar) $(proguard_flag_files) | $(ACP) $(PROGUARD) $(call transform-jar-to-proguard) else # LOCAL_PROGUARD_ENABLED not defined