./build.gradle

Print this page
rev 9996 : 8163316: Update FX to use new gnu style java command line options
Reviewed-by: kcr

@@ -2319,11 +2319,11 @@
         workingDir = project.file("build/tmp/tests/appResources/")
         executable = JIGSAW_JAVA
         classpath = project.files("build/libs/ant-javafx.jar", "build/classes/test", "build/resources/test")
         main = "hello.SimpleBundle"
         args = [
-                '-modulepath', JIGSAW_MODULES,
+                '--module-path', JIGSAW_MODULES,
                 '-o', "$projectDir/build/dev",
                 '-all',
                 packagerDevOpts
         ].flatten()
     }

@@ -3002,13 +3002,13 @@
 // fxpackager requires JDK 9 to compile
 project(":fxpackager") {
     tasks.withType(JavaCompile) { compile ->
         compile.options.forkOptions.executable = JIGSAW_JAVAC
         compile.options.compilerArgs = [
-                "-XaddExports:java.base/sun.security.pkcs=ALL-UNNAMED,"
-                        + "java.base/sun.security.timestamp=ALL-UNNAMED,"
-                        + "java.base/sun.security.x509=ALL-UNNAMED",
+                "--add-exports", "java.base/sun.security.pkcs=ALL-UNNAMED",
+                "--add-exports", "java.base/sun.security.timestamp=ALL-UNNAMED",
+                "--add-exports", "java.base/sun.security.x509=ALL-UNNAMED",
                 "-encoding", "UTF-8"]
     }
 }
 
 // fxpackagerservices requires JDK 9 to compile

@@ -3465,13 +3465,13 @@
     def modulesCmdsDir = "${modularSdkDir}/modules_cmds"
     def modulesLibsDir = "${modularSdkDir}/modules_libs"
     def modulesSrcDir = "${modularSdkDir}/modules_src"
     def modulesConfDir = "${modularSdkDir}/modules_conf"
     def modulesMakeDir = "${modularSdkDir}/make"
-    final File xpatchFile = file("${rootProject.buildDir}/xpatch.args")
+    final File patchmoduleFile = file("${rootProject.buildDir}/patchmodule.args")
 
-    project.files(xpatchFile);
+    project.files(patchmoduleFile);
 
     def zipTask = project.task("buildModuleZip$t.capital", type: Zip, group: "Build") {
         enabled = IS_BUILD_MODULE_ZIP
 
         // FIXME: JIGSAW -- this should be moved to a sub-directory so we can keep the same name

@@ -3564,28 +3564,28 @@
         }
     }
     zipTask.dependsOn(buildModulesTask);
     buildModules.dependsOn(buildModulesTask)
 
-    def buildModulesXpatchTask = task("buildModulesXpatch$t.capital", group: "Build") {
+    def buildModulesPatchTask = task("buildModulesPatch$t.capital", group: "Build") {
         doLast() {
-            xpatchFile.delete()
+            patchmoduleFile.delete()
 
-            logger.info("Creating xpatch.args file ${xpatchFile}")
+            logger.info("Creating patchmodule.args file ${patchmoduleFile}")
             String thepath=cygpath("${rootProject.buildDir}/sdk/${targetProperties.libDest}")
 
-            xpatchFile <<  "-Djava.library.path=${thepath}\n"
+            patchmoduleFile <<  "-Djava.library.path=${thepath}\n"
             moduleProjList.each { project ->
                 def moduleName = project.ext.moduleName
                 def dstModuleDir = cygpath("${modulesDir}/${moduleName}")
-                xpatchFile <<  "-Xpatch:${moduleName}=${dstModuleDir}\n"
+                patchmoduleFile <<  "--patch-module ${moduleName}=\"${dstModuleDir}\"\n"
             }
         }
     }
 
-    buildModulesXpatchTask.dependsOn(buildModulesTask)
-    buildModules.dependsOn(buildModulesXpatchTask)
+    buildModulesPatchTask.dependsOn(buildModulesTask)
+    buildModules.dependsOn(buildModulesPatchTask)
 
     def isWindows = IS_WINDOWS && t.name == "win";
     def isMac = IS_MAC && t.name == "mac";
 
     // Create layout for modular classes

@@ -3918,19 +3918,19 @@
         logger.info("configuring $p.name for modular test copy");
 
         def testingDir = "${rootProject.buildDir}/${targetProperties.platformPrefix}testing";
         def patchesDir = new File("${testingDir}/modules");
         File patchPolicyFile = new File("${testingDir}/java.patch.policy");
-        File xpatchFile = new File("${testingDir}/xpatch.args");
+        File patchmoduleFile = new File("${testingDir}/patchmodule.args");
 
         String javaLibraryPath = "${rootProject.buildDir}/sdk/$targetProperties.libDest"
 
         def jigsawPatchesBaseDir = new File("${testingDir}/modules/$moduleName");
         def jigsawPatchesTestDir = new File("${testingDir}/tests/$moduleName");
 
         p.files(patchPolicyFile);
-        p.files(xpatchFile);
+        p.files(patchmoduleFile);
 
         def srcClassesDir = "${p.buildDir}/${targetProperties.platformPrefix}module-classes"
         Task classes =  p.task("jigsawCopyClasses${t.capital}", type: Copy, dependsOn: [p.classes]) {
 
             enabled = useModule

@@ -3983,29 +3983,29 @@
         if (rootProject.hasProperty(nameis)) {
             patchPerms = rootProject.tasks[nameis]
         } else {
             patchPerms = rootProject.task(nameis) {
                 outputs.file(patchPolicyFile)
-                outputs.file(xpatchFile)
+                outputs.file(patchmoduleFile)
                 doLast() {
                     logger.info("Creating test patch.policy file ${patchPolicyFile}")
-                    logger.info("Creating test patch.policy file ${xpatchFile}")
+                    logger.info("Creating test patch.policy file ${patchmoduleFile}")
 
                     delete(patchPolicyFile)
-                    delete(xpatchFile)
+                    delete(patchmoduleFile)
                     mkdir(testingDir)
                     String thepath=cygpath("${rootProject.buildDir}/sdk/${targetProperties.libDest}")
 
-                    xpatchFile <<  "-Djava.library.path=${thepath}\n"
+                    patchmoduleFile <<  "-Djava.library.path=${thepath}\n"
                     moduleProjList.each { project ->
                         String themod = file("${patchesDir}/${project.ext.moduleName}").toURI()
                         patchPolicyFile <<  "grant codeBase \"${themod}\" {\n" +
                         "    permission java.security.AllPermission;\n" +
                         "};\n"
 
                         def dstModuleDir = cygpath("${patchesDir}/${project.ext.moduleName}")
-                        xpatchFile <<  "-Xpatch:${project.ext.moduleName}=${dstModuleDir}\n"
+                        patchmoduleFile <<  "--patch-module ${project.ext.moduleName}=\"${dstModuleDir}\"\n"
                     }
                 }
             }
         }
 

@@ -4055,11 +4055,11 @@
                 }
 
                 String bcp = "-Xbootclasspath/a:" + rootProject.projectDir.path + "/buildSrc/build/libs/buildSrc.jar"
 
                 systemProperties 'worker.debug': IS_WORKER_DEBUG
-                systemProperties 'worker.xpatch.file': cygpath(xpatchFile.path)
+                systemProperties 'worker.patchmodule.file': cygpath(patchmoduleFile.path)
                 if (addExportsFile != null) {
                     systemProperties 'worker.exports.file': cygpath(addExportsFile)
                 }
                 systemProperties 'worker.classpath.file': cygpath(p.ext.argclasspathFile)
                 systemProperties 'worker.java.cmd': JIGSAW_JAVA