summaryrefslogtreecommitdiffstats
path: root/core/package_internal.mk
diff options
context:
space:
mode:
authorYing Wang <wangying@google.com>2014-05-22 02:38:52 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-05-22 02:38:52 +0000
commit78ae0ad8df1773cda70a5d27b826408d60b25c7b (patch)
tree2d10afe0c91bd23f24eff8a03eb71087a574dc0b /core/package_internal.mk
parent70917bcebc5d0e14162e441d12ee8c8f928763df (diff)
parent913e031793928981640f51fa2e6480312f044c37 (diff)
downloadbuild-78ae0ad8df1773cda70a5d27b826408d60b25c7b.zip
build-78ae0ad8df1773cda70a5d27b826408d60b25c7b.tar.gz
build-78ae0ad8df1773cda70a5d27b826408d60b25c7b.tar.bz2
am 913e0317: am a72e6f80: am 8a3f514d: Merge "Split the rules to build the odex file"
* commit '913e031793928981640f51fa2e6480312f044c37': Split the rules to build the odex file
Diffstat (limited to 'core/package_internal.mk')
-rw-r--r--core/package_internal.mk19
1 files changed, 12 insertions, 7 deletions
diff --git a/core/package_internal.mk b/core/package_internal.mk
index d72933a..c8d9196 100644
--- a/core/package_internal.mk
+++ b/core/package_internal.mk
@@ -344,12 +344,6 @@ $(LOCAL_BUILT_MODULE): PRIVATE_ADDITIONAL_CERTIFICATES := $(foreach c,\
# Define the rule to build the actual package.
$(LOCAL_BUILT_MODULE): $(AAPT) | $(ZIPALIGN)
-ifdef LOCAL_DEX_PREOPT
-$(LOCAL_BUILT_MODULE): PRIVATE_BUILT_ODEX := $(built_odex)
-
-# built_odex is byproduct of LOCAL_BUILT_MODULE without its own build recipe.
-$(built_odex) : $(LOCAL_BUILT_MODULE)
-endif
$(LOCAL_BUILT_MODULE): PRIVATE_JNI_SHARED_LIBRARIES := $(jni_shared_libraries)
$(LOCAL_BUILT_MODULE): PRIVATE_JNI_SHARED_LIBRARIES_ABI := $(jni_shared_libraries_abi)
ifneq ($(TARGET_BUILD_APPS),)
@@ -379,7 +373,6 @@ ifneq ($(extra_jar_args),)
endif
$(sign-package)
ifdef LOCAL_DEX_PREOPT
- $(call dexpreopt-one-file,$@,$(PRIVATE_BUILT_ODEX))
ifneq (nostripping,$(LOCAL_DEX_PREOPT))
$(call dexpreopt-remove-classes.dex,$@)
endif
@@ -387,6 +380,18 @@ endif
@# Alignment must happen after all other zip operations.
$(align-package)
+###############################
+## Rule to build the odex file
+ifdef LOCAL_DEX_PREOPT
+$(built_odex): PRIVATE_DEX_FILE := $(built_dex)
+$(built_odex) : $(built_dex)
+ $(create-empty-package)
+ $(add-dex-to-package)
+ $(hide) mv $@ $@.input
+ $(call dexpreopt-one-file,$@.input,$@)
+ $(hide) rm $@.input
+endif
+
# Save information about this package
PACKAGES.$(LOCAL_PACKAGE_NAME).OVERRIDES := $(strip $(LOCAL_OVERRIDES_PACKAGES))
PACKAGES.$(LOCAL_PACKAGE_NAME).RESOURCE_FILES := $(all_resources)