diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2023-06-13 14:28:56 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2023-06-13 14:28:56 +0000 |
commit | d833e73b8b8a700c82dc1449597013ed774a88c4 (patch) | |
tree | ef419bc66072e3990dd730aacf19dabe2b557688 | |
parent | 91183a7c54a7818f952fa07cca97317807986174 (diff) | |
parent | c63a2b36d74dadb51a9cdcc71ad470111ebe3f02 (diff) | |
download | build-d833e73b8b8a700c82dc1449597013ed774a88c4.tar.gz |
Merge changes from topic "cherrypicker-L60200000961213913:N41200001377797274" into udc-dev
* changes:
Avoid using soong_zip's "-e" flag for boot.zip.
Add mainline extension and METADATA.txt to boot.zip.
-rw-r--r-- | core/dex_preopt.mk | 31 | ||||
-rw-r--r-- | core/dex_preopt_odex_install.mk | 8 |
2 files changed, 29 insertions, 10 deletions
diff --git a/core/dex_preopt.mk b/core/dex_preopt.mk index 62c3ba3795..86ca7299b6 100644 --- a/core/dex_preopt.mk +++ b/core/dex_preopt.mk @@ -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 := $(dir $(boot_zip))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)) \ + -j -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)) diff --git a/core/dex_preopt_odex_install.mk b/core/dex_preopt_odex_install.mk index d4988750dc..8ebf34e016 100644 --- a/core/dex_preopt_odex_install.mk +++ b/core/dex_preopt_odex_install.mk @@ -272,13 +272,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 |