diff --git a/core/Makefile b/core/Makefile index f1e59478a..cf24ba05e 100644 --- a/core/Makefile +++ b/core/Makefile @@ -5325,6 +5325,22 @@ $(APPCOMPAT_ZIP): $(SOONG_ZIP) $(hide) find $(PRODUCT_OUT)/appcompat | sort >$(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 # more obvious where these files came from. diff --git a/core/dex_preopt_odex_install.mk b/core/dex_preopt_odex_install.mk index c6cc60d4e..a23bae2f7 100644 --- a/core/dex_preopt_odex_install.mk +++ b/core/dex_preopt_odex_install.mk @@ -399,6 +399,7 @@ ifdef LOCAL_DEX_PREOPT $(call json_end) 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_zip := $(intermediates)/dexpreopt.zip my_dexpreopt_config_merger := $(BUILD_SYSTEM)/dex_preopt_config_merger.py @@ -428,6 +429,8 @@ ifdef LOCAL_DEX_PREOPT -dexpreopt_script $@ \ -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 += $(if $(my_process_profile),$(LOCAL_DEX_PREOPT_PROFILE)) my_dexpreopt_deps += \ @@ -463,10 +466,12 @@ ifdef LOCAL_DEX_PREOPT $(LOCAL_INSTALLED_MODULE): PRIVATE_POST_INSTALL_CMD := $(LOCAL_POST_INSTALL_CMD) $(LOCAL_INSTALLED_MODULE): $(my_dexpreopt_zip) + $(LOCAL_INSTALLED_MODULE): $(my_dexpreopt_config_for_postprocessing) $(my_all_targets): $(my_dexpreopt_zip) my_dexpreopt_config := my_dexpreopt_script := my_dexpreopt_zip := + my_dexpreopt_config_for_postprocessing := endif # LOCAL_DEX_PREOPT diff --git a/core/main.mk b/core/main.mk index 05203bba6..c9fa14874 100644 --- a/core/main.mk +++ b/core/main.mk @@ -1708,6 +1708,7 @@ else ifeq (,$(TARGET_BUILD_UNBUNDLED)) $(PROGUARD_USAGE_ZIP) \ $(COVERAGE_ZIP) \ $(APPCOMPAT_ZIP) \ + $(DEXPREOPT_CONFIG_ZIP) \ $(INSTALLED_FILES_FILE) \ $(INSTALLED_FILES_JSON) \ $(INSTALLED_FILES_FILE_VENDOR) \ diff --git a/core/soong_app_prebuilt.mk b/core/soong_app_prebuilt.mk index ce7b14236..b7c21b862 100644 --- a/core/soong_app_prebuilt.mk +++ b/core/soong_app_prebuilt.mk @@ -13,6 +13,7 @@ # LOCAL_SOONG_JNI_LIBS_$(TARGET_ARCH) # LOCAL_SOONG_JNI_LIBS_$(TARGET_2ND_ARCH) # LOCAL_SOONG_JNI_LIBS_SYMBOLS +# LOCAL_SOONG_DEXPREOPT_CONFIG ifneq ($(LOCAL_MODULE_MAKEFILE),$(SOONG_ANDROID_MK)) $(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) 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. # We skip it for unbundled app builds where we cannot build veridex. module_run_appcompat := diff --git a/core/soong_java_prebuilt.mk b/core/soong_java_prebuilt.mk index 0922defb7..1ebbf14ec 100644 --- a/core/soong_java_prebuilt.mk +++ b/core/soong_java_prebuilt.mk @@ -161,6 +161,9 @@ endif # modules can find them. ifdef LOCAL_SOONG_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 ifdef LOCAL_SOONG_CLASSES_JAR