ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@locus.apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs Javac.java
Date Tue, 19 Sep 2000 16:14:05 GMT
bodewig     00/09/19 09:13:57

  Modified:    docs     index.html
               src/main/org/apache/tools/ant/taskdefs Javac.java
  Log:
  Added verbose and depend attributes to <javac> along with yet another
  undocumented magic property (YAUMP?) build.compiler.fulldepend that
  triggers Jikes' +F option.
  Submitted by:	Sean Brandt <sean@fuzzymagic.com>
  
  Revision  Changes    Path
  1.107     +10 -0     jakarta-ant/docs/index.html
  
  Index: index.html
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/docs/index.html,v
  retrieving revision 1.106
  retrieving revision 1.107
  diff -u -r1.106 -r1.107
  --- index.html	2000/09/19 14:29:40	1.106
  +++ index.html	2000/09/19 16:13:43	1.107
  @@ -2496,6 +2496,16 @@
   	 &quot;1.1&quot; or &quot;1.2&quot;.</td>
       <td align="center" valign="top">No</td>
     </tr>
  +  <tr>
  +    <td valign="top">verbose</td>
  +    <td valign="top">asks the compiler for verbose output.</td>
  +    <td align="center" valign="top">No</td>
  +  </tr>
  +  <tr>
  +    <td valign="top">depend</td> <td valign="top">enables dependency
  +      tracking for compilers that support this (jikes and modern)</td>
  +    <td align="center" valign="top">No</td>
  +  </tr>
   </table>
   
   <h3>Parameters specified as nested elements</h3>
  
  
  
  1.41      +47 -13    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.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- Javac.java	2000/09/19 06:50:11	1.40
  +++ Javac.java	2000/09/19 16:13:51	1.41
  @@ -77,6 +77,8 @@
    * <li>debug
    * <li>encoding
    * <li>target
  + * <li>depend
  + * <li>vebose
    * </ul>
    * Of these arguments, the <b>sourcedir</b> and <b>destdir</b>
are required.
    * <p>
  @@ -105,6 +107,8 @@
       private boolean debug = false;
       private boolean optimize = false;
       private boolean deprecation = false;
  +    private boolean depend = false;
  +    private boolean verbose = false;
       private String target;
       private Path bootclasspath;
       private Path extdirs;
  @@ -251,6 +255,20 @@
            this.optimize = optimize;
        }
   
  +    /** 
  +     * Set the depend flag.
  +     */ 
  +     public void setDepend(boolean depend) {
  +         this.depend = depend;
  +     }  
  +
  +    /** 
  +     * Set the verbose flag.
  +     */ 
  +     public void setVerbose(boolean verbose) {
  +         this.verbose = verbose;
  +     }  
  +
       /**
        * Sets the target VM that the classes will be compiled for. Valid
        * strings are "1.1", "1.2", and "1.3".
  @@ -522,6 +540,21 @@
               cmd.createArgument().setPath(extdirs);
           }
   
  +        if (depend) {
  +            if (Project.getJavaVersion().startsWith("1.1")) {
  +                cmd.createArgument().setValue("-depend");
  +            } else if (Project.getJavaVersion().startsWith("1.2")) {
  +                cmd.createArgument().setValue("-Xdepend");
  +            } else {
  +                log("depend attribute is not supported by the modern compiler",
  +                    Project.MSG_WARN);
  +            }
  +        }
  +
  +        if (verbose) {
  +            cmd.createArgument().setValue("-verbose");
  +        }
  +
           logAndAddFilesToCompile(cmd);
           return cmd;
       }
  @@ -608,7 +641,17 @@
           if (optimize) {
               cmd.createArgument().setValue("-O");
           }
  -
  +        if (verbose) {
  +            cmd.createArgument().setValue("-verbose");
  +        }
  +        if (depend) {
  +            cmd.createArgument().setValue("-depend");
  +            String fullDependProperty = project.getProperty("build.compiler.fulldepend");
  +            if (fullDependProperty != null 
  +                && Project.toBoolean(fullDependProperty)) {
  +                cmd.createArgument().setValue("+F");
  +            }
  +        } 
           /**
            * XXX
            * Perhaps we shouldn't use properties for these
  @@ -623,10 +666,7 @@
            * to the place, where the error occured.
            */
           String emacsProperty = project.getProperty("build.compiler.emacs");
  -        if (emacsProperty != null &&
  -            (emacsProperty.equalsIgnoreCase("on") ||
  -             emacsProperty.equalsIgnoreCase("true"))
  -            ) {
  +        if (emacsProperty != null && Project.toBoolean(emacsProperty)) {
               cmd.createArgument().setValue("+E");
           }
   
  @@ -637,10 +677,7 @@
            * warning can be pretty annoying.
            */
           String warningsProperty = project.getProperty("build.compiler.warnings");
  -        if (warningsProperty != null &&
  -            (warningsProperty.equalsIgnoreCase("off") ||
  -             warningsProperty.equalsIgnoreCase("false"))
  -            ) {
  +        if (warningsProperty != null && !Project.toBoolean(warningsProperty)) {
               cmd.createArgument().setValue("-nowarn");
           }
   
  @@ -648,10 +685,7 @@
            * Jikes can issue pedantic warnings. 
            */
           String pedanticProperty = project.getProperty("build.compiler.pedantic");
  -        if (pedanticProperty != null &&
  -            (pedanticProperty.equalsIgnoreCase("on") ||
  -             pedanticProperty.equalsIgnoreCase("true"))
  -            ) {
  +        if (pedanticProperty != null && Project.toBoolean(pedanticProperty)) {
               cmd.createArgument().setValue("+P");
           }
    
  
  
  

Mime
View raw message