PRELOADED_CLASSES := $(call word-colon,1,$(firstword \
$(filter %system/etc/preloaded-classes,$(PRODUCT_COPY_FILES))))
+# Use the first compiled-classes file in PRODUCT_COPY_FILES.
+COMPILED_CLASSES := $(call word-colon,1,$(firstword \
+ $(filter %system/etc/compiled-classes,$(PRODUCT_COPY_FILES))))
+
# Default to debug version to help find bugs.
# Set USE_DEX2OAT_DEBUG to false for only building non-debug versions.
ifneq ($(USE_DEX2OAT_DEBUG), false)
PRODUCT_DEX_PREOPT_BOOT_FLAGS += --compile-pic
endif
+# If we have a compiled-classes file, create a parameter.
+COMPILED_CLASSES_FLAGS :=
+ifneq ($(COMPILED_CLASSES),)
+ COMPILED_CLASSES_FLAGS := --compiled-classes=$(COMPILED_CLASSES)
+endif
+
# The rule to install boot.art and boot.oat
$($(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_INSTALLED_IMAGE) : $($(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME) | $(ACP)
$(call copy-file-to-target)
--instruction-set-variant=$($(PRIVATE_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_CPU_VARIANT) \
--instruction-set-features=$($(PRIVATE_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES) \
--android-root=$(PRODUCT_OUT)/system --include-patch-information --runtime-arg -Xnorelocate --no-include-debug-symbols \
- $(PRODUCT_DEX_PREOPT_BOOT_FLAGS)
+ $(PRODUCT_DEX_PREOPT_BOOT_FLAGS) $(COMPILED_CLASSES_FLAGS)
PRODUCT_COPY_FILES := $(call add-to-product-copy-files-if-exists,\
frameworks/base/preloaded-classes:system/etc/preloaded-classes)
+# Note: it is acceptable to not have a compiled-classes file. In that case, all boot classpath
+# classes will be compiled.
+PRODUCT_COPY_FILES += $(call add-to-product-copy-files-if-exists,\
+ frameworks/base/compiled-classes:system/etc/compiled-classes)
+
$(call inherit-product, $(SRC_TARGET_DIR)/product/embedded.mk)