Auto-generate dexpreopt boot image module
Add prebuilt modules that installs bootjar dexpreopt files generated by
soong, for example `dexpreopt_bootjar.boot_arm64` installs .art / .oat /
.vdex, etc for the framework boot image ("boot") for primary arch
("arm64").
Bug: 159196136
Test: TH built artifacts noop
Test: Check device boot images are installed
Test: ./prebuilts/build-tools/linux-x86/bin/ninja -f out/combined-aosp_arm64.ninja -t browse
Test: Check that generated dependency graph is sane
Test: Check that bootjar dexpreopt bits are listed in `m dump-files`
Change-Id: Ia30b37be9be972c5e28b5840923801ea7237a237
diff --git a/core/dex_preopt.mk b/core/dex_preopt.mk
index 20b4051..dd31999 100644
--- a/core/dex_preopt.mk
+++ b/core/dex_preopt.mk
@@ -21,32 +21,38 @@
my_boot_image_arch := TARGET_ARCH
my_boot_image_out := $(PRODUCT_OUT)
my_boot_image_syms := $(TARGET_OUT_UNSTRIPPED)
-my_boot_image_root := DEFAULT_DEX_PREOPT_INSTALLED_IMAGE
-DEFAULT_DEX_PREOPT_INSTALLED_IMAGE :=
-$(foreach my_boot_image_name,$(DEXPREOPT_IMAGE_NAMES),$(eval include $(BUILD_SYSTEM)/dex_preopt_libart.mk))
+DEFAULT_DEX_PREOPT_INSTALLED_IMAGE_MODULE := \
+ $(foreach my_boot_image_name,$(DEXPREOPT_IMAGE_NAMES),$(strip \
+ $(eval include $(BUILD_SYSTEM)/dex_preopt_libart.mk) \
+ $(my_boot_image_module)))
ifdef TARGET_2ND_ARCH
my_boot_image_arch := TARGET_2ND_ARCH
- my_boot_image_root := 2ND_DEFAULT_DEX_PREOPT_INSTALLED_IMAGE
- 2ND_DEFAULT_DEX_PREOPT_INSTALLED_IMAGE :=
- $(foreach my_boot_image_name,$(DEXPREOPT_IMAGE_NAMES),$(eval include $(BUILD_SYSTEM)/dex_preopt_libart.mk))
+ 2ND_DEFAULT_DEX_PREOPT_INSTALLED_IMAGE_MODULE := \
+ $(foreach my_boot_image_name,$(DEXPREOPT_IMAGE_NAMES),$(strip \
+ $(eval include $(BUILD_SYSTEM)/dex_preopt_libart.mk) \
+ $(my_boot_image_module)))
endif
# Install boot images for testing on host. We exclude framework image as it is not part of art manifest.
my_boot_image_arch := HOST_ARCH
my_boot_image_out := $(HOST_OUT)
my_boot_image_syms := $(HOST_OUT)/symbols
-my_boot_image_root := HOST_BOOT_IMAGE
-HOST_BOOT_IMAGE :=
-$(foreach my_boot_image_name,art_host,$(eval include $(BUILD_SYSTEM)/dex_preopt_libart.mk))
+HOST_BOOT_IMAGE_MODULE := \
+ $(foreach my_boot_image_name,art_host,$(strip \
+ $(eval include $(BUILD_SYSTEM)/dex_preopt_libart.mk) \
+ $(my_boot_image_module)))
+HOST_BOOT_IMAGE := $(call module-installed-files,$(HOST_BOOT_IMAGE_MODULE))
ifdef HOST_2ND_ARCH
my_boot_image_arch := HOST_2ND_ARCH
- my_boot_image_root := 2ND_HOST_BOOT_IMAGE
- 2ND_HOST_BOOT_IMAGE :=
- $(foreach my_boot_image_name,art_host,$(eval include $(BUILD_SYSTEM)/dex_preopt_libart.mk))
+ 2ND_HOST_BOOT_IMAGE_MODULE := \
+ $(foreach my_boot_image_name,art_host,$(strip \
+ $(eval include $(BUILD_SYSTEM)/dex_preopt_libart.mk) \
+ $(my_boot_image_module)))
+ 2ND_HOST_BOOT_IMAGE := $(call module-installed-files,$(2ND_HOST_BOOT_IMAGE_MODULE))
endif
my_boot_image_arch :=
my_boot_image_out :=
my_boot_image_syms :=
-my_boot_image_root :=
+my_boot_image_module :=
# Build the boot.zip which contains the boot jars and their compilation output
# We can do this only if preopt is enabled and if the product uses libart config (which sets the