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 ExecTask.java Javadoc.java
Date Tue, 31 Oct 2000 11:12:11 GMT
bodewig     00/10/31 03:12:07

  Modified:    docs     index.html
               src/main/org/apache/tools/ant/taskdefs ExecTask.java
                        Javadoc.java
  Log:
  Reinstate javadoc's failonerror attribute.
  
  Requested by:	Corey Puffalt <corey@kelman.com>
  
  Revision  Changes    Path
  1.139     +8 -1      jakarta-ant/docs/index.html
  
  Index: index.html
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/docs/index.html,v
  retrieving revision 1.138
  retrieving revision 1.139
  diff -u -r1.138 -r1.139
  --- index.html	2000/10/27 15:23:35	1.138
  +++ index.html	2000/10/31 11:11:59	1.139
  @@ -382,7 +382,7 @@
   <p>In addition Ant knows some built in properties:</p>
   <ul>
     <li>basedir - the absolute path of the project's basedir (as set
  -    with the basedir attribute of &lt;project&gt;.</li>
  +    with the basedir attribute of &lt;project&gt;).</li>
     <li>ant.file - the absolute path of the build file.</li>
     <li>ant.java.version - the JVM version Ant detected. Currently it
       can hold the values &quot;1.1&quot;, &quot;1.2&quot; and
  @@ -3092,6 +3092,13 @@
       <td valign="top">additionalparam</td>
       <td valign="top">Lets you add additional parameters to the javadoc command line.
Useful for doclets</td>
       <td align="center" valign="top">1.2</td>
  +    <td align="center" valign="top">No</td>
  +  </tr>
  +  <tr>
  +    <td valign="top">failonerror</td>
  +    <td valign="top">Stop the buildprocess if the command exits with a
  +      returncode other than 0.</td>
  +    <td align="center" valign="top">all</td>
       <td align="center" valign="top">No</td>
     </tr>
   </table>
  
  
  
  1.9       +1 -1      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/ExecTask.java
  
  Index: ExecTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/ExecTask.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ExecTask.java	2000/10/27 14:59:25	1.8
  +++ ExecTask.java	2000/10/31 11:12:04	1.9
  @@ -65,7 +65,7 @@
    * @author duncan@x180.com
    * @author rubys@us.ibm.com
    * @author thomas.haas@softwired-inc.com
  - * @author <a href="mailto:stefan.bodewig@megabit.net">Stefan Bodewig</a>
  + * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a>
    * @author <a href="mailto:mariusz@rakiura.org">Mariusz Nowostawski</a> 
    */
   public class ExecTask extends Task {
  
  
  
  1.36      +16 -1     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Javadoc.java
  
  Index: Javadoc.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Javadoc.java,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- Javadoc.java	2000/10/29 13:10:28	1.35
  +++ Javadoc.java	2000/10/31 11:12:05	1.36
  @@ -90,6 +90,7 @@
    * @author Stefano Mazzocchi <a href="mailto:stefano@apache.org">stefano@apache.org</a>
    * @author Patrick Chanezon <a href="mailto:chanezon@netscape.com">chanezon@netscape.com</a>
    * @author Ernst de Haan <a href="mailto:ernst@jollem.com">ernst@jollem.com</a>
  + * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a>
    */
   
   public class Javadoc extends Task {
  @@ -191,6 +192,7 @@
       }
   
       private boolean foundJavaFile = false;
  +    private boolean failOnError = false;
       private Path sourcePath = null;
       private File destDir = null;
       private String sourceFiles = null;
  @@ -543,6 +545,16 @@
           }
       }
   
  +    /**
  +     * Should the build process fail if javadoc fails (as indicated by
  +     * a non zero return code)?
  +     *
  +     * <p>Default is false.</p>
  +     */
  +    public void setFailonerror(boolean b) {
  +        failOnError = b;
  +    }
  +
       public void execute() throws BuildException {
           if ("javadoc2".equals(taskType)) {
               log("!! javadoc2 is deprecated. Use javadoc instead. !!");
  @@ -726,7 +738,10 @@
           exe.setWorkingDirectory(project.getBaseDir());
           try {
               exe.setCommandline(toExecute.getCommandline());
  -            exe.execute();
  +            int ret = exe.execute();
  +            if (ret != 0 && failOnError) {
  +                throw new BuildException("Javadoc returned "+ret, location);
  +            }
           } catch (IOException e) {
               throw new BuildException("Javadoc failed: " + e, e, location);
           } finally {
  
  
  

Mime
View raw message