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/07/25 10:22:48 UTC
[1/3] ant git commit: formatting was broken
Repository: ant
Updated Branches:
refs/heads/1.9.x a5f386f1d -> 625d3d371
formatting was broken
Project: http://git-wip-us.apache.org/repos/asf/ant/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/7c3db4a6
Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/7c3db4a6
Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/7c3db4a6
Branch: refs/heads/1.9.x
Commit: 7c3db4a63dadf4047c3b02efb67c8f0992a2bc58
Parents: a5f386f
Author: Stefan Bodewig <bo...@apache.org>
Authored: Mon Jul 25 12:10:52 2016 +0200
Committer: Stefan Bodewig <bo...@apache.org>
Committed: Mon Jul 25 12:10:52 2016 +0200
----------------------------------------------------------------------
manual/properties.html | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ant/blob/7c3db4a6/manual/properties.html
----------------------------------------------------------------------
diff --git a/manual/properties.html b/manual/properties.html
index cfb59ea..96646e1 100644
--- a/manual/properties.html
+++ b/manual/properties.html
@@ -87,8 +87,8 @@ ant.java.version the JVM version Ant detected; currently it can hold
the values "1.9", "1.8",
"1.7", "1.6", "1.5",
"1.4", "1.3" and
- "1.2". ant.core.lib the absolute path
- of the <code>ant.jar</code> file.
+ "1.2".
+ant.core.lib the absolute path of the <code>ant.jar</code> file.
</pre>
<p>There is also another property, but this is set by the launcher
[3/3] ant git commit: nobody is going to call Java 9 1.9 anymore
Posted by bo...@apache.org.
nobody is going to call Java 9 1.9 anymore
https://bz.apache.org/bugzilla/show_bug.cgi?id=59863
Project: http://git-wip-us.apache.org/repos/asf/ant/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/625d3d37
Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/625d3d37
Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/625d3d37
Branch: refs/heads/1.9.x
Commit: 625d3d371fc6454232e69cb6d0c68373341feb71
Parents: dda54c6
Author: Stefan Bodewig <bo...@apache.org>
Authored: Mon Jul 25 12:21:47 2016 +0200
Committer: Stefan Bodewig <bo...@apache.org>
Committed: Mon Jul 25 12:21:47 2016 +0200
----------------------------------------------------------------------
WHATSNEW | 3 +
manual/Tasks/javac.html | 3 +-
manual/properties.html | 2 +-
.../org/apache/tools/ant/taskdefs/Javac.java | 14 ++--
.../compilers/CompilerAdapterFactory.java | 3 +-
.../compilers/DefaultCompilerAdapter.java | 33 +++++---
.../org/apache/tools/ant/util/JavaEnvUtils.java | 83 +++++++++++++-------
.../compilers/DefaultCompilerAdapterTest.java | 31 ++++++++
.../apache/tools/ant/util/JavaEnvUtilsTest.java | 5 +-
9 files changed, 122 insertions(+), 55 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ant/blob/625d3d37/WHATSNEW
----------------------------------------------------------------------
diff --git a/WHATSNEW b/WHATSNEW
index e79166f..3e4e90b 100644
--- a/WHATSNEW
+++ b/WHATSNEW
@@ -9,6 +9,9 @@ Changes that could break older environments:
same instance. This will now cause the build to fail.
Bugzilla Report 59402
+ * The ant.java.version property will now hold the value "9" rather
+ than "1.9" if running on Java 9.
+
Fixed bugs:
-----------
http://git-wip-us.apache.org/repos/asf/ant/blob/625d3d37/manual/Tasks/javac.html
----------------------------------------------------------------------
diff --git a/manual/Tasks/javac.html b/manual/Tasks/javac.html
index cfddb58..a5fc56c 100644
--- a/manual/Tasks/javac.html
+++ b/manual/Tasks/javac.html
@@ -79,7 +79,8 @@ attribute are:</a></p>
<code>javac1.6</code> and
<code>javac1.7</code> (<em>since Ant 1.8.2</em>) and
<code>javac1.8</code> (<em>since Ant 1.8.3</em>) and</li>
- <code>javac1.9</code> (<em>since Ant 1.9.5</em>) can be used as aliases.</li>
+ <code>javac1.9</code> (<em>since Ant 1.9.5</em>) and</li>
+ <code>javac9</code> (<em>since Ant 1.9.8</em>) can be used as aliases.</li>
<li><code>jikes</code> (the <a
href="http://jikes.sourceforge.net/" target="_top">Jikes</a>
compiler).</li>
http://git-wip-us.apache.org/repos/asf/ant/blob/625d3d37/manual/properties.html
----------------------------------------------------------------------
diff --git a/manual/properties.html b/manual/properties.html
index 96646e1..226972a 100644
--- a/manual/properties.html
+++ b/manual/properties.html
@@ -84,7 +84,7 @@ ant.project.invoked-targets
will contain the project's default target in this
case for tasks nested into targets..
ant.java.version the JVM version Ant detected; currently it can hold
- the values "1.9", "1.8",
+ the values "9", "1.8",
"1.7", "1.6", "1.5",
"1.4", "1.3" and
"1.2".
http://git-wip-us.apache.org/repos/asf/ant/blob/625d3d37/src/main/org/apache/tools/ant/taskdefs/Javac.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/Javac.java b/src/main/org/apache/tools/ant/taskdefs/Javac.java
index 9bb3e74..892c0f1 100644
--- a/src/main/org/apache/tools/ant/taskdefs/Javac.java
+++ b/src/main/org/apache/tools/ant/taskdefs/Javac.java
@@ -85,6 +85,7 @@ public class Javac extends MatchingTask {
private static final String FAIL_MSG
= "Compile failed; see the compiler error output for details.";
+ private static final String JAVAC9 = "javac9";
private static final String JAVAC19 = "javac1.9";
private static final String JAVAC18 = "javac1.8";
private static final String JAVAC17 = "javac1.7";
@@ -166,8 +167,8 @@ public class Javac extends MatchingTask {
return JAVAC17;
} else if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_8)) {
return JAVAC18;
- } else if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_9)) {
- return JAVAC19;
+ } else if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_9)) {
+ return JAVAC9;
} else {
return CLASSIC;
}
@@ -912,7 +913,8 @@ public class Javac extends MatchingTask {
}
private String getAltCompilerName(final String anImplementation) {
- if (JAVAC19.equalsIgnoreCase(anImplementation)
+ if (JAVAC9.equalsIgnoreCase(anImplementation)
+ || JAVAC19.equalsIgnoreCase(anImplementation)
|| JAVAC18.equalsIgnoreCase(anImplementation)
|| JAVAC17.equalsIgnoreCase(anImplementation)
|| JAVAC16.equalsIgnoreCase(anImplementation)
@@ -927,7 +929,7 @@ public class Javac extends MatchingTask {
}
if (MODERN.equalsIgnoreCase(anImplementation)) {
final String nextSelected = assumedJavaVersion();
- if (JAVAC19.equalsIgnoreCase(nextSelected)
+ if (JAVAC9.equalsIgnoreCase(nextSelected)
|| JAVAC18.equalsIgnoreCase(nextSelected)
|| JAVAC17.equalsIgnoreCase(nextSelected)
|| JAVAC16.equalsIgnoreCase(nextSelected)
@@ -1194,12 +1196,12 @@ public class Javac extends MatchingTask {
* @param compilerImpl the name of the compiler implementation
* @return true if compilerImpl is "modern", "classic",
* "javac1.1", "javac1.2", "javac1.3", "javac1.4", "javac1.5",
- * "javac1.6", "javac1.7", "javac1.8" or "javac1.9".
+ * "javac1.6", "javac1.7", "javac1.8", "javac1.9" or "javac9".
*/
protected boolean isJdkCompiler(final String compilerImpl) {
return MODERN.equals(compilerImpl)
|| CLASSIC.equals(compilerImpl)
- || JAVAC19.equals(compilerImpl)
+ || JAVAC9.equals(compilerImpl)
|| JAVAC18.equals(compilerImpl)
|| JAVAC17.equals(compilerImpl)
|| JAVAC16.equals(compilerImpl)
http://git-wip-us.apache.org/repos/asf/ant/blob/625d3d37/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapterFactory.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapterFactory.java b/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapterFactory.java
index aeecb4a..8712715 100644
--- a/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapterFactory.java
+++ b/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapterFactory.java
@@ -122,7 +122,8 @@ public final class CompilerAdapterFactory {
|| compilerType.equalsIgnoreCase("javac1.6")
|| compilerType.equalsIgnoreCase("javac1.7")
|| compilerType.equalsIgnoreCase("javac1.8")
- || compilerType.equalsIgnoreCase("javac1.9")) {
+ || compilerType.equalsIgnoreCase("javac1.9")
+ || compilerType.equalsIgnoreCase("javac9")) {
// does the modern compiler exist?
if (doesModernCompilerExist()) {
return new Javac13();
http://git-wip-us.apache.org/repos/asf/ant/blob/625d3d37/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 d1a9cb3..db6cd85 100644
--- a/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java
+++ b/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java
@@ -672,12 +672,23 @@ public abstract class DefaultCompilerAdapter
}
/**
- * Shall we assume JDK 1.9 command line switches?
- * @return true if JDK 1.9
+ * Shall we assume JDK 9 command line switches?
+ * @return true if JDK 9
* @since Ant 1.9.4
+ * @deprecated use #assumeJava9 instead
*/
protected boolean assumeJava19() {
- return assumeJavaXY("javac1.9", JavaEnvUtils.JAVA_1_9);
+ return assumeJavaXY("javac1.9", JavaEnvUtils.JAVA_9)
+ || assumeJavaXY("javac9", JavaEnvUtils.JAVA_9);
+ }
+
+ /**
+ * Shall we assume JDK 9 command line switches?
+ * @return true if JDK 9
+ * @since Ant 1.9.8
+ */
+ protected boolean assumeJava9() {
+ return assumeJava19();
}
/**
@@ -686,12 +697,10 @@ public abstract class DefaultCompilerAdapter
*/
private boolean assumeJavaXY(final String javacXY, final String javaEnvVersionXY) {
return javacXY.equals(attributes.getCompilerVersion())
- || ("classic".equals(attributes.getCompilerVersion())
- && JavaEnvUtils.isJavaVersion(javaEnvVersionXY))
- || ("modern".equals(attributes.getCompilerVersion())
- && JavaEnvUtils.isJavaVersion(javaEnvVersionXY))
- || ("extJavac".equals(attributes.getCompilerVersion())
- && JavaEnvUtils.isJavaVersion(javaEnvVersionXY));
+ || (JavaEnvUtils.isJavaVersion(javaEnvVersionXY) &&
+ ("classic".equals(attributes.getCompilerVersion())
+ || "modern".equals(attributes.getCompilerVersion())
+ || "extJavac".equals(attributes.getCompilerVersion())));
}
/**
@@ -755,8 +764,8 @@ public abstract class DefaultCompilerAdapter
if (assumeJava18()) {
return "1.8 in JDK 1.8";
}
- if (assumeJava19()) {
- return "1.9 in JDK 1.9";
+ if (assumeJava9()) {
+ return "9 in JDK 9";
}
return "";
}
@@ -782,7 +791,7 @@ public abstract class DefaultCompilerAdapter
&& !assumeJava15() && !assumeJava16())
|| (t.equals("7") && !assumeJava17())
|| (t.equals("8") && !assumeJava18())
- || (t.equals("9") && !assumeJava19());
+ || (t.equals("9") && !assumeJava9());
}
http://git-wip-us.apache.org/repos/asf/ant/blob/625d3d37/src/main/org/apache/tools/ant/util/JavaEnvUtils.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/util/JavaEnvUtils.java b/src/main/org/apache/tools/ant/util/JavaEnvUtils.java
index 4f244da..a551c0f 100644
--- a/src/main/org/apache/tools/ant/util/JavaEnvUtils.java
+++ b/src/main/org/apache/tools/ant/util/JavaEnvUtils.java
@@ -55,6 +55,9 @@ public final class JavaEnvUtils {
/** floating version of the JVM */
private static int javaVersionNumber;
+ /** Version of currently running VM. */
+ private static final DeweyDecimal parsedJavaVersion;
+
/** Version constant for Java 1.0 */
public static final String JAVA_1_0 = "1.0";
/** Number Version constant for Java 1.0 */
@@ -100,11 +103,28 @@ public final class JavaEnvUtils {
/** Number Version constant for Java 1.8 */
public static final int VERSION_1_8 = 18;
- /** Version constant for Java 1.9 */
+ /**
+ * Version constant for Java 1.9
+ * @deprecated use #JAVA_9 instead
+ */
public static final String JAVA_1_9 = "1.9";
- /** Number Version constant for Java 1.9 */
+ /**
+ * Number Version constant for Java 1.9
+ * @deprecated use #VERSION_9 instead
+ */
public static final int VERSION_1_9 = 19;
+ /**
+ * Version constant for Java 9
+ * @since Ant 1.9.8
+ */
+ public static final String JAVA_9 = "9";
+ /**
+ * Number Version constant for Java 9
+ * @since Ant 1.9.8
+ */
+ public static final int VERSION_9 = 90;
+
/** Whether this is the Kaffe VM */
private static boolean kaffeDetected;
@@ -158,13 +178,14 @@ public final class JavaEnvUtils {
Class.forName("java.lang.reflect.Executable");
javaVersion = JAVA_1_8;
javaVersionNumber++;
- checkForJava9();
- javaVersion = JAVA_1_9;
- javaVersionNumber++;
+ Class.forName("java.lang.module.ModuleDescriptor");
+ javaVersion = JAVA_9;
+ javaVersionNumber = VERSION_9;
} catch (Throwable t) {
// swallow as we've hit the max class version that
// we have
}
+ parsedJavaVersion = new DeweyDecimal(javaVersion);
kaffeDetected = false;
try {
Class.forName("kaffe.util.NotImplemented");
@@ -197,7 +218,11 @@ public final class JavaEnvUtils {
/**
* Returns the version of Java this class is running under.
- * @return the version of Java as a String, e.g. "1.6"
+ *
+ * <p>Up until Java 8 Java version numbers were 1.VERSION -
+ * e.g. 1.8.x for Java 8, starting with Java 9 it became 9.x.</p>
+ *
+ * @return the version of Java as a String, e.g. "1.6" or "9"
*/
public static String getJavaVersion() {
return javaVersion;
@@ -205,31 +230,28 @@ public final class JavaEnvUtils {
/**
- * Checks for a give Java 9 runtime.
- * At the time of writing the actual version of the JDK was 1.9.0_b06.
- * Searching for new classes gave no hits, so we need another aproach.
- * Searching for changes (grep -r -i -n "@since 1.9" .) in the sources gave
- * only one hit: a new constant in the class SourceVersion.
- * So we have to check that ...
- *
- * @throws Exception if we can't load the class or don't find the new constant.
- * This is the behavior when searching for new features on older versions.
- * @since Ant 1.9.4
+ * Returns the version of Java this class is running under.
+ * <p>This number can be used for comparisons.</p>
+ * @return the version of Java as a number 10x the major/minor,
+ * e.g Java1.5 has a value of 15 and Java9 the value 90 - major
+ * will be 1 for all versions of Java prior to Java 9, minor will
+ * be 0 for all versions of Java starting with Java 9.
+ * @deprecated use #getParsedJavaVersion instead
*/
- private static void checkForJava9() throws Exception {
- Class<?> clazz = Class.forName("javax.lang.model.SourceVersion");
- clazz.getDeclaredField("RELEASE_9");
+ public static int getJavaVersionNumber() {
+ return javaVersionNumber;
}
-
/**
* Returns the version of Java this class is running under.
- * This number can be used for comparisons; it will always be
- * @return the version of Java as a number 10x the major/minor,
- * e.g Java1.5 has a value of 15
+ * <p>This number can be used for comparisons.</p>
+ * @return the version of Java as major.minor, e.g Java1.5 has a
+ * value of 1.5 and Java9 the value 9 - major will be 1 for all
+ * versions of Java prior to Java 9, minor will be 0 for all
+ * versions of Java starting with Java 9.
*/
- public static int getJavaVersionNumber() {
- return javaVersionNumber;
+ public static DeweyDecimal getParsedJavaVersion() {
+ return parsedJavaVersion;
}
/**
@@ -243,7 +265,8 @@ public final class JavaEnvUtils {
* @since Ant 1.5
*/
public static boolean isJavaVersion(String version) {
- return javaVersion.equals(version);
+ return javaVersion.equals(version)
+ || (javaVersion.equals(JAVA_9) && JAVA_1_9.equals(version));
}
/**
@@ -258,7 +281,7 @@ public final class JavaEnvUtils {
* @since Ant 1.7
*/
public static boolean isAtLeastJavaVersion(String version) {
- return javaVersion.compareTo(version) >= 0;
+ return parsedJavaVersion.compareTo(new DeweyDecimal(version)) >= 0;
}
/**
@@ -385,7 +408,7 @@ public final class JavaEnvUtils {
// fall back to JRE bin directory, also catches JDK 1.0 and 1.1
// where java.home points to the root of the JDK and Mac OS X where
// the whole directory layout is different from Sun's
- // and also catches JDK 1.9 (and probably later) which
+ // and also catches JDK 9 (and probably later) which
// merged JDK and JRE dirs
return getJreExecutable(command);
}
@@ -427,7 +450,7 @@ public final class JavaEnvUtils {
private static void buildJrePackages() {
jrePackages = new Vector<String>();
switch(javaVersionNumber) {
- case VERSION_1_9:
+ case VERSION_9:
case VERSION_1_8:
case VERSION_1_7:
jrePackages.addElement("jdk");
@@ -482,7 +505,7 @@ public final class JavaEnvUtils {
Vector<String> tests = new Vector<String>();
tests.addElement("java.lang.Object");
switch(javaVersionNumber) {
- case VERSION_1_9:
+ case VERSION_9:
case VERSION_1_8:
case VERSION_1_7:
tests.addElement("jdk.net.Sockets");
http://git-wip-us.apache.org/repos/asf/ant/blob/625d3d37/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 646154d..3064876 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
@@ -186,6 +186,37 @@ public class DefaultCompilerAdapterTest {
}
@Test
+ public void testImplicitSourceForJava9() {
+ commonSourceDowngrades("javac9");
+ testSource("1.5", "javac9",
+ "If you specify -target 1.5 you now must also specify"
+ + " -source 1.5", "1.5");
+ testSource("1.6", "javac1.9",
+ "If you specify -target 1.6 you now must also specify"
+ + " -source 1.6", "1.6");
+ testSource("1.7", "javac9",
+ "If you specify -target 1.7 you now must also specify"
+ + " -source 1.7", "1.7");
+ testSource("1.8", "javac9",
+ "If you specify -target 1.8 you now must also specify"
+ + " -source 1.8", "1.8");
+ testSource("5", "javac9",
+ "If you specify -target 5 you now must also specify"
+ + " -source 5", "5");
+ testSource("6", "javac9",
+ "If you specify -target 6 you now must also specify"
+ + " -source 6", "6");
+ testSource("7", "javac9",
+ "If you specify -target 7 you now must also specify"
+ + " -source 7", "7");
+ testSource("8", "javac9",
+ "If you specify -target 8 you now must also specify"
+ + " -source 8", "8");
+ testSource(null, "javac9", "", "1.9");
+ testSource(null, "javac9", "", "9");
+ }
+
+ @Test
public void testSingleModuleCompilation() throws IOException {
final File workDir = createWorkDir("testSMC");
try {
http://git-wip-us.apache.org/repos/asf/ant/blob/625d3d37/src/tests/junit/org/apache/tools/ant/util/JavaEnvUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/util/JavaEnvUtilsTest.java b/src/tests/junit/org/apache/tools/ant/util/JavaEnvUtilsTest.java
index 14387e7..aef4f1b 100644
--- a/src/tests/junit/org/apache/tools/ant/util/JavaEnvUtilsTest.java
+++ b/src/tests/junit/org/apache/tools/ant/util/JavaEnvUtilsTest.java
@@ -116,7 +116,7 @@ public class JavaEnvUtilsTest {
j.startsWith(javaHomeParent));
if ((Os.isFamily("mac") && JavaEnvUtils.getJavaVersionNumber() <= JavaEnvUtils.VERSION_1_6)
- || JavaEnvUtils.isAtLeastJavaVersion(JavaEnvUtils.JAVA_1_9)) {
+ || JavaEnvUtils.isAtLeastJavaVersion(JavaEnvUtils.JAVA_9)) {
assertTrue(j+" is normalized and in the JRE dir",
j.startsWith(javaHome));
} else {
@@ -136,9 +136,6 @@ public class JavaEnvUtilsTest {
assertTrue(
"Current java version is not at least the current java version...",
JavaEnvUtils.isAtLeastJavaVersion(JavaEnvUtils.getJavaVersion()));
- assertFalse(
- "In case the current java version is higher than 9.0 definitely a new algorithem will be needed",
- JavaEnvUtils.isAtLeastJavaVersion("9.0"));
}
}
[2/3] ant git commit: detect Java 9 via jigsaw
Posted by bo...@apache.org.
detect Java 9 via jigsaw
Project: http://git-wip-us.apache.org/repos/asf/ant/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/dda54c69
Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/dda54c69
Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/dda54c69
Branch: refs/heads/1.9.x
Commit: dda54c698d6c7d0dc9c39a102b5d1ac1f2550a3d
Parents: 7c3db4a
Author: Stefan Bodewig <bo...@apache.org>
Authored: Mon Jul 25 12:21:18 2016 +0200
Committer: Stefan Bodewig <bo...@apache.org>
Committed: Mon Jul 25 12:21:18 2016 +0200
----------------------------------------------------------------------
build.xml | 4 +---
src/tests/antunit/antunit-base.xml | 4 +---
src/tests/antunit/taskdefs/javac-test.xml | 20 ++++++++++----------
.../taskdefs/optional/native2ascii-test.xml | 4 ++--
4 files changed, 14 insertions(+), 18 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ant/blob/dda54c69/build.xml
----------------------------------------------------------------------
diff --git a/build.xml b/build.xml
index a502536..eba9fc8 100644
--- a/build.xml
+++ b/build.xml
@@ -378,9 +378,7 @@
<available property="jdk1.6+" classname="java.net.CookieStore"/>
<available property="jdk1.7+" classname="java.nio.file.FileSystem"/>
<available property="jdk1.8+" classname="java.lang.reflect.Executable"/>
- <condition property="jdk1.9+">
- <contains string="${java.version}" substring="1.9."/>
- </condition>
+ <available property="jdk9+" classname="java.lang.module.ModuleDescriptor"/>
<available property="kaffe" classname="kaffe.util.NotImplemented"/>
<available property="harmony"
classname="org.apache.harmony.luni.util.Base64"/>
http://git-wip-us.apache.org/repos/asf/ant/blob/dda54c69/src/tests/antunit/antunit-base.xml
----------------------------------------------------------------------
diff --git a/src/tests/antunit/antunit-base.xml b/src/tests/antunit/antunit-base.xml
index 80b289c..9863f3f 100644
--- a/src/tests/antunit/antunit-base.xml
+++ b/src/tests/antunit/antunit-base.xml
@@ -27,9 +27,7 @@
<property name="test3.jar" location="${antunit.tmpdir}/test3.jar"/>
<property name="test4.jar" location="${antunit.tmpdir}/test4.jar"/>
<property name="test5.jar" location="${antunit.tmpdir}/test5.jar"/>
- <condition property="jdk1.9+">
- <contains string="${java.version}" substring="1.9."/>
- </condition>
+ <available property="jdk9+" classname="java.lang.module.ModuleDescriptor"/>
<available property="jdk1.8+" classname="java.lang.reflect.Executable"/>
<available property="jdk1.7+" classname="java.nio.file.FileSystem"/>
<available property="jdk1.6+" classname="java.net.CookieStore"/>
http://git-wip-us.apache.org/repos/asf/ant/blob/dda54c69/src/tests/antunit/taskdefs/javac-test.xml
----------------------------------------------------------------------
diff --git a/src/tests/antunit/taskdefs/javac-test.xml b/src/tests/antunit/taskdefs/javac-test.xml
index 3c4d848..de193ea 100644
--- a/src/tests/antunit/taskdefs/javac-test.xml
+++ b/src/tests/antunit/taskdefs/javac-test.xml
@@ -213,14 +213,14 @@ public class Adapter implements CompilerAdapter {
<testJavac source="notValid"/>
</au:expectfailure>
- <sequential unless:set="jdk1.9+">
+ <sequential unless:set="jdk9+">
<echo>JDK 1.4+</echo>
<testJavac source="1.4"/>
<delete dir="${javac-dir}/classes"/>
<mkdir dir="${javac-dir}/classes"/>
</sequential>
- <sequential unless:set="jdk1.9+">
+ <sequential unless:set="jdk9+">
<echo>JDK 1.5+</echo>
<testJavac source="1.5"/>
<delete dir="${javac-dir}/classes"/>
@@ -248,9 +248,9 @@ public class Adapter implements CompilerAdapter {
<mkdir dir="${javac-dir}/classes"/>
</sequential>
- <sequential if:set="jdk1.9+">
- <echo>JDK 1.9+</echo>
- <testJavac source="1.9"/>
+ <sequential if:set="jdk9+">
+ <echo>JDK 9+</echo>
+ <testJavac source="9"/>
<delete dir="${javac-dir}/classes"/>
<mkdir dir="${javac-dir}/classes"/>
</sequential>
@@ -271,14 +271,14 @@ public class Adapter implements CompilerAdapter {
<testJavac target="notValid"/>
</au:expectfailure>
- <sequential unless:set="jdk1.9+">
+ <sequential unless:set="jdk9+">
<echo>JDK 1.4+</echo>
<testJavac source="1.4" target="1.4"/>
<delete dir="${javac-dir}/classes"/>
<mkdir dir="${javac-dir}/classes"/>
</sequential>
- <sequential unless:set="jdk1.9+">
+ <sequential unless:set="jdk9+">
<echo>JDK 1.5+</echo>
<testJavac source="1.5" target="1.5"/>
<delete dir="${javac-dir}/classes"/>
@@ -306,9 +306,9 @@ public class Adapter implements CompilerAdapter {
<mkdir dir="${javac-dir}/classes"/>
</sequential>
- <sequential if:set="jdk1.9+">
- <echo>JDK 1.9+</echo>
- <testJavac source="1.9" target="1.9"/>
+ <sequential if:set="jdk9+">
+ <echo>JDK 9+</echo>
+ <testJavac source="9" target="9"/>
<delete dir="${javac-dir}/classes"/>
<mkdir dir="${javac-dir}/classes"/>
</sequential>
http://git-wip-us.apache.org/repos/asf/ant/blob/dda54c69/src/tests/antunit/taskdefs/optional/native2ascii-test.xml
----------------------------------------------------------------------
diff --git a/src/tests/antunit/taskdefs/optional/native2ascii-test.xml b/src/tests/antunit/taskdefs/optional/native2ascii-test.xml
index be521de..560ead3 100644
--- a/src/tests/antunit/taskdefs/optional/native2ascii-test.xml
+++ b/src/tests/antunit/taskdefs/optional/native2ascii-test.xml
@@ -97,7 +97,7 @@ public class Adapter implements Native2AsciiAdapter {
<target name="testUTF8-To-ASCII-sun" depends="-setup-UTF8-To-ASCII"
description="https://bz.apache.org/bugzilla/show_bug.cgi?id=59855"
- unless="jdk1.9+">
+ unless="jdk9+">
<native2ascii-def implementation="sun"/>
<assertTranslatedOutput file="umlauts.properties" encoding="ASCII"
expected="${umlauts.expected}"/>
@@ -119,7 +119,7 @@ public class Adapter implements Native2AsciiAdapter {
<target name="testASCII-To-UTF8-sun" depends="-setup-ASCII-To-UTF8"
description="https://bz.apache.org/bugzilla/show_bug.cgi?id=59855"
- unless="jdk1.9+">
+ unless="jdk9+">
<native2ascii-def implementation="sun" reverse="true"/>
<assertTranslatedOutput file="umlauts.properties" encoding="UTF-8"
expected="${umlauts.expected}"/>