langtools/make/gendata/Gendata-jdk.compiler.gmk
changeset 45156 001f73134346
parent 41253 7a2422a5b481
child 45909 b9bec21c56f6
--- a/langtools/make/gendata/Gendata-jdk.compiler.gmk	Thu May 11 15:12:38 2017 -0700
+++ b/langtools/make/gendata/Gendata-jdk.compiler.gmk	Fri May 12 06:42:37 2017 +0200
@@ -25,10 +25,20 @@
 
 include JarArchive.gmk
 include JavaCompilation.gmk
+include Modules.gmk
 include SetupJavaCompilers.gmk
 
 ################################################################################
 
+# This is needed to properly setup DOCS_MODULES.
+$(eval $(call ReadImportMetaData))
+
+# Modules that should be visible for 9 - the documented modules:
+CT_MODULES := $(DOCS_MODULES)
+
+# Get the complete module source path:
+CT_MODULESOURCEPATH := $(call GetModuleSrcPath)
+
 CT_DATA_DESCRIPTION ?= $(LANGTOOLS_TOPDIR)/make/data/symbols/symbols
 
 $(eval $(call SetupJavaCompilation, COMPILE_CREATE_SYMBOLS, \
@@ -41,6 +51,8 @@
 
 ifeq ($(BOOT_JDK_MODULAR), true)
   COMPILECREATESYMBOLS_ADD_EXPORTS := \
+      --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
+      --add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED \
       --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \
       --add-exports=jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED \
       --add-exports=jdk.jdeps/com.sun.tools.classfile=ALL-UNNAMED
@@ -59,6 +71,14 @@
 	    build-ctsym \
 	    $(CT_DATA_DESCRIPTION) \
 	    $(@D)
+	$(MKDIR) $(@D)/9
+	$(JAVA_SMALL) $(INTERIM_LANGTOOLS_ARGS) \
+	    $(COMPILECREATESYMBOLS_ADD_EXPORTS) \
+	    -classpath $(BUILDTOOLS_OUTPUTDIR)/create_symbols \
+	    build.tools.symbolgenerator.TransitiveDependencies \
+	    $(CT_MODULESOURCEPATH) \
+	    $(CT_MODULES) \
+	    >$(@D)/9/system-modules
 	$(TOUCH) $@
 
 # Can't generate ct.sym directly into modules libs as the SetupJarArchive macro
@@ -66,7 +86,7 @@
 $(eval $(call SetupJarArchive, CREATE_CTSYM, \
     DEPENDENCIES := $(SUPPORT_OUTPUTDIR)/symbols/ct.sym-files/_the.symbols, \
     SRCS := $(SUPPORT_OUTPUTDIR)/symbols/ct.sym-files, \
-    SUFFIXES := .sig, \
+    SUFFIXES := .sig system-modules, \
     JAR := $(SUPPORT_OUTPUTDIR)/symbols/ct.sym, \
 ))