Merge "Fix dependency when switching between build variants with and without Proguard." into gingerbread
This commit is contained in:
commit
d56d69b621
2 changed files with 43 additions and 21 deletions
|
@ -1395,7 +1395,12 @@ endef
|
||||||
|
|
||||||
#TODO: update the manifest to point to the dex file
|
#TODO: update the manifest to point to the dex file
|
||||||
define add-dex-to-package
|
define add-dex-to-package
|
||||||
$(hide) $(AAPT) add -k $@ $(PRIVATE_DEX_FILE)
|
$(if $(filter classes.dex,$(notdir $(PRIVATE_DEX_FILE))),\
|
||||||
|
$(hide) $(AAPT) add -k $@ $(PRIVATE_DEX_FILE),\
|
||||||
|
$(eval _adtp_classes.dex := $(dir $(PRIVATE_DEX_FILE))/classes.dex)\
|
||||||
|
$(hide) cp $(PRIVATE_DEX_FILE) $(_adtp_classes.dex) && \
|
||||||
|
$(AAPT) add -k $@ $(_adtp_classes.dex) && \
|
||||||
|
rm -f $(_adtp_classes.dex))
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define add-java-resources-to-package
|
define add-java-resources-to-package
|
||||||
|
|
57
core/java.mk
57
core/java.mk
|
@ -51,9 +51,6 @@ endif
|
||||||
intermediates := $(call local-intermediates-dir)
|
intermediates := $(call local-intermediates-dir)
|
||||||
intermediates.COMMON := $(call local-intermediates-dir,COMMON)
|
intermediates.COMMON := $(call local-intermediates-dir,COMMON)
|
||||||
|
|
||||||
# This is cleared below, and re-set if we really need it.
|
|
||||||
full_classes_jar := $(intermediates.COMMON)/classes.jar
|
|
||||||
|
|
||||||
# Emma source code coverage
|
# Emma source code coverage
|
||||||
ifneq ($(EMMA_INSTRUMENT),true)
|
ifneq ($(EMMA_INSTRUMENT),true)
|
||||||
LOCAL_NO_EMMA_INSTRUMENT := true
|
LOCAL_NO_EMMA_INSTRUMENT := true
|
||||||
|
@ -63,34 +60,54 @@ endif
|
||||||
# Choose leaf name for the compiled jar file.
|
# Choose leaf name for the compiled jar file.
|
||||||
ifneq ($(LOCAL_NO_EMMA_COMPILE),true)
|
ifneq ($(LOCAL_NO_EMMA_COMPILE),true)
|
||||||
full_classes_compiled_jar_leaf := classes-no-debug-var.jar
|
full_classes_compiled_jar_leaf := classes-no-debug-var.jar
|
||||||
built_dex_leaf := classes-no-local.dex
|
built_dex_intermediate_leaf := classes-no-local.dex
|
||||||
else
|
else
|
||||||
full_classes_compiled_jar_leaf := classes-full-debug.jar
|
full_classes_compiled_jar_leaf := classes-full-debug.jar
|
||||||
built_dex_leaf := classes-with-local.dex
|
built_dex_intermediate_leaf := classes-with-local.dex
|
||||||
endif
|
endif
|
||||||
full_classes_compiled_jar := $(intermediates.COMMON)/$(full_classes_compiled_jar_leaf)
|
|
||||||
built_dex_intermediate := $(intermediates.COMMON)/$(built_dex_leaf)
|
|
||||||
|
|
||||||
|
LOCAL_PROGUARD_ENABLED:=$(strip $(LOCAL_PROGUARD_ENABLED))
|
||||||
|
ifeq ($(LOCAL_PROGUARD_ENABLED),disabled)
|
||||||
|
LOCAL_PROGUARD_ENABLED :=
|
||||||
|
endif
|
||||||
|
|
||||||
|
# By giving different file name, files can be updated correctly when switching
|
||||||
|
# between builds with and without Proguard enabled.
|
||||||
|
ifdef LOCAL_PROGUARD_ENABLED
|
||||||
|
proguard_jar_leaf := proguard.classes.jar
|
||||||
|
built_dex_leaf := progaurd.classes.dex
|
||||||
|
else
|
||||||
|
proguard_jar_leaf := noproguard.classes.jar
|
||||||
|
built_dex_leaf := noproguard.classes.dex
|
||||||
|
endif
|
||||||
|
|
||||||
|
full_classes_compiled_jar := $(intermediates.COMMON)/$(full_classes_compiled_jar_leaf)
|
||||||
jarjar_leaf := classes-jarjar.jar
|
jarjar_leaf := classes-jarjar.jar
|
||||||
full_classes_jarjar_jar := $(intermediates.COMMON)/$(jarjar_leaf)
|
full_classes_jarjar_jar := $(intermediates.COMMON)/$(jarjar_leaf)
|
||||||
emma_intermediates_dir := $(intermediates.COMMON)/emma_out
|
emma_intermediates_dir := $(intermediates.COMMON)/emma_out
|
||||||
# emma is hardcoded to use the leaf name of its input for the output file --
|
# emma is hardcoded to use the leaf name of its input for the output file --
|
||||||
# only the output directory can be changed
|
# only the output directory can be changed
|
||||||
full_classes_emma_jar := $(emma_intermediates_dir)/lib/$(jarjar_leaf)
|
full_classes_emma_jar := $(emma_intermediates_dir)/lib/$(jarjar_leaf)
|
||||||
full_classes_stubs_jar := $(intermediates.COMMON)/stubs.jar
|
|
||||||
full_classes_full_names_jar := $(intermediates.COMMON)/classes-full-names.jar
|
full_classes_full_names_jar := $(intermediates.COMMON)/classes-full-names.jar
|
||||||
full_classes_proguard_jar := $(full_classes_jar)
|
full_classes_proguard_jar := $(intermediates.COMMON)/$(proguard_jar_leaf)
|
||||||
built_dex := $(intermediates.COMMON)/classes.dex
|
built_dex_intermediate := $(intermediates.COMMON)/$(built_dex_intermediate_leaf)
|
||||||
|
full_classes_stubs_jar := $(intermediates.COMMON)/stubs.jar
|
||||||
|
|
||||||
|
# full_classes_jar and built_dex are cleared below, and re-set if we really need them.
|
||||||
|
full_classes_jar := $(intermediates.COMMON)/classes.jar
|
||||||
|
built_dex := $(intermediates.COMMON)/$(built_dex_leaf)
|
||||||
|
|
||||||
LOCAL_INTERMEDIATE_TARGETS += \
|
LOCAL_INTERMEDIATE_TARGETS += \
|
||||||
$(full_classes_jar) \
|
|
||||||
$(full_classes_compiled_jar) \
|
$(full_classes_compiled_jar) \
|
||||||
|
$(full_classes_jarjar_jar) \
|
||||||
$(full_classes_emma_jar) \
|
$(full_classes_emma_jar) \
|
||||||
$(full_classes_full_names_jar) \
|
$(full_classes_full_names_jar) \
|
||||||
$(full_classes_stubs_jar) \
|
$(full_classes_proguard_jar) \
|
||||||
$(full_classes_jarjar_jar) \
|
$(full_classes_jar) \
|
||||||
|
$(built_dex_intermediate) \
|
||||||
$(built_dex) \
|
$(built_dex) \
|
||||||
$(built_dex_intermediate)
|
$(full_classes_stubs_jar)
|
||||||
|
|
||||||
|
|
||||||
LOCAL_INTERMEDIATE_SOURCE_DIR := $(intermediates.COMMON)/src
|
LOCAL_INTERMEDIATE_SOURCE_DIR := $(intermediates.COMMON)/src
|
||||||
|
|
||||||
|
@ -127,7 +144,7 @@ ifneq (,$(strip $(all_java_sources)))
|
||||||
# LOCAL_BUILT_MODULE, so it will inherit the necessary PRIVATE_*
|
# LOCAL_BUILT_MODULE, so it will inherit the necessary PRIVATE_*
|
||||||
# variable definitions.
|
# variable definitions.
|
||||||
full_classes_jar := $(intermediates.COMMON)/classes.jar
|
full_classes_jar := $(intermediates.COMMON)/classes.jar
|
||||||
built_dex := $(intermediates.COMMON)/classes.dex
|
built_dex := $(intermediates.COMMON)/$(built_dex_leaf)
|
||||||
|
|
||||||
# Droiddoc isn't currently able to generate stubs for modules, so we're just
|
# Droiddoc isn't currently able to generate stubs for modules, so we're just
|
||||||
# allowing it to use the classes.jar as the "stubs" that would be use to link
|
# allowing it to use the classes.jar as the "stubs" that would be use to link
|
||||||
|
@ -148,7 +165,7 @@ ALL_MODULES.$(LOCAL_MODULE).STUBS := $(full_classes_stubs_jar)
|
||||||
# Deps for generated source files must be handled separately,
|
# Deps for generated source files must be handled separately,
|
||||||
# via deps on the target that generates the sources.
|
# via deps on the target that generates the sources.
|
||||||
$(full_classes_compiled_jar): PRIVATE_JAVACFLAGS := $(LOCAL_JAVACFLAGS)
|
$(full_classes_compiled_jar): PRIVATE_JAVACFLAGS := $(LOCAL_JAVACFLAGS)
|
||||||
$(full_classes_compiled_jar): $(java_sources) $(full_java_lib_deps)
|
$(full_classes_compiled_jar): $(java_sources) $(java_resource_sources) $(full_java_lib_deps) $(jar_manifest_file)
|
||||||
$(transform-java-to-classes.jar)
|
$(transform-java-to-classes.jar)
|
||||||
|
|
||||||
# All of the rules after full_classes_compiled_jar are very unlikely
|
# All of the rules after full_classes_compiled_jar are very unlikely
|
||||||
|
@ -225,10 +242,6 @@ ifneq ($(strip $(LOCAL_INSTRUMENTATION_FOR)$(filter tests,$(LOCAL_MODULE_TAGS))$
|
||||||
proguard_flags := $(proguard_flags) -include $(BUILD_SYSTEM)/proguard_tests.flags
|
proguard_flags := $(proguard_flags) -include $(BUILD_SYSTEM)/proguard_tests.flags
|
||||||
endif # test package
|
endif # test package
|
||||||
|
|
||||||
LOCAL_PROGUARD_ENABLED:=$(strip $(LOCAL_PROGUARD_ENABLED))
|
|
||||||
ifeq ($(LOCAL_PROGUARD_ENABLED),disabled)
|
|
||||||
LOCAL_PROGUARD_ENABLED :=
|
|
||||||
endif
|
|
||||||
ifneq ($(LOCAL_PROGUARD_ENABLED),)
|
ifneq ($(LOCAL_PROGUARD_ENABLED),)
|
||||||
ifeq ($(LOCAL_PROGUARD_ENABLED),full)
|
ifeq ($(LOCAL_PROGUARD_ENABLED),full)
|
||||||
# full
|
# full
|
||||||
|
@ -256,6 +269,10 @@ $(full_classes_proguard_jar): $(full_classes_full_names_jar) | $(ACP) $(PROGUARD
|
||||||
|
|
||||||
ALL_MODULES.$(LOCAL_MODULE).PROGUARD_ENABLED:=$(LOCAL_PROGUARD_ENABLED)
|
ALL_MODULES.$(LOCAL_MODULE).PROGUARD_ENABLED:=$(LOCAL_PROGUARD_ENABLED)
|
||||||
|
|
||||||
|
$(full_classes_jar) : $(full_classes_proguard_jar)
|
||||||
|
@echo Copying: $@
|
||||||
|
$(hide) $(ACP) $< $@
|
||||||
|
|
||||||
# If you instrument class files that have local variable debug information in
|
# If you instrument class files that have local variable debug information in
|
||||||
# them emma does not correctly maintain the local variable table.
|
# them emma does not correctly maintain the local variable table.
|
||||||
# This will cause an error when you try to convert the class files for Android.
|
# This will cause an error when you try to convert the class files for Android.
|
||||||
|
|
Loading…
Reference in a new issue