summaryrefslogtreecommitdiffstats
path: root/core/base_rules.mk
diff options
context:
space:
mode:
authorYing Wang <wangying@google.com>2013-08-21 18:32:49 -0700
committerYing Wang <wangying@google.com>2013-08-22 17:12:38 -0700
commit7311a344bed507062e781ba70331d85652c217d8 (patch)
tree1712442faa0cc5ea167485d3620ac94a488074b5 /core/base_rules.mk
parentf4723fa49b6e61f727b6321a4006ee8ba3f393b9 (diff)
downloadbuild-7311a344bed507062e781ba70331d85652c217d8.zip
build-7311a344bed507062e781ba70331d85652c217d8.tar.gz
build-7311a344bed507062e781ba70331d85652c217d8.tar.bz2
Make it easier to enable obfuscation and optimization.
With this change, use: * LOCAL_PROGUARD_ENABLED := obfuscation # to enable obfuscation * LOCAL_PROGUARD_ENABLED := optimization # to enable optimization * LOCAL_PROGUARD_ENABLED := obfuscation optimization # to enable both Now the meaning of the LOCAL_PROGUARD_ENABLED options: * full: Use the build system's default configurations: with shrink but no obfuscation or optimization, global proguard flags in build/core/proguard.flags are applied. * custom: The same as "full" except no aapt-generated resource-related proguard flags. * nosystem: Don't use any build system's default configurations; but aapt-generated proguard flags are still applied. You are responsible for any other flags. * disabled: Disable proguard. * obfuscation: The same as "full" but with obfuscation enabled. * optimization: The same as "full" but with optimization enabled. * no value (the default): The build system chooses the proper value: "full" if it's an app; "disabled" if it's a library. You can use more than 1 of them in a meaningful combination, for example: LOCAL_PROGUARD_ENABLED := obfuscation optimization Bug: 10307372 Change-Id: Id248caca3048e99547f16559fae74f4afe85c354
Diffstat (limited to 'core/base_rules.mk')
-rw-r--r--core/base_rules.mk21
1 files changed, 10 insertions, 11 deletions
diff --git a/core/base_rules.mk b/core/base_rules.mk
index 188c352..773c294 100644
--- a/core/base_rules.mk
+++ b/core/base_rules.mk
@@ -387,19 +387,20 @@ ifdef LOCAL_IS_HOST_MODULE
ifeq ($(LOCAL_BUILD_HOST_DEX),true)
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_BOOTCLASSPATH := -bootclasspath $(call java-lib-files,core-hostdex,$(LOCAL_IS_HOST_MODULE))
-full_java_libs := $(call java-lib-files,$(LOCAL_JAVA_LIBRARIES),$(LOCAL_IS_HOST_MODULE))
+full_shared_java_libs := $(call java-lib-files,$(LOCAL_JAVA_LIBRARIES),$(LOCAL_IS_HOST_MODULE))
full_java_lib_deps := $(call java-lib-deps,$(LOCAL_JAVA_LIBRARIES),$(LOCAL_IS_HOST_MODULE))
else
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_BOOTCLASSPATH :=
-full_java_libs := $(addprefix $(HOST_OUT_JAVA_LIBRARIES)/,$(addsuffix $(COMMON_JAVA_PACKAGE_SUFFIX),$(LOCAL_JAVA_LIBRARIES)))
-full_java_lib_deps := $(full_java_libs)
+full_shared_java_libs := $(addprefix $(HOST_OUT_JAVA_LIBRARIES)/,\
+ $(addsuffix $(COMMON_JAVA_PACKAGE_SUFFIX),$(LOCAL_JAVA_LIBRARIES)))
+full_java_lib_deps := $(full_shared_java_libs)
endif # LOCAL_BUILD_HOST_DEX
else
-full_java_libs := $(call java-lib-files,$(LOCAL_JAVA_LIBRARIES),$(LOCAL_IS_HOST_MODULE))
+full_shared_java_libs := $(call java-lib-files,$(LOCAL_JAVA_LIBRARIES),$(LOCAL_IS_HOST_MODULE))
full_java_lib_deps := $(call java-lib-deps,$(LOCAL_JAVA_LIBRARIES),$(LOCAL_IS_HOST_MODULE))
endif # !LOCAL_IS_HOST_MODULE
-full_java_libs += $(full_static_java_libs) $(LOCAL_CLASSPATH)
+full_java_libs := $(full_shared_java_libs) $(full_static_java_libs) $(LOCAL_CLASSPATH)
full_java_lib_deps += $(full_static_java_libs) $(LOCAL_CLASSPATH)
# This is set by packages that are linking to other packages that export
@@ -426,14 +427,12 @@ ifdef LOCAL_INSTRUMENTATION_FOR
$(LOCAL_PATH): Multiple LOCAL_INSTRUMENTATION_FOR members defined)
endif
- link_instr_intermediates_dir := $(call intermediates-dir-for, \
- APPS,$(LOCAL_INSTRUMENTATION_FOR))
link_instr_intermediates_dir.COMMON := $(call intermediates-dir-for, \
APPS,$(LOCAL_INSTRUMENTATION_FOR),,COMMON)
-
# link against the jar with full original names (before proguard processing).
- full_java_libs += $(link_instr_intermediates_dir.COMMON)/classes.jar
- full_java_lib_deps += $(link_instr_intermediates_dir.COMMON)/classes.jar
+ link_instr_classes_jar := $(link_instr_intermediates_dir.COMMON)/classes.jar
+ full_java_libs += $(link_instr_classes_jar)
+ full_java_lib_deps += $(link_instr_classes_jar)
endif
jar_manifest_file :=
@@ -444,7 +443,7 @@ else
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JAR_MANIFEST :=
endif
-endif
+endif # PRIVATE java vars
###########################################################