Use system modules generated by soong when using javac -target 1.9
Soong has support for building system modules. Use the directories
produced by Soong with --system to replace -bootclasspath arguments
when using javac -target 1.9.
Since soong can't generate current SDK stubs yet, and no existing
SDK stubs need -target, only use -target 1.9 for modules that are
not compiling against the SDK. That means in practice the only
system modules that will be used for now is the default one,
core-system-modules.
Bug: 63986449
Test: m -j EXPERIMENTAL_USE_OPENJDK9=true makes some progress
Change-Id: I350ef50aedf36fdd72458c23d4fe8a2edf1a9a02
diff --git a/core/definitions.mk b/core/definitions.mk
index 1f9891e..0e7093e 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -2251,9 +2251,11 @@
$(hide) if [ -s $(PRIVATE_JAVA_SOURCE_LIST) ] ; then \
$(SOONG_JAVAC_WRAPPER) $(1) -encoding UTF-8 \
$(if $(findstring true,$(PRIVATE_WARNINGS_ENABLE)),$(xlint_unchecked),) \
- $(addprefix -bootclasspath ,$(strip \
- $(call normalize-path-list,$(PRIVATE_BOOTCLASSPATH)) \
- $(PRIVATE_EMPTY_BOOTCLASSPATH))) \
+ $(if $(PRIVATE_USE_SYSTEM_MODULES), \
+ $(addprefix --system=,$(PRIVATE_SYSTEM_MODULES)), \
+ $(addprefix -bootclasspath ,$(strip \
+ $(call normalize-path-list,$(PRIVATE_BOOTCLASSPATH)) \
+ $(PRIVATE_EMPTY_BOOTCLASSPATH)))) \
$(addprefix -classpath ,$(strip \
$(call normalize-path-list,$(2)))) \
$(if $(findstring true,$(PRIVATE_WARNINGS_ENABLE)),$(xlint_unchecked),) \
@@ -2300,6 +2302,7 @@
$(3) \
$(5) \
$$(full_java_bootclasspath_libs) \
+ $$(full_java_system_modules_deps) \
$$(layers_file) \
$$(annotation_processor_deps) \
$$(NORMALIZE_PATH) \