Merge "Add mainline extension and METADATA.txt to boot.zip." am: 3d58caa11b

Original change: https://android-review.googlesource.com/c/platform/build/+/2619633

Change-Id: Id44f3ce4e9037360d3acc683195904acabfd4c83
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Jiakai Zhang
2023-06-12 09:52:41 +00:00
committed by Automerger Merge Worker
2 changed files with 29 additions and 10 deletions

View File

@@ -80,15 +80,40 @@ system_server_jars += \
$(foreach m,$(other_system_server_jars),\
$(PRODUCT_OUT)/$(call word-colon,1,$(m))/framework/$(call word-colon,2,$(m)).jar)
# Infix can be 'art' (ART image for testing), 'boot' (primary), or 'mainline' (mainline extension).
# Soong creates a set of variables for Make, one or each boot image. The only reason why the ART
# image is exposed to Make is testing (art gtests) and benchmarking (art golem benchmarks). Install
# rules that use those variables are in dex_preopt_libart.mk. Here for dexpreopt purposes the infix
# is always 'boot' or 'mainline'.
DEXPREOPT_INFIX := $(if $(filter true,$(DEX_PREOPT_WITH_UPDATABLE_BCP)),mainline,boot)
# The input variables are written by build/soong/java/dexpreopt_bootjars.go. Examples can be found
# at the bottom of build/soong/java/dexpreopt_config_testing.go.
dexpreopt_root_dir := $(dir $(patsubst %/,%,$(dir $(firstword $(bootclasspath_jars)))))
booclasspath_arg := $(subst $(space),:,$(patsubst $(dexpreopt_root_dir)%,%,$(DEXPREOPT_BOOTCLASSPATH_DEX_FILES)))
booclasspath_locations_arg := $(subst $(space),:,$(DEXPREOPT_BOOTCLASSPATH_DEX_LOCATIONS))
boot_images := $(subst :,$(space),$(DEXPREOPT_IMAGE_LOCATIONS_ON_DEVICE$(DEXPREOPT_INFIX)))
boot_image_arg := $(subst $(space),:,$(patsubst /%,%,$(boot_images)))
boot_zip_metadata_txt := $(boot_zip).METADATA.txt
$(boot_zip_metadata_txt):
rm -f $@
echo "booclasspath = $(booclasspath_arg)" >> $@
echo "booclasspath-locations = $(booclasspath_locations_arg)" >> $@
echo "boot-image = $(boot_image_arg)" >> $@
$(call dist-for-goals, droidcore, $(boot_zip_metadata_txt))
$(boot_zip): PRIVATE_BOOTCLASSPATH_JARS := $(bootclasspath_jars)
$(boot_zip): PRIVATE_SYSTEM_SERVER_JARS := $(system_server_jars)
$(boot_zip): $(bootclasspath_jars) $(system_server_jars) $(SOONG_ZIP) $(MERGE_ZIPS) $(DEXPREOPT_IMAGE_ZIP_boot) $(DEXPREOPT_IMAGE_ZIP_art)
$(boot_zip): $(bootclasspath_jars) $(system_server_jars) $(SOONG_ZIP) $(MERGE_ZIPS) $(DEXPREOPT_IMAGE_ZIP_boot) $(DEXPREOPT_IMAGE_ZIP_art) $(DEXPREOPT_IMAGE_ZIP_mainline) $(boot_zip_metadata_txt)
@echo "Create boot package: $@"
rm -f $@
$(SOONG_ZIP) -o $@.tmp \
-C $(dir $(firstword $(PRIVATE_BOOTCLASSPATH_JARS)))/.. $(addprefix -f ,$(PRIVATE_BOOTCLASSPATH_JARS)) \
-C $(PRODUCT_OUT) $(addprefix -f ,$(PRIVATE_SYSTEM_SERVER_JARS))
$(MERGE_ZIPS) $@ $@.tmp $(DEXPREOPT_IMAGE_ZIP_boot) $(DEXPREOPT_IMAGE_ZIP_art)
-C $(PRODUCT_OUT) $(addprefix -f ,$(PRIVATE_SYSTEM_SERVER_JARS)) \
-e METADATA.txt -f $(boot_zip_metadata_txt)
$(MERGE_ZIPS) $@ $@.tmp $(DEXPREOPT_IMAGE_ZIP_boot) $(DEXPREOPT_IMAGE_ZIP_art) $(DEXPREOPT_IMAGE_ZIP_mainline)
rm -f $@.tmp
$(call dist-for-goals, droidcore, $(boot_zip))

View File

@@ -274,13 +274,7 @@ my_dexpreopt_images :=
my_dexpreopt_images_deps :=
my_dexpreopt_image_locations_on_host :=
my_dexpreopt_image_locations_on_device :=
# Infix can be 'art', 'boot', or 'mainline'. Soong creates a set of variables
# for Make, one or each boot image (primary, the framework extension, and the
# mainline extension). The only reason why the primary image is exposed to Make
# is testing (art gtests) and benchmarking (art golem benchmarks). Install rules
# that use those variables are in dex_preopt_libart.mk. Here for dexpreopt
# purposes the infix is always 'boot' or 'mainline'.
my_dexpreopt_infix := $(if $(filter true,$(DEX_PREOPT_WITH_UPDATABLE_BCP)),mainline,boot)
my_dexpreopt_infix := $(DEXPREOPT_INFIX)
my_create_dexpreopt_config :=
ifdef LOCAL_DEX_PREOPT