Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 10b90baa authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "dexpreopt.config should be created even though unbundled image is built" am: e01cfe48

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

Change-Id: Ie54b6457edb99b8fcae4859882054a44fd242049
parents 9ea746dc e01cfe48
Loading
Loading
Loading
Loading
+17 −8
Original line number Diff line number Diff line
@@ -5363,25 +5363,34 @@ endif # DEX2OAT is set
endif # BUILD_OS == linux

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): $(INSTALLED_SYSTEMIMAGE_TARGET) \
    $(INSTALLED_VENDORIMAGE_TARGET) \
    $(INSTALLED_ODMIMAGE_TARGET) \
    $(INSTALLED_PRODUCTIMAGE_TARGET) \

ifeq (,$(TARGET_BUILD_UNBUNDLED))
$(DEXPREOPT_CONFIG_ZIP): $(DEX_PREOPT_CONFIG_FOR_MAKE) \
	  $(DEX_PREOPT_SOONG_CONFIG_FOR_MAKE) \

endif

$(DEXPREOPT_CONFIG_ZIP): $(SOONG_ZIP)
	$(hide) mkdir -p $(dir $@) $(PRODUCT_OUT)/dexpreopt_config

ifeq (,$(TARGET_BUILD_UNBUNDLED))
ifneq (,$(DEX_PREOPT_CONFIG_FOR_MAKE))
	$(hide) cp $(DEX_PREOPT_CONFIG_FOR_MAKE) $(PRODUCT_OUT)/dexpreopt_config
endif
ifneq (,$(DEX_PREOPT_SOONG_CONFIG_FOR_MAKE))
	$(hide) cp $(DEX_PREOPT_SOONG_CONFIG_FOR_MAKE) $(PRODUCT_OUT)/dexpreopt_config
endif
endif #!TARGET_BUILD_UNBUNDLED
	$(hide) $(SOONG_ZIP) -d -o $@ -C $(PRODUCT_OUT)/dexpreopt_config -D $(PRODUCT_OUT)/dexpreopt_config

.PHONY: dexpreopt_config_zip
dexpreopt_config_zip: $(DEXPREOPT_CONFIG_ZIP)

# -----------------------------------------------------------------
# A zip of the symbols directory.  Keep the full paths to make it
# more obvious where these files came from.
+18 −5
Original line number Diff line number Diff line
@@ -278,6 +278,7 @@ my_dexpreopt_images_deps :=
my_dexpreopt_image_locations_on_host :=
my_dexpreopt_image_locations_on_device :=
my_dexpreopt_infix := boot
my_create_dexpreopt_config :=
ifeq (true, $(DEXPREOPT_USE_ART_IMAGE))
  my_dexpreopt_infix := art
endif
@@ -293,7 +294,16 @@ ifdef LOCAL_DEX_PREOPT
      LOCAL_UNCOMPRESS_DEX := true
    endif
  endif
  my_create_dexpreopt_config := true
endif

# dexpreopt is disabled when TARGET_BUILD_UNBUNDLED_IMAGE is true,
# but dexpreopt config files are required to dexpreopt in post-processing.
ifeq ($(TARGET_BUILD_UNBUNDLED_IMAGE),true)
  my_create_dexpreopt_config := true
endif

ifeq ($(my_create_dexpreopt_config), true)
  ifeq ($(LOCAL_MODULE_CLASS),JAVA_LIBRARIES)
    my_module_multilib := $(LOCAL_MULTILIB)
    # If the module is not an SDK library and it's a system server jar, only preopt the primary arch.
@@ -402,8 +412,6 @@ ifdef LOCAL_DEX_PREOPT

  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

  $(my_dexpreopt_config): $(my_dexpreopt_dep_configs) $(my_dexpreopt_config_merger)
@@ -416,6 +424,13 @@ ifdef LOCAL_DEX_PREOPT
	echo -e -n '$(subst $(newline),\n,$(subst ','\'',$(subst \,\\,$(PRIVATE_CONTENTS))))' > $@
	$(PRIVATE_CONFIG_MERGER) $@ $(PRIVATE_DEP_CONFIGS)

$(eval $(call copy-one-file,$(my_dexpreopt_config),$(my_dexpreopt_config_for_postprocessing)))

$(LOCAL_INSTALLED_MODULE): $(my_dexpreopt_config_for_postprocessing)

ifdef LOCAL_DEX_PREOPT
  my_dexpreopt_script := $(intermediates)/dexpreopt.sh
  my_dexpreopt_zip := $(intermediates)/dexpreopt.zip
  .KATI_RESTAT: $(my_dexpreopt_script)
  $(my_dexpreopt_script): PRIVATE_MODULE := $(LOCAL_MODULE)
  $(my_dexpreopt_script): PRIVATE_GLOBAL_SOONG_CONFIG := $(DEX_PREOPT_SOONG_CONFIG_FOR_MAKE)
@@ -431,8 +446,6 @@ 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 += \
@@ -468,7 +481,6 @@ 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)

@@ -477,3 +489,4 @@ ifdef LOCAL_DEX_PREOPT
  my_dexpreopt_zip :=
  my_dexpreopt_config_for_postprocessing :=
endif # LOCAL_DEX_PREOPT
endif # my_create_dexpreopt_config
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -1737,7 +1737,6 @@ else ifeq ($(TARGET_BUILD_UNBUNDLED),$(TARGET_BUILD_UNBUNDLED_IMAGE))
  $(call dist-for-goals, droidcore, \
    $(BUILT_OTATOOLS_PACKAGE) \
    $(APPCOMPAT_ZIP) \
    $(DEXPREOPT_CONFIG_ZIP) \
    $(DEXPREOPT_TOOLS_ZIP) \
  )

@@ -1785,6 +1784,7 @@ else ifeq ($(TARGET_BUILD_UNBUNDLED),$(TARGET_BUILD_UNBUNDLED_IMAGE))
    $(INSTALLED_ANDROID_INFO_TXT_TARGET) \
    $(INSTALLED_MISC_INFO_TARGET) \
    $(INSTALLED_RAMDISK_TARGET) \
    $(DEXPREOPT_CONFIG_ZIP) \
  )

  # Put a copy of the radio/bootloader files in the dist dir.
+1 −0
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ $(call add_json_str, Platform_min_supported_target_sdk_version, $(PLATFORM_MIN_
$(call add_json_bool, Allow_missing_dependencies,        $(filter true,$(ALLOW_MISSING_DEPENDENCIES)))
$(call add_json_bool, Unbundled_build,                   $(TARGET_BUILD_UNBUNDLED))
$(call add_json_bool, Unbundled_build_apps,              $(TARGET_BUILD_APPS))
$(call add_json_bool, Unbundled_build_image,             $(TARGET_BUILD_UNBUNDLED_IMAGE))
$(call add_json_bool, Always_use_prebuilt_sdks,          $(TARGET_BUILD_USE_PREBUILT_SDKS))
$(call add_json_bool, Skip_boot_jars_check,              $(SKIP_BOOT_JARS_CHECK))