8136930: Simplify use of module-system options by custom launchers
authormchung
Wed, 10 Aug 2016 15:49:16 -0700
changeset 40286 ba60b24b1308
parent 40285 91bfd52e1925
child 40287 bdadcb4724d1
8136930: Simplify use of module-system options by custom launchers Reviewed-by: alanb, ksrini, henryjen, sundar
nashorn/buildtools/nasgen/project.properties
nashorn/make/BuildNashorn.gmk
nashorn/make/build.xml
nashorn/make/project.properties
nashorn/test/TEST.ROOT
nashorn/test/script/currently-failing/JDK-8055034.js
--- a/nashorn/buildtools/nasgen/project.properties	Wed Aug 10 09:21:58 2016 -0700
+++ b/nashorn/buildtools/nasgen/project.properties	Wed Aug 10 15:49:16 2016 -0700
@@ -40,8 +40,8 @@
 javac.debug=true
 
 nasgen.module.imports=\
-    -XaddExports:java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED \
-    -XaddExports:java.base/jdk.internal.org.objectweb.asm.util=ALL-UNNAMED
+    --add-exports java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED \
+    --add-exports java.base/jdk.internal.org.objectweb.asm.util=ALL-UNNAMED
 
 meta.inf.dir=${src.dir}/META-INF
 run.classpath=\
--- a/nashorn/make/BuildNashorn.gmk	Wed Aug 10 09:21:58 2016 -0700
+++ b/nashorn/make/BuildNashorn.gmk	Wed Aug 10 15:49:16 2016 -0700
@@ -44,8 +44,8 @@
 $(eval $(call SetupJavaCompiler,GENERATE_NEWBYTECODE_DEBUG, \
     JVM := $(JAVA), \
     JAVAC := $(NEW_JAVAC), \
-    FLAGS := -g -source 9 -target 9 -upgrademodulepath "$(JDK_OUTPUTDIR)/modules/" \
-         -system none -modulesourcepath "$(MODULESOURCEPATH)", \
+    FLAGS := -g -source 9 -target 9 --upgrade-module-path "$(JDK_OUTPUTDIR)/modules/" \
+         --system none --module-source-path "$(MODULESOURCEPATH)", \
     SERVER_DIR := $(SJAVAC_SERVER_DIR), \
     SERVER_JVM := $(SJAVAC_SERVER_JAVA)))
 
@@ -76,9 +76,9 @@
 ifeq ($(BOOT_JDK_MODULAR), true)
   NASGEN_OPTIONS := \
       -cp $(BUILDTOOLS_OUTPUTDIR)/nasgen_classes \
-      -Xpatch:java.base=$(BUILDTOOLS_OUTPUTDIR)/nasgen_classes \
-      -XaddExports:java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED \
-      -XaddExports:java.base/jdk.internal.org.objectweb.asm.util=ALL-UNNAMED \
+      --patch-module java.base=$(BUILDTOOLS_OUTPUTDIR)/nasgen_classes \
+      --add-exports java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED \
+      --add-exports java.base/jdk.internal.org.objectweb.asm.util=ALL-UNNAMED \
       #
 else
   NASGEN_OPTIONS := \
--- a/nashorn/make/build.xml	Wed Aug 10 09:21:58 2016 -0700
+++ b/nashorn/make/build.xml	Wed Aug 10 15:49:16 2016 -0700
@@ -178,7 +178,7 @@
       <compilerarg value="-Xdiags:verbose"/>
       <compilerarg value="-parameters"/>
     </javac>
-    <!-- -Xpatch does not like module-info.class files! -->
+    <!-- patch-module does not like module-info.class files! -->
     <delete>
       <fileset dir="${build.classes.dir}" includes="**/module-info.class"/>
     </delete>
@@ -195,7 +195,7 @@
       <compilerarg value="-parameters"/>
       <compilerarg line="${nashorn.override.option}"/>
     </javac>
-    <!-- -Xpatch does not like module-info.class files! -->
+    <!-- patch-module does not like module-info.class files! -->
     <delete>
       <fileset dir="${build.classes.dir}" includes="**/module-info.class"/>
     </delete>
@@ -212,7 +212,7 @@
       <compilerarg value="-parameters"/>
       <compilerarg line="${nashorn.override.option}"/>
     </javac>
-    <!-- -Xpatch does not like module-info.class files! -->
+    <!-- patch-module does not like module-info.class files! -->
     <delete>
       <fileset dir="${build.classes.dir}" includes="**/module-info.class"/>
     </delete>
@@ -266,7 +266,7 @@
     <javadoc destdir="${dist.javadoc.dir}" use="yes" overview="${nashorn.module.src.dir}/overview.html"
         windowtitle="${nashorn.product.name} ${nashorn.version}"
         additionalparam="-quiet" failonerror="true" useexternalfile="true">
-      <arg value="-modulesourcepath"/>
+      <arg value="--module-source-path"/>
       <arg value="${basedir}/src/*/share/classes"/>
       <arg value="${javadoc.option}"/>
       <classpath>
@@ -285,7 +285,7 @@
     <javadoc destdir="${dist.nashornapi.javadoc.dir}" use="yes" overview="${nashorn.module.src.dir}/overview.html"
         extdirs="${nashorn.ext.path}" windowtitle="${nashorn.product.name} ${nashorn.version}"
         additionalparam="-quiet" failonerror="true" useexternalfile="true">
-      <arg value="-modulesourcepath"/>
+      <arg value="--module-source-path"/>
       <arg value="${basedir}/src/*/share/classes"/>
       <arg value="${javadoc.option}"/>
       <classpath>
@@ -302,7 +302,7 @@
     <javadoc destdir="${dist.dynalinkapi.javadoc.dir}" use="yes"
         windowtitle="Dynalink"
         additionalparam="-quiet" failonerror="true" useexternalfile="true">
-      <arg value="-modulesourcepath"/>
+      <arg value="--module-source-path"/>
       <arg value="${basedir}/src/*/share/classes"/>
       <arg value="${javadoc.option}"/>
       <classpath>
--- a/nashorn/make/project.properties	Wed Aug 10 09:21:58 2016 -0700
+++ b/nashorn/make/project.properties	Wed Aug 10 15:49:16 2016 -0700
@@ -51,9 +51,9 @@
 build.gzip=${build.dir}/nashorn.tar.gz
 
 nashorn.override.option=\
- -Xpatch:jdk.scripting.nashorn=${build.classes.dir}/jdk.scripting.nashorn \
- -Xpatch:jdk.scripting.nashorn.shell=${build.classes.dir}/jdk.scripting.nashorn.shell \
- -Xpatch:jdk.dynalink=${build.classes.dir}/jdk.dynalink
+ --patch-module jdk.scripting.nashorn=${build.classes.dir}/jdk.scripting.nashorn \
+ --patch-module jdk.scripting.nashorn.shell=${build.classes.dir}/jdk.scripting.nashorn.shell \
+ --patch-module jdk.dynalink=${build.classes.dir}/jdk.dynalink
 
 # project directory of <nashorn> ant task
 nashorntask.dir=buildtools/nashorntask
@@ -65,8 +65,8 @@
 nasgen.tool=jdk.nashorn.internal.tools.nasgen.Main
 
 nasgen.module.imports=\
-    -XaddExports:java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED \
-    -XaddExports:java.base/jdk.internal.org.objectweb.asm.util=ALL-UNNAMED
+    --add-exports java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED \
+    --add-exports java.base/jdk.internal.org.objectweb.asm.util=ALL-UNNAMED
 
 # parallel test runner tool
 parallel.test.runner=jdk.nashorn.internal.test.framework.ParallelTestRunner
@@ -142,19 +142,19 @@
     ${file.reference.snakeyaml.jar}
 
 test.module.imports=\
-    -XaddExports:jdk.scripting.nashorn/jdk.nashorn.internal.ir=ALL-UNNAMED \
-    -XaddExports:jdk.scripting.nashorn/jdk.nashorn.internal.codegen=ALL-UNNAMED \
-    -XaddExports:jdk.scripting.nashorn/jdk.nashorn.internal.parser=ALL-UNNAMED \
-    -XaddExports:jdk.scripting.nashorn/jdk.nashorn.internal.objects=ALL-UNNAMED \
-    -XaddExports:jdk.scripting.nashorn/jdk.nashorn.internal.runtime=ALL-UNNAMED \
-    -XaddExports:jdk.scripting.nashorn/jdk.nashorn.internal.runtime.doubleconv=ALL-UNNAMED \
-    -XaddExports:jdk.scripting.nashorn/jdk.nashorn.internal.runtime.linker=ALL-UNNAMED \
-    -XaddExports:jdk.scripting.nashorn/jdk.nashorn.internal.runtime.events=ALL-UNNAMED \
-    -XaddExports:jdk.scripting.nashorn/jdk.nashorn.internal.runtime.options=ALL-UNNAMED \
-    -XaddExports:jdk.scripting.nashorn/jdk.nashorn.internal.runtime.regexp=ALL-UNNAMED \
-    -XaddExports:jdk.scripting.nashorn/jdk.nashorn.internal.runtime.regexp.joni=ALL-UNNAMED \
-    -XaddExports:jdk.scripting.nashorn/jdk.nashorn.tools=ALL-UNNAMED \
-    -XaddExports:java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED
+    --add-exports jdk.scripting.nashorn/jdk.nashorn.internal.ir=ALL-UNNAMED \
+    --add-exports jdk.scripting.nashorn/jdk.nashorn.internal.codegen=ALL-UNNAMED \
+    --add-exports jdk.scripting.nashorn/jdk.nashorn.internal.parser=ALL-UNNAMED \
+    --add-exports jdk.scripting.nashorn/jdk.nashorn.internal.objects=ALL-UNNAMED \
+    --add-exports jdk.scripting.nashorn/jdk.nashorn.internal.runtime=ALL-UNNAMED \
+    --add-exports jdk.scripting.nashorn/jdk.nashorn.internal.runtime.doubleconv=ALL-UNNAMED \
+    --add-exports jdk.scripting.nashorn/jdk.nashorn.internal.runtime.linker=ALL-UNNAMED \
+    --add-exports jdk.scripting.nashorn/jdk.nashorn.internal.runtime.events=ALL-UNNAMED \
+    --add-exports jdk.scripting.nashorn/jdk.nashorn.internal.runtime.options=ALL-UNNAMED \
+    --add-exports jdk.scripting.nashorn/jdk.nashorn.internal.runtime.regexp=ALL-UNNAMED \
+    --add-exports jdk.scripting.nashorn/jdk.nashorn.internal.runtime.regexp.joni=ALL-UNNAMED \
+    --add-exports jdk.scripting.nashorn/jdk.nashorn.tools=ALL-UNNAMED \
+    --add-exports java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED
 
 meta.inf.dir=${nashorn.module.src.dir}/META-INF
 
--- a/nashorn/test/TEST.ROOT	Wed Aug 10 09:21:58 2016 -0700
+++ b/nashorn/test/TEST.ROOT	Wed Aug 10 15:49:16 2016 -0700
@@ -8,7 +8,7 @@
 groups=TEST.groups
 
 # Minimum jtreg version
-requiredVersion=4.2 b02
+requiredVersion=4.2 b03
 
-# Use new form of -Xpatch
-useNewXpatch=true
+# Use new module options
+useNewOptions=true
--- a/nashorn/test/script/currently-failing/JDK-8055034.js	Wed Aug 10 09:21:58 2016 -0700
+++ b/nashorn/test/script/currently-failing/JDK-8055034.js	Wed Aug 10 15:49:16 2016 -0700
@@ -51,7 +51,7 @@
     jjsCmd = javahome + "/bin/jjs";
     jjsCmd = jjsCmd.toString().replace(/\//g, File.separator);
 }
-jjsCmd += " -J-Xpatch:" + nashornJar;
+jjsCmd += " -J--patch-module=jdk.scripting.nashorn=" + nashornJar;
 
 $ENV.PWD=System.getProperty("user.dir") // to avoid RE on Cygwin
 $EXEC(jjsCmd, "var x = Object.create(null);\nx;\nprint('PASSED');\nexit(0)");