ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r382927 - in /ant/core/trunk: ./ docs/manual/CoreTasks/ src/main/org/apache/tools/ant/taskdefs/ src/main/org/apache/tools/ant/taskdefs/compilers/ src/main/org/apache/tools/ant/util/
Date Fri, 03 Mar 2006 20:56:54 GMT
Author: bodewig
Date: Fri Mar  3 12:56:53 2006
New Revision: 382927

URL: http://svn.apache.org/viewcvs?rev=382927&view=rev
Log:
preliminary Mustang support

Modified:
    ant/core/trunk/build.xml
    ant/core/trunk/docs/manual/CoreTasks/javac.html
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Javac.java
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java
    ant/core/trunk/src/main/org/apache/tools/ant/util/JavaEnvUtils.java

Modified: ant/core/trunk/build.xml
URL: http://svn.apache.org/viewcvs/ant/core/trunk/build.xml?rev=382927&r1=382926&r2=382927&view=diff
==============================================================================
--- ant/core/trunk/build.xml (original)
+++ ant/core/trunk/build.xml Fri Mar  3 12:56:53 2006
@@ -398,6 +398,7 @@
     <available property="jdk1.3+" classname="java.lang.StrictMath"/>
     <available property="jdk1.4+" classname="java.lang.CharSequence"/>
     <available property="jdk1.5+" classname="java.lang.Readable"/>
+    <available property="jdk1.6+" classname="java.util.Service"/>
     <available property="kaffe" classname="kaffe.util.NotImplemented"/>
     <available property="bsf.present"
       classname="org.apache.bsf.BSFManager"

Modified: ant/core/trunk/docs/manual/CoreTasks/javac.html
URL: http://svn.apache.org/viewcvs/ant/core/trunk/docs/manual/CoreTasks/javac.html?rev=382927&r1=382926&r2=382927&view=diff
==============================================================================
--- ant/core/trunk/docs/manual/CoreTasks/javac.html (original)
+++ ant/core/trunk/docs/manual/CoreTasks/javac.html Fri Mar  3 12:56:53 2006
@@ -53,10 +53,11 @@
   <li><code>classic</code> (the standard compiler of JDK 1.1/1.2) &ndash;
       <code>javac1.1</code> and
       <code>javac1.2</code> can be used as aliases.</li>
-  <li><code>modern</code> (the standard compiler of JDK 1.3/1.4/1.5) &ndash;
+  <li><code>modern</code> (the standard compiler of JDK 1.3/1.4/1.5/1.6)
&ndash;
       <code>javac1.3</code> and
       <code>javac1.4</code> and
-      <code>javac1.5</code> can be used as aliases.</li>
+      <code>javac1.5</code> and
+      <code>javac1.6</code> can be used as aliases.</li>
   <li><code>jikes</code> (the <a
     href="http://jikes.sourceforge.net/" target="_top">Jikes</a>
     compiler).</li>
@@ -613,7 +614,7 @@
 <code>&lt;javac&gt;</code>.</p>
 
 <hr>
-<p align="center">Copyright &copy; 2000-2005 The Apache Software Foundation.
+<p align="center">Copyright &copy; 2000-2006 The Apache Software Foundation.
 All rights Reserved.</p>
 
 </body>

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Javac.java
URL: http://svn.apache.org/viewcvs/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Javac.java?rev=382927&r1=382926&r2=382927&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Javac.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Javac.java Fri Mar  3 12:56:53 2006
@@ -1,5 +1,5 @@
 /*
- * Copyright  2000-2005 The Apache Software Foundation
+ * Copyright  2000-2006 The Apache Software Foundation
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -69,6 +69,7 @@
     private static final String FAIL_MSG
         = "Compile failed; see the compiler error output for details.";
 
+    private static final String JAVAC16 = "javac1.6";
     private static final String JAVAC15 = "javac1.5";
     private static final String JAVAC14 = "javac1.4";
     private static final String JAVAC13 = "javac1.3";
@@ -126,6 +127,8 @@
             return JAVAC14;
         } else if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_5)) {
             return JAVAC15;
+        } else if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_6)) {
+            return JAVAC16;
         } else {
             return CLASSIC;
         }
@@ -167,10 +170,10 @@
      * Value of the -source command-line switch; will be ignored
      * by all implementations except modern and jikes.
      *
-     * If you use this attribute together with jikes, you must
-     * make sure that your version of jikes supports the -source switch.
-     * Legal values are 1.3, 1.4 and 1.5 - by default, no -source argument
-     * will be used at all.
+     * If you use this attribute together with jikes, you must make
+     * sure that your version of jikes supports the -source switch.
+     * Legal values are 1.3, 1.4, 1.5, and 5 - by default, no
+     * -source argument will be used at all.
      *
      * @param v  Value to assign to source.
      */
@@ -573,7 +576,7 @@
     /**
      * Sets the target VM that the classes will be compiled for. Valid
      * values depend on the compiler, for jdk 1.4 the valid values are
-     * "1.1", "1.2", "1.3", "1.4" and "1.5".
+     * "1.1", "1.2", "1.3", "1.4", "1.5", "1.6", "5" and "6".
      * @param target the target VM
      */
     public void setTarget(String target) {
@@ -735,7 +738,8 @@
     }
 
     private String getAltCompilerName(String anImplementation) {
-        if (JAVAC15.equalsIgnoreCase(anImplementation)
+        if (JAVAC16.equalsIgnoreCase(anImplementation)
+                || JAVAC15.equalsIgnoreCase(anImplementation)
                 || JAVAC14.equalsIgnoreCase(anImplementation)
                 || JAVAC13.equalsIgnoreCase(anImplementation)) {
             return MODERN;
@@ -746,7 +750,8 @@
         }
         if (MODERN.equalsIgnoreCase(anImplementation)) {
             String nextSelected = assumedJavaVersion();
-            if (JAVAC15.equalsIgnoreCase(nextSelected)
+            if (JAVAC16.equalsIgnoreCase(nextSelected)
+                    || JAVAC15.equalsIgnoreCase(nextSelected)
                     || JAVAC14.equalsIgnoreCase(nextSelected)
                     || JAVAC13.equalsIgnoreCase(nextSelected)) {
                 return nextSelected;
@@ -854,12 +859,14 @@
      * Is the compiler implementation a jdk compiler
      *
      * @param compilerImpl the name of the compiler implementation
-     * @return true if compilerImpl is "modern", "classic", "javac1.1",
-     *                 "javac1.2", "javac1.3", "javac1.4" or "javac1.5".
+     * @return true if compilerImpl is "modern", "classic",
+     * "javac1.1", "javac1.2", "javac1.3", "javac1.4", "javac1.5" or
+     * "javac1.6".
      */
     protected boolean isJdkCompiler(String compilerImpl) {
         return MODERN.equals(compilerImpl)
             || CLASSIC.equals(compilerImpl)
+            || JAVAC16.equals(compilerImpl)
             || JAVAC15.equals(compilerImpl)
             || JAVAC14.equals(compilerImpl)
             || JAVAC13.equals(compilerImpl)

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java
URL: http://svn.apache.org/viewcvs/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java?rev=382927&r1=382926&r2=382927&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java
Fri Mar  3 12:56:53 2006
@@ -1,5 +1,5 @@
 /*
- * Copyright  2001-2005 The Apache Software Foundation
+ * Copyright  2001-2006 The Apache Software Foundation
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -322,7 +322,8 @@
             } else {
                 cmd.createArgument().setValue(source);
             }
-        } else if (assumeJava15() && attributes.getTarget() != null) {
+        } else if ((assumeJava15() || assumeJava16())
+                   && attributes.getTarget() != null) {
             String t = attributes.getTarget();
             if (t.equals("1.1") || t.equals("1.2") || t.equals("1.3")
                 || t.equals("1.4")) {
@@ -334,7 +335,7 @@
                 attributes.log("", Project.MSG_WARN);
                 attributes.log("          WARNING", Project.MSG_WARN);
                 attributes.log("", Project.MSG_WARN);
-                attributes.log("The -source switch defaults to 1.5 in JDK 1.5.",
+                attributes.log("The -source switch defaults to 1.5 in JDK 1.5 and 1.6.",
                                Project.MSG_WARN);
                 attributes.log("If you specify -target " + t
                                + " you now must also specify -source " + s
@@ -588,6 +589,21 @@
                 && JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_5))
             || ("extJavac".equals(attributes.getCompilerVersion())
                 && JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_5));
+    }
+
+    /**
+     * Shall we assume JDK 1.6 command line switches?
+     * @return true if JDK 1.6
+     * @since Ant 1.7
+     */
+    protected boolean assumeJava16() {
+        return "javac1.6".equals(attributes.getCompilerVersion())
+            || ("classic".equals(attributes.getCompilerVersion())
+                && JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_6))
+            || ("modern".equals(attributes.getCompilerVersion())
+                && JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_6))
+            || ("extJavac".equals(attributes.getCompilerVersion())
+                && JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_6));
     }
 
     /**

Modified: ant/core/trunk/src/main/org/apache/tools/ant/util/JavaEnvUtils.java
URL: http://svn.apache.org/viewcvs/ant/core/trunk/src/main/org/apache/tools/ant/util/JavaEnvUtils.java?rev=382927&r1=382926&r2=382927&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 Fri Mar  3 12:56:53
2006
@@ -1,5 +1,5 @@
 /*
- * Copyright  2002-2005 The Apache Software Foundation
+ * Copyright  2002-2006 The Apache Software Foundation
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -66,6 +66,8 @@
     public static final String JAVA_1_4 = "1.4";
     /** Version constant for Java 1.5 */
     public static final String JAVA_1_5 = "1.5";
+    /** Version constant for Java 1.6 */
+    public static final String JAVA_1_6 = "1.6";
 
     /** Whether this is the Kaffe VM */
     private static boolean kaffeDetected;
@@ -102,6 +104,9 @@
             Class.forName("java.lang.Readable");
             javaVersion = JAVA_1_5;
             javaVersionNumber++;
+            Class.forName("java.util.Service");
+            javaVersion = JAVA_1_6;
+            javaVersionNumber++;
         } catch (Throwable t) {
             // swallow as we've hit the max class version that
             // we have
@@ -284,6 +289,7 @@
     private static void buildJrePackages() {
         jrePackages = new Vector();
         switch(javaVersionNumber) {
+            case 16:
             case 15:
                 //In Java1.5, the apache stuff moved. 
                 jrePackages.addElement("com.sun.org.apache");
@@ -333,6 +339,7 @@
         Vector tests = new Vector();
         tests.addElement("java.lang.Object");
         switch(javaVersionNumber) {
+            case 16:
             case 15:
                 tests.addElement("com.sun.org.apache.xerces.internal.jaxp.datatype.DatatypeFactoryImpl
");
             case 14:



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message