ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs/compilers DefaultCompilerAdapter.java
Date Wed, 19 Jun 2002 15:46:09 GMT
bodewig     2002/06/19 08:46:09

  Modified:    .        Tag: ANT_15_BRANCH WHATSNEW
               src/main/org/apache/tools/ant/taskdefs/compilers Tag:
                        ANT_15_BRANCH DefaultCompilerAdapter.java
  Log:
  Dont pass -source to JDK 1.3's javac
  
  Reported by:	James Macgill <j.macgill@geography.leeds.ac.uk> via
                  dIon Gillard <dion@multitask.com.au>
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.263.2.49 +3 -0      jakarta-ant/WHATSNEW
  
  Index: WHATSNEW
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/WHATSNEW,v
  retrieving revision 1.263.2.48
  retrieving revision 1.263.2.49
  diff -u -r1.263.2.48 -r1.263.2.49
  --- WHATSNEW	14 Jun 2002 16:26:15 -0000	1.263.2.48
  +++ WHATSNEW	19 Jun 2002 15:46:09 -0000	1.263.2.49
  @@ -49,6 +49,9 @@
   
   * IPlanetEjbc was looking in the wrong place for four iiop files.
   
  +* <javac> would pass the -source switch to JDK 1.3's javac, even
  +  though it doesn't support it.
  +
   Other changes:
   --------------
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.28.2.4  +15 -1     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java
  
  Index: DefaultCompilerAdapter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/compilers/DefaultCompilerAdapter.java,v
  retrieving revision 1.28.2.3
  retrieving revision 1.28.2.4
  diff -u -r1.28.2.3 -r1.28.2.4
  --- DefaultCompilerAdapter.java	12 Jun 2002 14:34:17 -0000	1.28.2.3
  +++ DefaultCompilerAdapter.java	19 Jun 2002 15:46:09 -0000	1.28.2.4
  @@ -335,7 +335,7 @@
        */
       protected Commandline setupModernJavacCommandlineSwitches(Commandline cmd) {
           setupJavacCommandlineSwitches(cmd, true);
  -        if (attributes.getSource() != null) {
  +        if (attributes.getSource() != null && !assumeJava13()) {
               cmd.createArgument().setValue("-source");
               cmd.createArgument().setValue(attributes.getSource());
           }
  @@ -498,6 +498,20 @@
                && JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_2)) ||
               ("extJavac".equals(attributes.getCompilerVersion()) 
                && JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_2));
  +    }
  +
  +    /**
  +     * Shall we assume JDK 1.3 command line switches?
  +     * @since Ant 1.5
  +     */
  +    protected boolean assumeJava13() {
  +        return "javac1.3".equals(attributes.getCompilerVersion()) ||
  +            ("classic".equals(attributes.getCompilerVersion()) 
  +             && JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_3)) ||
  +            ("modern".equals(attributes.getCompilerVersion()) 
  +             && JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_3)) ||
  +            ("extJavac".equals(attributes.getCompilerVersion()) 
  +             && JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_3));
       }
   
   }
  
  
  

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


Mime
View raw message