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 CompilerAdapterFactory.java
Date Tue, 07 Aug 2001 11:53:43 GMT
bodewig     01/08/07 04:53:43

  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
  Log:
  Ignore fork attribute if build.compiler doesn't point to a JDK javac.
  
  Submitted by:	Brian Deitte <bdeitte@macromedia.com>
  
  Revision  Changes    Path
  1.10      +4 -2      jakarta-ant/docs/manual/CoreTasks/javac.html
  
  Index: javac.html
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/docs/manual/CoreTasks/javac.html,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- javac.html	2001/08/06 09:04:25	1.9
  +++ javac.html	2001/08/07 11:53:42	1.10
  @@ -31,8 +31,10 @@
   <p>It is possible to use different compilers. This can be selected with the
   &quot;build.compiler&quot; property. There are four choices:</p>
   <ul>
  -  <li>classic (the standard compiler of JDK 1.1/1.2)</li>
  -  <li>modern (the new compiler of JDK 1.3)</li>
  +  <li>classic (the standard compiler of JDK 1.1/1.2) - javac1.1 and
  +     javac1.2 can be used as aliases</li>
  +  <li>modern (the standard compiler of JDK 1.3/1.4) - javac1.3 and
  +     javac1.4 can be used as aliases</li>
     <li>jikes (the <a
       href="http://oss.software.ibm.com/developerworks/opensource/jikes/project" target="_top">Jikes</a>
       compiler)</li>
  
  
  
  1.67      +21 -3     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Javac.java
  
  Index: Javac.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Javac.java,v
  retrieving revision 1.66
  retrieving revision 1.67
  diff -u -r1.66 -r1.67
  --- Javac.java	2001/08/03 14:36:48	1.66
  +++ Javac.java	2001/08/07 11:53:43	1.67
  @@ -450,9 +450,18 @@
   	
   	if (fork) {
   	    if (compiler != null) {
  -		log("Since fork is true, ignoring build.compiler setting.", Project.MSG_WARN);
  -	    }	    
  -	    compiler = "extJavac";
  +                if (isJdkCompiler(compiler)) {
  +                    log("Since fork is true, ignoring build.compiler setting.",
  +                        Project.MSG_WARN);
  +                    compiler = "extJavac";
  +                }
  +                else {
  +                    log("Since build.compiler setting isn't classic or modern, ignoring
fork setting.", Project.MSG_WARN);
  +                }
  +	    }
  +            else {
  +                compiler = "extJavac";
  +            }
   	} 
   
   	if (compiler == null) {
  @@ -520,6 +529,15 @@
       /** Gets the list of files to be compiled. */
       public File[] getFileList() {
           return compileList;
  +    }
  +
  +    protected boolean isJdkCompiler(String compiler) {
  +        return "modern".equals(compiler) ||
  +            "classic".equals(compiler) ||
  +            "javac1.1".equals(compiler) ||
  +            "javac1.2".equals(compiler) ||
  +            "javac1.3".equals(compiler) ||
  +            "javac1.4".equals(compiler);
       }
   
   }
  
  
  
  1.5       +2 -1      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapterFactory.java
  
  Index: CompilerAdapterFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/compilers/CompilerAdapterFactory.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- CompilerAdapterFactory.java	2001/08/06 09:04:26	1.4
  +++ CompilerAdapterFactory.java	2001/08/07 11:53:43	1.5
  @@ -109,7 +109,8 @@
                   return new Javac12();
               }
               if ( compilerType.equalsIgnoreCase("modern") ||
  -                    compilerType.equalsIgnoreCase("javac1.3")) {
  +                    compilerType.equalsIgnoreCase("javac1.3") ||
  +                    compilerType.equalsIgnoreCase("javac1.4")) {
                   // does the modern compiler exist?
                   try {
                       Class.forName("com.sun.tools.javac.Main");
  
  
  

Mime
View raw message