Store dexpreopt.config files to dexpreopt_config.zip

To dexpreopt in post processing, store config files for dexpreopt

Bug: 158843648
Test: m dist and check dexpreopt_config.zip
Change-Id: I5c63a5ffc10023994b14e3a63f50defb9194739f
This commit is contained in:
Jeongik Cha 2021-04-07 23:57:16 +09:00
parent f92961248b
commit a8056d6cb9
5 changed files with 34 additions and 0 deletions

View File

@ -5246,6 +5246,22 @@ $(APPCOMPAT_ZIP): $(SOONG_ZIP)
$(hide) find $(PRODUCT_OUT)/appcompat | sort >$(PRIVATE_LIST_FILE) $(hide) find $(PRODUCT_OUT)/appcompat | sort >$(PRIVATE_LIST_FILE)
$(hide) $(SOONG_ZIP) -d -o $@ -C $(PRODUCT_OUT)/appcompat -l $(PRIVATE_LIST_FILE) $(hide) $(SOONG_ZIP) -d -o $@ -C $(PRODUCT_OUT)/appcompat -l $(PRIVATE_LIST_FILE)
DEXPREOPT_CONFIG_ZIP := $(PRODUCT_OUT)/dexpreopt_config.zip
$(DEXPREOPT_CONFIG_ZIP): $(FULL_SYSTEMIMAGE_DEPS) \
$(INTERNAL_RAMDISK_FILES) \
$(INTERNAL_USERDATAIMAGE_FILES) \
$(INTERNAL_VENDORIMAGE_FILES) \
$(INTERNAL_PRODUCTIMAGE_FILES) \
$(INTERNAL_SYSTEM_EXTIMAGE_FILES) \
$(DEX_PREOPT_CONFIG_FOR_MAKE) \
$(DEX_PREOPT_SOONG_CONFIG_FOR_MAKE)
$(DEXPREOPT_CONFIG_ZIP): $(SOONG_ZIP)
$(hide) mkdir -p $(dir $@) $(PRODUCT_OUT)/dexpreopt_config
$(hide) cp $(DEX_PREOPT_CONFIG_FOR_MAKE) $(PRODUCT_OUT)/dexpreopt_config
$(hide) cp $(DEX_PREOPT_SOONG_CONFIG_FOR_MAKE) $(PRODUCT_OUT)/dexpreopt_config
$(hide) $(SOONG_ZIP) -d -o $@ -C $(PRODUCT_OUT)/dexpreopt_config -D $(PRODUCT_OUT)/dexpreopt_config
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# A zip of the symbols directory. Keep the full paths to make it # A zip of the symbols directory. Keep the full paths to make it
# more obvious where these files came from. # more obvious where these files came from.

View File

@ -381,6 +381,7 @@ ifdef LOCAL_DEX_PREOPT
$(call json_end) $(call json_end)
my_dexpreopt_config := $(intermediates)/dexpreopt.config my_dexpreopt_config := $(intermediates)/dexpreopt.config
my_dexpreopt_config_for_postprocessing := $(PRODUCT_OUT)/dexpreopt_config/$(LOCAL_MODULE)_dexpreopt.config
my_dexpreopt_script := $(intermediates)/dexpreopt.sh my_dexpreopt_script := $(intermediates)/dexpreopt.sh
my_dexpreopt_zip := $(intermediates)/dexpreopt.zip my_dexpreopt_zip := $(intermediates)/dexpreopt.zip
my_dexpreopt_config_merger := $(BUILD_SYSTEM)/dex_preopt_config_merger.py my_dexpreopt_config_merger := $(BUILD_SYSTEM)/dex_preopt_config_merger.py
@ -410,6 +411,8 @@ ifdef LOCAL_DEX_PREOPT
-dexpreopt_script $@ \ -dexpreopt_script $@ \
-out_dir $(OUT_DIR) -out_dir $(OUT_DIR)
$(eval $(call copy-one-file,$(my_dexpreopt_config),$(my_dexpreopt_config_for_postprocessing)))
my_dexpreopt_deps := $(my_dex_jar) my_dexpreopt_deps := $(my_dex_jar)
my_dexpreopt_deps += $(if $(my_process_profile),$(LOCAL_DEX_PREOPT_PROFILE)) my_dexpreopt_deps += $(if $(my_process_profile),$(LOCAL_DEX_PREOPT_PROFILE))
my_dexpreopt_deps += \ my_dexpreopt_deps += \
@ -445,10 +448,12 @@ ifdef LOCAL_DEX_PREOPT
$(LOCAL_INSTALLED_MODULE): PRIVATE_POST_INSTALL_CMD := $(LOCAL_POST_INSTALL_CMD) $(LOCAL_INSTALLED_MODULE): PRIVATE_POST_INSTALL_CMD := $(LOCAL_POST_INSTALL_CMD)
$(LOCAL_INSTALLED_MODULE): $(my_dexpreopt_zip) $(LOCAL_INSTALLED_MODULE): $(my_dexpreopt_zip)
$(LOCAL_INSTALLED_MODULE): $(my_dexpreopt_config_for_postprocessing)
$(my_all_targets): $(my_dexpreopt_zip) $(my_all_targets): $(my_dexpreopt_zip)
my_dexpreopt_config := my_dexpreopt_config :=
my_dexpreopt_script := my_dexpreopt_script :=
my_dexpreopt_zip := my_dexpreopt_zip :=
my_dexpreopt_config_for_postprocessing :=
endif # LOCAL_DEX_PREOPT endif # LOCAL_DEX_PREOPT

View File

@ -1694,6 +1694,7 @@ else ifeq (,$(TARGET_BUILD_UNBUNDLED))
$(PROGUARD_USAGE_ZIP) \ $(PROGUARD_USAGE_ZIP) \
$(COVERAGE_ZIP) \ $(COVERAGE_ZIP) \
$(APPCOMPAT_ZIP) \ $(APPCOMPAT_ZIP) \
$(DEXPREOPT_CONFIG_ZIP) \
$(INSTALLED_FILES_FILE) \ $(INSTALLED_FILES_FILE) \
$(INSTALLED_FILES_JSON) \ $(INSTALLED_FILES_JSON) \
$(INSTALLED_FILES_FILE_VENDOR) \ $(INSTALLED_FILES_FILE_VENDOR) \

View File

@ -13,6 +13,7 @@
# LOCAL_SOONG_JNI_LIBS_$(TARGET_ARCH) # LOCAL_SOONG_JNI_LIBS_$(TARGET_ARCH)
# LOCAL_SOONG_JNI_LIBS_$(TARGET_2ND_ARCH) # LOCAL_SOONG_JNI_LIBS_$(TARGET_2ND_ARCH)
# LOCAL_SOONG_JNI_LIBS_SYMBOLS # LOCAL_SOONG_JNI_LIBS_SYMBOLS
# LOCAL_SOONG_DEXPREOPT_CONFIG
ifneq ($(LOCAL_MODULE_MAKEFILE),$(SOONG_ANDROID_MK)) ifneq ($(LOCAL_MODULE_MAKEFILE),$(SOONG_ANDROID_MK))
$(call pretty-error,soong_app_prebuilt.mk may only be used from Soong) $(call pretty-error,soong_app_prebuilt.mk may only be used from Soong)
@ -49,6 +50,14 @@ ifdef LOCAL_SOONG_CLASSES_JAR
.PHONY: javac-check-$(LOCAL_MODULE) .PHONY: javac-check-$(LOCAL_MODULE)
endif endif
ifdef LOCAL_SOONG_DEXPREOPT_CONFIG
my_dexpreopt_config := $(PRODUCT_OUT)/dexpreopt_config/$(LOCAL_MODULE)_dexpreopt.config
$(eval $(call copy-one-file,$(LOCAL_SOONG_DEXPREOPT_CONFIG), $(my_dexpreopt_config)))
$(LOCAL_BUILT_MODULE): $(my_dexpreopt_config)
endif
# Run veridex on product, system_ext and vendor modules. # Run veridex on product, system_ext and vendor modules.
# We skip it for unbundled app builds where we cannot build veridex. # We skip it for unbundled app builds where we cannot build veridex.
module_run_appcompat := module_run_appcompat :=

View File

@ -151,6 +151,9 @@ endif
# modules can find them. # modules can find them.
ifdef LOCAL_SOONG_DEXPREOPT_CONFIG ifdef LOCAL_SOONG_DEXPREOPT_CONFIG
$(eval $(call copy-one-file,$(LOCAL_SOONG_DEXPREOPT_CONFIG), $(call local-intermediates-dir,)/dexpreopt.config)) $(eval $(call copy-one-file,$(LOCAL_SOONG_DEXPREOPT_CONFIG), $(call local-intermediates-dir,)/dexpreopt.config))
my_dexpreopt_config := $(PRODUCT_OUT)/dexpreopt_config/$(LOCAL_MODULE)_dexpreopt.config
$(eval $(call copy-one-file,$(LOCAL_SOONG_DEXPREOPT_CONFIG), $(my_dexpreopt_config)))
$(LOCAL_BUILT_MODULE): $(my_dexpreopt_config)
endif endif
javac-check : $(full_classes_jar) javac-check : $(full_classes_jar)