Don't install boot.art when WITH_DEXPREOPT is false

Don't create the install rules for boot.art when WITH_DEXPREOPT
is not set to true, which will ensure there is no dependency on
boot.art in a normal build, which matches the behavior before
I25163e91886cea6941afa25cdb529ed053278dcb.

This should fix the Mac build, which never sets WITH_DEXPREOPT
and does not support running dex2oat.

Bug: 119412419
Bug: 121130576
Bug: 121183382
Test: lunch aosp_sailfish-eng && m WITH_DEXPREOPT=false
      files does not depend on out/target/product/sailfish/dex_bootjars/system/framework/arm/boot.art
Change-Id: I39e96b1f35f6808d3007cf1785ec3db89e0decb6
This commit is contained in:
Colin Cross 2018-12-17 23:32:40 -08:00
parent 7cac3adf1a
commit 19fbc1b9e9
1 changed files with 10 additions and 8 deletions

View File

@ -83,14 +83,16 @@ ifdef LOCAL_SOONG_DEX_JAR
$(eval $(call hiddenapi-generate-csv,$(full_classes_jar),$(hiddenapi_flags_csv),$(hiddenapi_metadata_csv)))
$(eval $(call hiddenapi-copy-soong-jar,$(LOCAL_SOONG_DEX_JAR),$(common_javalib.jar)))
# For libart, the boot jars' odex files are replaced by $(DEFAULT_DEX_PREOPT_INSTALLED_IMAGE).
# We use this installed_odex trick to get boot.art installed.
installed_odex := $(DEFAULT_DEX_PREOPT_INSTALLED_IMAGE)
# Append the odex for the 2nd arch if we have one.
installed_odex += $($(TARGET_2ND_ARCH_VAR_PREFIX)DEFAULT_DEX_PREOPT_INSTALLED_IMAGE)
ALL_MODULES.$(my_register_name).INSTALLED += $(installed_odex)
# Make sure to install the .odex and .vdex when you run "make <module_name>"
$(my_all_targets): $(installed_odex)
ifeq (true,$(WITH_DEXPREOPT))
# For libart, the boot jars' odex files are replaced by $(DEFAULT_DEX_PREOPT_INSTALLED_IMAGE).
# We use this installed_odex trick to get boot.art installed.
installed_odex := $(DEFAULT_DEX_PREOPT_INSTALLED_IMAGE)
# Append the odex for the 2nd arch if we have one.
installed_odex += $($(TARGET_2ND_ARCH_VAR_PREFIX)DEFAULT_DEX_PREOPT_INSTALLED_IMAGE)
ALL_MODULES.$(my_register_name).INSTALLED += $(installed_odex)
# Make sure to install the .odex and .vdex when you run "make <module_name>"
$(my_all_targets): $(installed_odex)
endif
else # !is_boot_jar
$(eval $(call copy-one-file,$(LOCAL_SOONG_DEX_JAR),$(common_javalib.jar)))
endif # is_boot_jar