am a72e6f80: am 8a3f514d: Merge "Split the rules to build the odex file"
* commit 'a72e6f80e447acf225822eebdf752c0d8aa2590c': Split the rules to build the odex file
This commit is contained in:
commit
913e031793
|
@ -1679,10 +1679,10 @@ endef
|
||||||
# so we need to give it something.
|
# so we need to give it something.
|
||||||
define create-empty-package
|
define create-empty-package
|
||||||
@mkdir -p $(dir $@)
|
@mkdir -p $(dir $@)
|
||||||
$(hide) touch $(dir $@)/dummy
|
$(hide) touch $(dir $@)dummy
|
||||||
$(hide) (cd $(dir $@) && jar cf $(notdir $@) dummy)
|
$(hide) (cd $(dir $@) && jar cf $(notdir $@) dummy)
|
||||||
$(hide) zip -qd $@ dummy
|
$(hide) zip -qd $@ dummy
|
||||||
$(hide) rm $(dir $@)/dummy
|
$(hide) rm $(dir $@)dummy
|
||||||
endef
|
endef
|
||||||
|
|
||||||
#TODO: we kinda want to build different asset packages for
|
#TODO: we kinda want to build different asset packages for
|
||||||
|
|
|
@ -103,11 +103,10 @@ else
|
||||||
my_dex_preopt_image_location := $($(LOCAL_2ND_ARCH_VAR_PREFIX)DEFAULT_DEX_PREOPT_BUILT_IMAGE_LOCATION)
|
my_dex_preopt_image_location := $($(LOCAL_2ND_ARCH_VAR_PREFIX)DEFAULT_DEX_PREOPT_BUILT_IMAGE_LOCATION)
|
||||||
endif
|
endif
|
||||||
my_dex_preopt_image_filename := $(call get-image-file-path,$($(LOCAL_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_ARCH),$(my_dex_preopt_image_location))
|
my_dex_preopt_image_filename := $(call get-image-file-path,$($(LOCAL_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_ARCH),$(my_dex_preopt_image_location))
|
||||||
# $(built_odex) is byproduct of $(LOCAL_BUILT_MODULE)
|
$(built_odex): PRIVATE_2ND_ARCH_VAR_PREFIX := $(LOCAL_2ND_ARCH_VAR_PREFIX)
|
||||||
$(LOCAL_BUILT_MODULE) $(built_odex): PRIVATE_2ND_ARCH_VAR_PREFIX := $(LOCAL_2ND_ARCH_VAR_PREFIX)
|
$(built_odex): PRIVATE_DEX_LOCATION := $(patsubst $(PRODUCT_OUT)%,%,$(LOCAL_INSTALLED_MODULE))
|
||||||
$(LOCAL_BUILT_MODULE) $(built_odex): PRIVATE_DEX_LOCATION := $(patsubst $(PRODUCT_OUT)%,%,$(LOCAL_INSTALLED_MODULE))
|
$(built_odex): PRIVATE_DEX_PREOPT_IMAGE_LOCATION := $(my_dex_preopt_image_location)
|
||||||
$(LOCAL_BUILT_MODULE) $(built_odex): PRIVATE_DEX_PREOPT_IMAGE_LOCATION := $(my_dex_preopt_image_location)
|
$(built_odex) : $($(LOCAL_2ND_ARCH_VAR_PREFIX)DEXPREOPT_ONE_FILE_DEPENDENCY_BUILT_BOOT_PREOPT) \
|
||||||
$(LOCAL_BUILT_MODULE) $(built_odex) : $($(LOCAL_2ND_ARCH_VAR_PREFIX)DEXPREOPT_ONE_FILE_DEPENDENCY_BUILT_BOOT_PREOPT) \
|
|
||||||
$(DEXPREOPT_ONE_FILE_DEPENDENCY_TOOLS) \
|
$(DEXPREOPT_ONE_FILE_DEPENDENCY_TOOLS) \
|
||||||
$(my_dex_preopt_image_filename)
|
$(my_dex_preopt_image_filename)
|
||||||
installed_odex := $(call get-odex-file-path,$($(LOCAL_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_ARCH),$(LOCAL_INSTALLED_MODULE))
|
installed_odex := $(call get-odex-file-path,$($(LOCAL_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_ARCH),$(LOCAL_INSTALLED_MODULE))
|
||||||
|
@ -116,13 +115,11 @@ endif # libart
|
||||||
endif # boot jar
|
endif # boot jar
|
||||||
|
|
||||||
ifdef built_odex
|
ifdef built_odex
|
||||||
# We need $(LOCAL_BUILT_MODULE) in the deps to enforce reinstallation
|
|
||||||
# even if $(built_odex) is byproduct of $(LOCAL_BUILT_MODULE), such as in package.mk.
|
|
||||||
# Use pattern rule - we may have multiple installed odex files.
|
# Use pattern rule - we may have multiple installed odex files.
|
||||||
# Ugly syntax - See the definition get-odex-file-path.
|
# Ugly syntax - See the definition get-odex-file-path.
|
||||||
$(installed_odex) : $(dir $(LOCAL_INSTALLED_MODULE))%/$(notdir $(word 1,$(installed_odex))) \
|
$(installed_odex) : $(dir $(LOCAL_INSTALLED_MODULE))%/$(notdir $(word 1,$(installed_odex))) \
|
||||||
: $(dir $(LOCAL_BUILT_MODULE))%/$(notdir $(word 1,$(built_odex))) \
|
: $(dir $(LOCAL_BUILT_MODULE))%/$(notdir $(word 1,$(built_odex))) \
|
||||||
$(LOCAL_BUILT_MODULE) | $(ACP)
|
| $(ACP)
|
||||||
@echo "Install: $@"
|
@echo "Install: $@"
|
||||||
$(copy-file-to-target)
|
$(copy-file-to-target)
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -333,12 +333,6 @@ $(LOCAL_BUILT_MODULE): PRIVATE_ADDITIONAL_CERTIFICATES := $(foreach c,\
|
||||||
|
|
||||||
# Define the rule to build the actual package.
|
# Define the rule to build the actual package.
|
||||||
$(LOCAL_BUILT_MODULE): $(AAPT) | $(ZIPALIGN)
|
$(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 := $(jni_shared_libraries)
|
||||||
$(LOCAL_BUILT_MODULE): PRIVATE_JNI_SHARED_LIBRARIES_ABI := $(jni_shared_libraries_abi)
|
$(LOCAL_BUILT_MODULE): PRIVATE_JNI_SHARED_LIBRARIES_ABI := $(jni_shared_libraries_abi)
|
||||||
ifneq ($(TARGET_BUILD_APPS),)
|
ifneq ($(TARGET_BUILD_APPS),)
|
||||||
|
@ -368,7 +362,6 @@ ifneq ($(extra_jar_args),)
|
||||||
endif
|
endif
|
||||||
$(sign-package)
|
$(sign-package)
|
||||||
ifdef LOCAL_DEX_PREOPT
|
ifdef LOCAL_DEX_PREOPT
|
||||||
$(call dexpreopt-one-file,$@,$(PRIVATE_BUILT_ODEX))
|
|
||||||
ifneq (nostripping,$(LOCAL_DEX_PREOPT))
|
ifneq (nostripping,$(LOCAL_DEX_PREOPT))
|
||||||
$(call dexpreopt-remove-classes.dex,$@)
|
$(call dexpreopt-remove-classes.dex,$@)
|
||||||
endif
|
endif
|
||||||
|
@ -376,6 +369,18 @@ endif
|
||||||
@# Alignment must happen after all other zip operations.
|
@# Alignment must happen after all other zip operations.
|
||||||
$(align-package)
|
$(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
|
# Save information about this package
|
||||||
PACKAGES.$(LOCAL_PACKAGE_NAME).OVERRIDES := $(strip $(LOCAL_OVERRIDES_PACKAGES))
|
PACKAGES.$(LOCAL_PACKAGE_NAME).OVERRIDES := $(strip $(LOCAL_OVERRIDES_PACKAGES))
|
||||||
PACKAGES.$(LOCAL_PACKAGE_NAME).RESOURCE_FILES := $(all_resources)
|
PACKAGES.$(LOCAL_PACKAGE_NAME).RESOURCE_FILES := $(all_resources)
|
||||||
|
|
|
@ -162,11 +162,6 @@ LOCAL_DEX_PREOPT := false
|
||||||
# defines built_odex along with rule to install odex
|
# defines built_odex along with rule to install odex
|
||||||
include $(BUILD_SYSTEM)/dex_preopt_odex_install.mk
|
include $(BUILD_SYSTEM)/dex_preopt_odex_install.mk
|
||||||
#######################################
|
#######################################
|
||||||
ifdef LOCAL_DEX_PREOPT
|
|
||||||
$(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_DEX_PREOPT
|
|
||||||
# Sign and align non-presigned .apks.
|
# Sign and align non-presigned .apks.
|
||||||
$(built_module) : $(my_prebuilt_src_file) | $(ACP) $(ZIPALIGN) $(SIGNAPK_JAR)
|
$(built_module) : $(my_prebuilt_src_file) | $(ACP) $(ZIPALIGN) $(SIGNAPK_JAR)
|
||||||
$(transform-prebuilt-to-target)
|
$(transform-prebuilt-to-target)
|
||||||
|
@ -177,10 +172,19 @@ ifneq ($(LOCAL_CERTIFICATE),PRESIGNED)
|
||||||
$(sign-package)
|
$(sign-package)
|
||||||
endif
|
endif
|
||||||
ifdef LOCAL_DEX_PREOPT
|
ifdef LOCAL_DEX_PREOPT
|
||||||
$(call dexpreopt-one-file,$@,$(PRIVATE_BUILT_ODEX))
|
ifneq (nostripping,$(LOCAL_DEX_PREOPT))
|
||||||
|
$(call dexpreopt-remove-classes.dex,$@)
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
$(align-package)
|
$(align-package)
|
||||||
|
|
||||||
|
###############################
|
||||||
|
## Rule to build the odex file
|
||||||
|
ifdef LOCAL_DEX_PREOPT
|
||||||
|
$(built_odex) : $(my_prebuilt_src_file)
|
||||||
|
$(call dexpreopt-one-file,$<,$@)
|
||||||
|
endif
|
||||||
|
|
||||||
else # LOCAL_MODULE_CLASS != APPS
|
else # LOCAL_MODULE_CLASS != APPS
|
||||||
ifneq ($(LOCAL_PREBUILT_STRIP_COMMENTS),)
|
ifneq ($(LOCAL_PREBUILT_STRIP_COMMENTS),)
|
||||||
$(built_module) : $(my_prebuilt_src_file)
|
$(built_module) : $(my_prebuilt_src_file)
|
||||||
|
|
Loading…
Reference in New Issue