From 2ce71aa0622d8b2caf7d9dc8274e7a29902b28aa Mon Sep 17 00:00:00 2001 From: Ying Wang Date: Fri, 11 Jan 2013 15:31:06 -0800 Subject: [PATCH] Add new LOCAL_PROGUARD_ENABLED option "nosystem" With which we don't include proguard flags defined by the build system. Bug: 7990659 Change-Id: I78384d2fbaccdd714d646e1b648417195bbd8dde --- core/clear_vars.mk | 2 +- core/java.mk | 19 +++++-------------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/core/clear_vars.mk b/core/clear_vars.mk index 91b5df6afc..e56180d2f1 100644 --- a/core/clear_vars.mk +++ b/core/clear_vars.mk @@ -100,7 +100,7 @@ LOCAL_SDK_VERSION:= LOCAL_SDK_RES_VERSION:= LOCAL_NDK_STL_VARIANT:= LOCAL_EMMA_INSTRUMENT:= -LOCAL_PROGUARD_ENABLED:= # '',optonly,full,custom,disabled +LOCAL_PROGUARD_ENABLED:= # '',full,custom,nosystem,disabled LOCAL_PROGUARD_FLAGS:= LOCAL_PROGUARD_FLAG_FILES:= LOCAL_EMMA_COVERAGE_FILTER:= diff --git a/core/java.mk b/core/java.mk index 86f06a322e..b0fc268c27 100644 --- a/core/java.mk +++ b/core/java.mk @@ -355,9 +355,10 @@ proguard_dictionary := $(intermediates.COMMON)/proguard_dictionary # Proguard doesn't like a class in both library and the jar to be processed. proguard_full_java_libs := $(filter-out $(full_static_java_libs),$(full_java_libs)) proguard_flags := $(addprefix -libraryjars ,$(proguard_full_java_libs)) \ - -include $(BUILD_SYSTEM)/proguard.flags \ -forceprocessing \ -printmapping $(proguard_dictionary) +ifneq ($(LOCAL_PROGUARD_ENABLED),nosystem) +proguard_flags += -include $(BUILD_SYSTEM)/proguard.flags ifeq ($(LOCAL_EMMA_INSTRUMENT),true) proguard_flags += -include $(BUILD_SYSTEM)/proguard.emma.flags endif @@ -365,23 +366,13 @@ endif ifneq ($(strip $(LOCAL_INSTRUMENTATION_FOR)$(filter tests,$(LOCAL_MODULE_TAGS))$(filter android.test.runner,$(LOCAL_JAVA_LIBRARIES))),) proguard_flags := $(proguard_flags) -include $(BUILD_SYSTEM)/proguard_tests.flags endif # test package +endif # LOCAL_PROGUARD_ENABLED is not nosystem ifneq ($(LOCAL_PROGUARD_ENABLED),) -ifeq ($(LOCAL_PROGUARD_ENABLED),full) - # full -else -ifeq ($(LOCAL_PROGUARD_ENABLED),optonly) - # optonly - proguard_flags += -dontobfuscate -else -ifeq ($(LOCAL_PROGUARD_ENABLED),custom) - # custom -else +ifeq ($(filter full custom nosystem, $(LOCAL_PROGUARD_ENABLED)),) $(warning while processing: $(LOCAL_MODULE)) $(error invalid value for LOCAL_PROGUARD_ENABLED: $(LOCAL_PROGUARD_ENABLED)) -endif # custom -endif # optonly -endif # full +endif # not a legal value endif # LOCAL_PROGUARD_ENABLED proguard_flag_files := $(addprefix $(LOCAL_PATH)/, $(LOCAL_PROGUARD_FLAG_FILES))