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 Javadoc.java
Date Mon, 08 Apr 2002 16:11:28 GMT
bodewig     02/04/08 09:11:28

  Modified:    .        WHATSNEW
               docs/manual/CoreTasks javadoc.html
               src/main/org/apache/tools/ant/taskdefs Javadoc.java
  Log:
  Add -source switch to <javadoc>
  
  PR: 5645
  
  Revision  Changes    Path
  1.247     +3 -0      jakarta-ant/WHATSNEW
  
  Index: WHATSNEW
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/WHATSNEW,v
  retrieving revision 1.246
  retrieving revision 1.247
  diff -u -r1.246 -r1.247
  --- WHATSNEW	8 Apr 2002 14:20:23 -0000	1.246
  +++ WHATSNEW	8 Apr 2002 16:11:27 -0000	1.247
  @@ -287,6 +287,9 @@
   * <java> now supports a timeout attribute analog to <exec> - it is 
     highly recommended to only use it together with fork="true".
   
  +* <javadoc> now supports a source attribute to enable javadoc to
  +  handle assertions present in JDK 1.4 source code.
  +
   Changes from Ant 1.4 to Ant 1.4.1
   ===========================================
   
  
  
  
  1.18      +10 -0     jakarta-ant/docs/manual/CoreTasks/javadoc.html
  
  Index: javadoc.html
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/docs/manual/CoreTasks/javadoc.html,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- javadoc.html	5 Apr 2002 05:42:25 -0000	1.17
  +++ javadoc.html	8 Apr 2002 16:11:27 -0000	1.18
  @@ -386,6 +386,16 @@
       <td align="center" valign="top">all</td>
       <td valign="top" align="center">No</td>
     </tr>
  +  <tr>
  +    <td valign="top">source</td>
  +    <td valign="top">Necessary to enable javadoc to handle assertions
  +    present in J2SE v 1.4 source code. Set this to &quot;1.4&quot; to
  +    documents code that compiles using <code>&quot;javac -source
  +    1.4&quot;</code>.  Will be ignored if you use a custom
  +    doclet.</td>
  +    <td align="center" valign="top">1.4</td>
  +    <td align="center" valign="top">No</td>
  +  </tr>
   </table>
   
   <h4><a name="groupattribute">Format of the group attribute</a></h4>
  
  
  
  1.86      +33 -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.85
  retrieving revision 1.86
  diff -u -r1.85 -r1.86
  --- Javadoc.java	5 Apr 2002 14:57:36 -0000	1.85
  +++ Javadoc.java	8 Apr 2002 16:11:27 -0000	1.86
  @@ -281,6 +281,7 @@
       private boolean useExternalFile = false;
       private File tmpList = null;
       private FileUtils fileUtils = FileUtils.newFileUtils();
  +    private String source = null;
   
       /**
        * Work around command line length limit by using an external file
  @@ -431,7 +432,17 @@
       }
       
       public void setOld(boolean b) {
  -        add12ArgIf(b, "-1.1");
  +        if (b) {
  +            if (javadoc1) {
  +                log("Javadoc 1.1 doesn't support the -1.1 switch", 
  +                    Project.MSG_WARN);
  +            } else if (javadoc4) {
  +                log("Javadoc 1.4 doesn't support the -1.1 switch anymore", 
  +                    Project.MSG_WARN);
  +            } else {
  +                cmd.createArgument().setValue("-1.1");
  +            }
  +        }
       }
       public void setClasspath(Path src) {
           if (classpath == null) {
  @@ -896,6 +907,17 @@
           failOnError = b;
       }
   
  +    /**
  +     * Enables the -source switch, will be ignored if javadoc is not
  +     * the 1.4 version or a different doclet than the standard doclet
  +     * is used.
  +     *
  +     * @since 1.86, Ant 1.5
  +     */
  +    public void setSource(String source) {
  +        this.source = source;
  +    }
  +
       public void execute() throws BuildException {
           if ("javadoc2".equals(taskType)) {
               log("!! javadoc2 is deprecated. Use javadoc instead. !!");
  @@ -1094,6 +1116,16 @@
                                   toExecute.createArgument().setPath(tagletPath);
                               }
                           }
  +                    }
  +                }
  +
  +                if (source != null) {
  +                    if (doclet != null) {
  +                        log("ignoring source option for custom doclet",
  +                            Project.MSG_WARN);
  +                    } else {
  +                        toExecute.createArgument().setValue("-source");
  +                        toExecute.createArgument().setValue(source);
                       }
                   }
               }
  
  
  

--
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