ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r1037607 - /ant/core/trunk/src/main/org/apache/tools/ant/util/JavaEnvUtils.java
Date Mon, 22 Nov 2010 05:29:44 GMT
Author: bodewig
Date: Mon Nov 22 05:29:43 2010
New Revision: 1037607

URL: http://svn.apache.org/viewvc?rev=1037607&view=rev
Log:
detect Java7 features

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/util/JavaEnvUtils.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/util/JavaEnvUtils.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/util/JavaEnvUtils.java?rev=1037607&r1=1037606&r2=1037607&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/util/JavaEnvUtils.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/util/JavaEnvUtils.java Mon Nov 22 05:29:43
2010
@@ -89,6 +89,11 @@ public final class JavaEnvUtils {
     /** Number Version constant for Java 1.6 */
     public static final int VERSION_1_6 = 16;
 
+    /** Version constant for Java 1.7 */
+    public static final String JAVA_1_7 = "1.7";
+    /** Number Version constant for Java 1.7 */
+    public static final int VERSION_1_7 = 17;
+
     /** Whether this is the Kaffe VM */
     private static boolean kaffeDetected;
     /** Whether this is the GNU VM (gcj/gij) */
@@ -132,6 +137,9 @@ public final class JavaEnvUtils {
             Class.forName("java.util.ServiceLoader");
             javaVersion = JAVA_1_6;
             javaVersionNumber++;
+            Class.forName("java.nio.file.FileSystem");
+            javaVersion = JAVA_1_7;
+            javaVersionNumber++;
         } catch (Throwable t) {
             // swallow as we've hit the max class version that
             // we have
@@ -362,6 +370,7 @@ public final class JavaEnvUtils {
     private static void buildJrePackages() {
         jrePackages = new Vector();
         switch(javaVersionNumber) {
+            case VERSION_1_7:
             case VERSION_1_6:
             case VERSION_1_5:
                 //In Java1.5, the apache stuff moved.
@@ -412,6 +421,7 @@ public final class JavaEnvUtils {
         Vector tests = new Vector();
         tests.addElement("java.lang.Object");
         switch(javaVersionNumber) {
+            case VERSION_1_7:
             case VERSION_1_6:
             case VERSION_1_5:
                 tests.addElement(



Mime
View raw message