Merge <uses-library> dependency configs into dexpreopt.config files.
Since Make does not visit modules in topological order of their
<uses-library> dependencies, information from dependencies to the
dexpreopted module has to be passed via dexpreopt.config files. A build
rule for a dexpreopt.config file depends on dexpreopt.config files for
<uses-library> dependencies, and dex_preopt_config_merger.py script
extracts the necessary information from dependency configs and patches
the module's config.
Bug: 132357300
Test: lunch aosp_cf_x86_phone-userdebug && m
Change-Id: Id0b71170a4d2ab1d33059de0e9ad9d7e61f2345e
diff --git a/core/soong_java_prebuilt.mk b/core/soong_java_prebuilt.mk
index 5444d96..c600178 100644
--- a/core/soong_java_prebuilt.mk
+++ b/core/soong_java_prebuilt.mk
@@ -5,6 +5,7 @@
# LOCAL_SOONG_HEADER_JAR
# LOCAL_SOONG_DEX_JAR
# LOCAL_SOONG_JACOCO_REPORT_CLASSES_JAR
+# LOCAL_SOONG_DEXPREOPT_CONFIG
ifneq ($(LOCAL_MODULE_MAKEFILE),$(SOONG_ANDROID_MK))
$(call pretty-error,soong_java_prebuilt.mk may only be used from Soong)
@@ -146,6 +147,12 @@
ALL_MODULES.$(my_register_name).AAR := $(LOCAL_SOONG_AAR)
endif
+# Copy dexpreopt.config files from Soong libraries to the location where Make
+# modules can find them.
+ifdef LOCAL_SOONG_DEXPREOPT_CONFIG
+ $(eval $(call copy-one-file,$(LOCAL_SOONG_DEXPREOPT_CONFIG), $(call local-intermediates-dir,)/dexpreopt.config))
+endif
+
javac-check : $(full_classes_jar)
javac-check-$(LOCAL_MODULE) : $(full_classes_jar)
.PHONY: javac-check-$(LOCAL_MODULE)