You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bo...@apache.org on 2016/09/11 10:18:01 UTC
[5/6] ant git commit: JDK9 command line options updated to JEP 293
JDK9 command line options updated to JEP 293
Project: http://git-wip-us.apache.org/repos/asf/ant/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/5bbc7b61
Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/5bbc7b61
Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/5bbc7b61
Branch: refs/heads/1.9.x
Commit: 5bbc7b6187cdb38100b3a4f9fbecb704a92bc4be
Parents: a4575c4
Author: Tomas Zezula <to...@gmail.com>
Authored: Fri Sep 9 13:38:55 2016 +0200
Committer: Stefan Bodewig <bo...@apache.org>
Committed: Sun Sep 11 12:16:28 2016 +0200
----------------------------------------------------------------------
manual/Tasks/junit.html | 24 ++++++++++----------
.../compilers/DefaultCompilerAdapter.java | 4 ++--
.../apache/tools/ant/types/CommandlineJava.java | 4 ++--
.../compilers/DefaultCompilerAdapterTest.java | 14 ++++++------
.../taskdefs/optional/junit/JUnitTaskTest.java | 12 +++++-----
5 files changed, 29 insertions(+), 29 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ant/blob/5bbc7b61/manual/Tasks/junit.html
----------------------------------------------------------------------
diff --git a/manual/Tasks/junit.html b/manual/Tasks/junit.html
index 9a4022e..a6879a8 100644
--- a/manual/Tasks/junit.html
+++ b/manual/Tasks/junit.html
@@ -814,10 +814,10 @@ class.
<pre>
<junit fork="true"
jvm="${platform.java}">
- <jvmarg value="-Xpatch:${module.name}=${build.test.classes}"/>
- <jvmarg line="-addmods ${module.name}"/>
- <jvmarg value="-XaddReads:${module.name}=ALL-UNNAMED"/>
- <jvmarg value="-XaddExports:${module.name}/my.test=ALL-UNNAMED"/>
+ <jvmarg line="--patch-module ${module.name}=${build.test.classes}"/>
+ <jvmarg line="--add-modules ${module.name}"/>
+ <jvmarg line="--add-reads ${module.name}=ALL-UNNAMED"/>
+ <jvmarg line="--add-exports ${module.name}/my.test=ALL-UNNAMED"/>
<classpath>
<pathelement path="${libs.junit}"/>
</classpath>
@@ -831,16 +831,16 @@ class.
<p>Runs my.test.TestCase as a white-box test in the forked VM given by the <code>platform.java</code> property.
The junit library is a part of an unnamed module while the tested project and required modules are on the module path. The tests
do not have module-info file and are executed in the project module given by <code>module.name</code> property.<br/>
-The <code>-Xpatch</code> java option executes the tests built into <code>${build.test.classes}</code> in a module given
+The <code>--patch-module</code> java option executes the tests built into <code>${build.test.classes}</code> in a module given
by <code>module.name</code> property.<br/>
-The <code>-addmods</code> java option enables the tested module.<br/>
-The <code>-XaddReads</code> java option makes the unnamed module containing the junit readable by tested module.<br/>
-The <code>-XaddExports</code> java option makes the non-exported test package <code>my.test</code> accessible from the unnamed module containing the junit.<br/>
+The <code>--add-modules</code> java option enables the tested module.<br/>
+The <code>--add-reads</code> java option makes the unnamed module containing the junit readable by tested module.<br/>
+The <code>--add-exports</code> java option makes the non-exported test package <code>my.test</code> accessible from the unnamed module containing the junit.<br/>
<pre>
<junit fork="true"
jvm="${platform.java}">
- <jvmarg line="-addmods ${test.module.name}"/>
- <jvmarg value="-XaddExports:${test.module.name}/my.test=junit,ALL-UNNAMED"/>
+ <jvmarg line="--add-modules ${test.module.name}"/>
+ <jvmarg line="--add-exports ${test.module.name}/my.test=junit,ALL-UNNAMED"/>
<modulepath>
<pathelement path="${modules}:${build.classes}:${libs.junit}"/>
</modulepath>
@@ -850,8 +850,8 @@ The <code>-XaddExports</code> java option makes the non-exported test package <c
</pre>
<p>Runs my.test.TestCase as a black-box test in the forked VM given by the <code>platform.java</code> property.
The junit library is used as an automatic module. The tests module-info requires the tested module and junit.<br/>
-The <code>-addmods</code> java option enables the test module.<br/>
-The <code>-XaddExports</code> java option makes the non-exported test package <code>my.test</code> accessible from the junit module and Ant's test runner.
+The <code>--add-modules</code> java option enables the test module.<br/>
+The <code>--add-exports</code> java option makes the non-exported test package <code>my.test</code> accessible from the junit module and Ant's test runner.
Another possibility is to export the test package in the tests module-info by <code>exports my.test</code> directive.<br/>
</body>
</html>
http://git-wip-us.apache.org/repos/asf/ant/blob/5bbc7b61/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java b/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java
index 5f1f1f7..f13b3e5 100644
--- a/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java
+++ b/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java
@@ -401,12 +401,12 @@ public abstract class DefaultCompilerAdapter
}
final Path msp = getModulesourcepath();
if (msp.size() > 0) {
- cmd.createArgument().setValue("-modulesourcepath");
+ cmd.createArgument().setValue("--module-source-path");
cmd.createArgument().setPath(msp);
}
final Path mp = getModulepath();
if (mp.size() > 0) {
- cmd.createArgument().setValue("-modulepath");
+ cmd.createArgument().setValue("--module-path");
cmd.createArgument().setPath(mp);
}
final Path ump = getUpgrademodulepath();
http://git-wip-us.apache.org/repos/asf/ant/blob/5bbc7b61/src/main/org/apache/tools/ant/types/CommandlineJava.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/types/CommandlineJava.java b/src/main/org/apache/tools/ant/types/CommandlineJava.java
index 5bf91c7..d811633 100644
--- a/src/main/org/apache/tools/ant/types/CommandlineJava.java
+++ b/src/main/org/apache/tools/ant/types/CommandlineJava.java
@@ -520,13 +520,13 @@ public class CommandlineJava implements Cloneable {
}
//module path
if (haveModulepath()) {
- listIterator.add("-modulepath");
+ listIterator.add("--module-path");
listIterator.add(
modulepath.concatSystemClasspath("ignore").toString());
}
//upgrade module path
if (haveUpgrademodulepath()) {
- listIterator.add("-upgrademodulepath");
+ listIterator.add("--upgrade-module-path");
listIterator.add(
upgrademodulepath.concatSystemClasspath("ignore").toString());
}
http://git-wip-us.apache.org/repos/asf/ant/blob/5bbc7b61/src/tests/junit/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapterTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapterTest.java b/src/tests/junit/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapterTest.java
index 3064876..7ed5b3f 100644
--- a/src/tests/junit/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapterTest.java
+++ b/src/tests/junit/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapterTest.java
@@ -249,13 +249,13 @@ public class DefaultCompilerAdapterTest {
Assert.assertNotNull(cmd[0]);
final List<String> cmdLine = Arrays.asList(cmd[0].getCommandline());
//No modulesourcepath
- assertEquals(-1, cmdLine.indexOf("-modulesourcepath"));
+ assertEquals(-1, cmdLine.indexOf("--module-source-path"));
//The -sourcepath has to be followed by src
int index = cmdLine.indexOf("-sourcepath");
Assert.assertTrue(index != -1 && index < cmdLine.size() - 1);
assertEquals(src.getAbsolutePath(), cmdLine.get(index + 1));
- //The -modulepath has to be followed by modules
- index = cmdLine.indexOf("-modulepath");
+ //The --module-path has to be followed by modules
+ index = cmdLine.indexOf("--module-path");
Assert.assertTrue(index != -1 && index < cmdLine.size() - 1);
assertEquals(modules.getAbsolutePath(), cmdLine.get(index + 1));
//J1.java & J2.java has to be in files list
@@ -308,8 +308,8 @@ public class DefaultCompilerAdapterTest {
final List<String> cmdLine = Arrays.asList(cmd[0].getCommandline());
//No sourcepath
assertEquals(-1, cmdLine.indexOf("-sourcepath"));
- //The -modulesourcepath has to be followed by the pattern
- int index = cmdLine.indexOf("-modulesourcepath");
+ //The --module-source-path has to be followed by the pattern
+ int index = cmdLine.indexOf("--module-source-path");
Assert.assertTrue(index != -1 && index < cmdLine.size() - 1);
String expectedModSrcPath = String.format("%s/%s",
workDir.getAbsolutePath(),
@@ -317,8 +317,8 @@ public class DefaultCompilerAdapterTest {
.replace('/', File.separatorChar)
.replace('\\', File.separatorChar);
assertEquals(expectedModSrcPath, cmdLine.get(index + 1));
- //The -modulepath has to be followed by modules
- index = cmdLine.indexOf("-modulepath");
+ //The --module-path has to be followed by modules
+ index = cmdLine.indexOf("--module-path");
Assert.assertTrue(index != -1 && index < cmdLine.size() - 1);
assertEquals(modules.getAbsolutePath(), cmdLine.get(index + 1));
//J1.java, J2.java & J3.java has to be in files list
http://git-wip-us.apache.org/repos/asf/ant/blob/5bbc7b61/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitTaskTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitTaskTest.java b/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitTaskTest.java
index 5284d56..d817cb1 100644
--- a/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitTaskTest.java
+++ b/src/tests/junit/org/apache/tools/ant/taskdefs/optional/junit/JUnitTaskTest.java
@@ -476,10 +476,10 @@ public class JUnitTaskTest {
for (int i = 1; i< mockProcLauncher.cmd.length; i++) {
if ("-classpath".equals(mockProcLauncher.cmd[i])) { //NOI18N
resCp = mockProcLauncher.cmd[++i];
- } else if ("-modulepath".equals(mockProcLauncher.cmd[i])) { //NOI18N
+ } else if ("--module-path".equals(mockProcLauncher.cmd[i])) { //NOI18N
resMp = mockProcLauncher.cmd[++i];
- } else if (mockProcLauncher.cmd[i].startsWith("-XaddExports:")) { //NOI18N
- resExports.add(mockProcLauncher.cmd[i]);
+ } else if (mockProcLauncher.cmd[i].equals("--add-exports")) { //NOI18N
+ resExports.add(mockProcLauncher.cmd[++i]);
} else if (JUnitTestRunner.class.getName().equals(mockProcLauncher.cmd[i])) {
break;
}
@@ -530,10 +530,10 @@ public class JUnitTaskTest {
for (int i = 1; i< mockProcLauncher.cmd.length; i++) {
if ("-classpath".equals(mockProcLauncher.cmd[i])) { //NOI18N
resCp = mockProcLauncher.cmd[++i];
- } else if ("-modulepath".equals(mockProcLauncher.cmd[i])) { //NOI18N
+ } else if ("--module-path".equals(mockProcLauncher.cmd[i])) { //NOI18N
resMp = mockProcLauncher.cmd[++i];
- } else if (mockProcLauncher.cmd[i].startsWith("-XaddExports:")) { //NOI18N
- resExports.add(mockProcLauncher.cmd[i]);
+ } else if (mockProcLauncher.cmd[i].equals("--add-exports")) { //NOI18N
+ resExports.add(mockProcLauncher.cmd[++i]);
} else if (JUnitTestRunner.class.getName().equals(mockProcLauncher.cmd[i])) {
break;
}