You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bo...@apache.org on 2004/01/07 17:49:30 UTC

cvs commit: ant/src/main/org/apache/tools/ant/util JavaEnvUtils.java

bodewig     2004/01/07 08:49:30

  Modified:    docs/manual/CoreTasks javac.html
               src/main/org/apache/tools/ant/taskdefs Javac.java
               src/main/org/apache/tools/ant/taskdefs/compilers
                        CompilerAdapterFactory.java
                        DefaultCompilerAdapter.java
               src/main/org/apache/tools/ant/util JavaEnvUtils.java
  Log:
  Very initial JDK 1.5 support
  
  Revision  Changes    Path
  1.43      +7 -6      ant/docs/manual/CoreTasks/javac.html
  
  Index: javac.html
  ===================================================================
  RCS file: /home/cvs/ant/docs/manual/CoreTasks/javac.html,v
  retrieving revision 1.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- javac.html	15 Aug 2003 09:11:47 -0000	1.42
  +++ javac.html	7 Jan 2004 16:49:30 -0000	1.43
  @@ -52,9 +52,10 @@
     <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) &ndash;
  +  <li><code>modern</code> (the standard compiler of JDK 1.3/1.4/1.5) &ndash;
         <code>javac1.3</code> and
  -      <code>javac1.4</code> can be used as aliases.</li>
  +      <code>javac1.4</code> and
  +      <code>javac1.5</code> can be used as aliases.</li>
     <li><code>jikes</code> (the <a
       href="http://oss.software.ibm.com/developerworks/opensource/jikes/" target="_top">Jikes</a>
       compiler).</li>
  @@ -235,7 +236,7 @@
       <td valign="top">Generate class files for specific VM version
       (e.g., <code>1.1</code> or <code>1.2</code>). <b>Note that the
       default value depends on the JVM that is running Ant.  In
  -    particular, if you use JDK 1.4 the generated classes will not be
  +    particular, if you use JDK 1.4+ the generated classes will not be
       usable for a 1.1 Java VM unless you explicitly set this attribute
       to the value 1.1 (which is the default value for JDK 1.1 to
       1.3).</b></td>
  @@ -310,12 +311,12 @@
       <td valign="top">source</td>
   
       <td valign="top">Value of the <code>-source</code> command-line
  -    switch; will be ignored by all implementations except
  +    switch; will be ignored by all implementations prior to
       <code>javac1.4</code> (or <code>modern</code> when Ant is not
       running in a 1.3 VM) and <code>jikes</code>.<br> If you use this
       attribute together with <code>jikes</code>, you must make sure
       that your version of jikes supports the <code>-source</code>
  -    switch.<br> Legal values are <code>1.3</code> and <code>1.4</code>
  +    switch.<br> Legal values are <code>1.3</code>, <code>1.4</code> and <code>1.5</code>
       &ndash; by default, no <code>-source</code> argument will be used
       at all.</td>
   
  @@ -594,7 +595,7 @@
   <code>&lt;javac&gt;</code>.</p>
   
   <hr>
  -<p align="center">Copyright &copy; 2000-2003 Apache Software Foundation.
  +<p align="center">Copyright &copy; 2000-2004 Apache Software Foundation.
   All rights Reserved.</p>
   
   </body>
  
  
  
  1.116     +8 -5      ant/src/main/org/apache/tools/ant/taskdefs/Javac.java
  
  Index: Javac.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Javac.java,v
  retrieving revision 1.115
  retrieving revision 1.116
  diff -u -r1.115 -r1.116
  --- Javac.java	16 Sep 2003 09:08:55 -0000	1.115
  +++ Javac.java	7 Jan 2004 16:49:30 -0000	1.116
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
  + * Copyright (c) 2000-2004 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -155,6 +155,8 @@
               facade = new FacadeTaskHelper("javac1.3");
           } else if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_4)) {
               facade = new FacadeTaskHelper("javac1.4");
  +        } else if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_5)) {
  +            facade = new FacadeTaskHelper("javac1.5");
           } else {
               facade = new FacadeTaskHelper("classic");
           }
  @@ -198,7 +200,7 @@
        *
        * 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 and 1.4 - by default, no -source argument
  +     * Legal values are 1.3, 1.4 and 1.5 - by default, no -source argument
        * will be used at all.
        *
        * @param v  Value to assign to source.
  @@ -845,7 +847,7 @@
        *
        * @param compilerImpl the name of the compiler implementation
        * @return true if compilerImpl is "modern", "classic", "javac1.1",
  -     *                 "javac1.2", "javac1.3" or "javac1.4".
  +     *                 "javac1.2", "javac1.3", "javac1.4" or "javac1.5".
        */
       protected boolean isJdkCompiler(String compilerImpl) {
           return "modern".equals(compilerImpl)
  @@ -853,7 +855,8 @@
               || "javac1.1".equals(compilerImpl)
               || "javac1.2".equals(compilerImpl)
               || "javac1.3".equals(compilerImpl)
  -            || "javac1.4".equals(compilerImpl);
  +            || "javac1.4".equals(compilerImpl)
  +            || "javac1.5".equals(compilerImpl);
       }
   
       /**
  
  
  
  1.22      +7 -4      ant/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapterFactory.java
  
  Index: CompilerAdapterFactory.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapterFactory.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- CompilerAdapterFactory.java	16 Sep 2003 09:08:57 -0000	1.21
  +++ CompilerAdapterFactory.java	7 Jan 2004 16:49:30 -0000	1.22
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2001-2003 The Apache Software Foundation.  All rights
  + * Copyright (c) 2001-2004 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -80,7 +80,7 @@
        * <ul><li>jikes = jikes compiler
        * <li>classic, javac1.1, javac1.2 = the standard compiler from JDK
        * 1.1/1.2
  -     * <li>modern, javac1.3, javac1.4 = the compiler of JDK 1.3+
  +     * <li>modern, javac1.3, javac1.4, javac1.5 = the compiler of JDK 1.3+
        * <li>jvc, microsoft = the command line compiler from Microsoft's SDK
        * for Java / Visual J++
        * <li>kjc = the kopi compiler</li>
  @@ -100,7 +100,9 @@
           throws BuildException {
               boolean isClassicCompilerSupported = true;
               //as new versions of java come out, add them to this test
  -            if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_4)) {
  +            if (!JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_1)
  +                && !JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_2)
  +                && !JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_3)) {
                   isClassicCompilerSupported = false;
               }
   
  @@ -127,7 +129,8 @@
               //but on java>=1.4 we just bail out early
               if (compilerType.equalsIgnoreCase("modern")
                   || compilerType.equalsIgnoreCase("javac1.3")
  -                || compilerType.equalsIgnoreCase("javac1.4")) {
  +                || compilerType.equalsIgnoreCase("javac1.4")
  +                || compilerType.equalsIgnoreCase("javac1.5")) {
                   // does the modern compiler exist?
                   if (doesModernCompilerExist()) {
                       return new Javac13();
  
  
  
  1.43      +1 -1      ant/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java
  
  Index: DefaultCompilerAdapter.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java,v
  retrieving revision 1.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- DefaultCompilerAdapter.java	14 Oct 2003 13:19:52 -0000	1.42
  +++ DefaultCompilerAdapter.java	7 Jan 2004 16:49:30 -0000	1.43
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2001-2003 The Apache Software Foundation.  All rights
  + * Copyright (c) 2001-2004 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  
  
  
  1.16      +9 -1      ant/src/main/org/apache/tools/ant/util/JavaEnvUtils.java
  
  Index: JavaEnvUtils.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/util/JavaEnvUtils.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- JavaEnvUtils.java	19 Jul 2003 08:11:08 -0000	1.15
  +++ JavaEnvUtils.java	7 Jan 2004 16:49:30 -0000	1.16
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights
  + * Copyright (c) 2002-2004 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -96,6 +96,8 @@
       public static final String JAVA_1_3 = "1.3";
       /** Version constant for Java 1.4 */
       public static final String JAVA_1_4 = "1.4";
  +    /** Version constant for Java 1.5 */
  +    public static final String JAVA_1_5 = "1.5";
   
       /** array of packages in the runtime */
       private static Vector jrePackages;
  @@ -104,6 +106,7 @@
       static {
   
           // Determine the Java version by looking at available classes
  +        // java.lang.Readable was introduced in JDK 1.5
           // java.lang.CharSequence was introduced in JDK 1.4
           // java.lang.StrictMath was introduced in JDK 1.3
           // java.lang.ThreadLocal was introduced in JDK 1.2
  @@ -125,6 +128,9 @@
               Class.forName("java.lang.CharSequence");
               javaVersion = JAVA_1_4;
               javaVersionNumber++;
  +            Class.forName("java.lang.Readable");
  +            javaVersion = JAVA_1_5;
  +            javaVersionNumber++;
           } catch (Throwable t) {
               // swallow as we've hit the max class version that
               // we have
  @@ -275,6 +281,7 @@
       private static void buildJrePackages() {
           jrePackages = new Vector();
           switch(javaVersionNumber) {
  +            case 15:
               case 14:
                   jrePackages.addElement("org.apache.crimson");
                   jrePackages.addElement("org.apache.xalan");
  @@ -317,6 +324,7 @@
           Vector tests = new Vector();
           tests.addElement("java.lang.Object");
           switch(javaVersionNumber) {
  +            case 15:
               case 14:
                   tests.addElement("sun.audio.AudioPlayer");
                   tests.addElement("org.apache.crimson.parser.ContentModel");
  
  
  

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


Re: cvs commit: ant/src/main/org/apache/tools/ant/util JavaEnvUtils.java

Posted by Stefan Bodewig <bo...@apache.org>.
On 7 Jan 2004, <bo...@apache.org> wrote:

>   Very initial JDK 1.5 support

I intend to merge this into the 1.6 branch when done.

"done" here means that I at least want to look into changes to javac
and javadoc (related to generics and potentially metadata).  Right now
the patch assumes that javac is the same as the one for 1.4 which is
certainly wrong.

Stefan

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