ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From co...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs Javadoc.java
Date Fri, 05 Apr 2002 05:42:26 GMT
conor       02/04/04 21:42:26

  Modified:    docs/manual/CoreTasks javadoc.html
               src/main/org/apache/tools/ant/taskdefs Javadoc.java
  Log:
  Add taglets support to javadoc
  
  Revision  Changes    Path
  1.17      +26 -7     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.16
  retrieving revision 1.17
  diff -u -w -u -r1.16 -r1.17
  --- javadoc.html	26 Feb 2002 16:39:37 -0000	1.16
  +++ javadoc.html	5 Apr 2002 05:42:25 -0000	1.17
  @@ -347,13 +347,6 @@
       <td align="center" valign="top">No</td>
     </tr>
     <tr>
  -    <td valign="top">tag</td>
  -    <td valign="top">Specifies how custom tags should be handled. See
  -      <a href="#tagelement">below</a> for details.</td>
  -    <td align="center" valign="top">1.4</td>
  -    <td align="center" valign="top">No</td>
  -  </tr>
  -  <tr>
       <td valign="top">additionalparam</td>
       <td valign="top">Lets you add additional parameters to the javadoc
               command line. Useful for doclets. Parameters containing
  @@ -582,6 +575,32 @@
       is a comma separated list of some of the elements: <code>overview</code>,

       <code>packages</code>, <code>types</code>, <code>constructors</code>,

       <code>methods</code>, <code>fields</code> or the default, <code>all</code>.</td>
  +    <td align="center" valign="top">No</td>
  +  </tr>
  +</table>
  +
  +<h4><a name="tagletelement">taglet</a></h4> 
  +<p>The taglet nested element is used to specify custom taglets. This option is 
  +only available with Java 1.4.</p>
  +
  +<h5>Parameters</h5>
  +<table width="60%" border="1" cellpadding="2" cellspacing="0">
  +  <tr>
  +    <td valign="top"><b>Attribute</b></td>
  +    <td valign="top"><b>Description</b></td>
  +    <td align="center" valign="top"><b>Required</b></td>
  +  </tr>
  +  <tr>
  +    <td valign="top">name</td>
  +    <td valign="top">The name of the taglet class 
  +              (e.g. <code>com.sun.tools.doclets.ToDoTaglet</code>)</td>
  +    <td align="center" valign="top">Yes</td>
  +  </tr>
  +  <tr>
  +    <td valign="top">path</td>
  +    <td valign="top">A path specifying the search path for the taglet class
  +            (e.g. <code>/home/taglets</code>).
  +            The path may also be specified by a nested &lt;path&gt; element</td>
       <td align="center" valign="top">No</td>
     </tr>
   </table>
  
  
  
  1.83      +34 -8     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.82
  retrieving revision 1.83
  diff -u -w -u -r1.82 -r1.83
  --- Javadoc.java	4 Apr 2002 10:31:18 -0000	1.82
  +++ Javadoc.java	5 Apr 2002 05:42:26 -0000	1.83
  @@ -65,7 +65,7 @@
   import org.apache.tools.ant.BuildException;
   import org.apache.tools.ant.DirectoryScanner;
   import org.apache.tools.ant.Project;
  -
  +import org.apache.tools.ant.ProjectComponent;
   import org.apache.tools.ant.Task;
   import org.apache.tools.ant.types.Path;
   import org.apache.tools.ant.types.Reference;
  @@ -128,12 +128,9 @@
           }
       }
   
  -    public class DocletInfo {
  +    static public class ExtensionInfo extends ProjectComponent {
           private String name;
           private Path path;
  -
  -        private Vector params = new Vector();
  -
           public void setName(String name) {
               this.name = name;
           }
  @@ -167,6 +164,11 @@
           public void setPathRef(Reference r) {
               createPath().setRefid(r);
           }
  +    }
  +        
  +    public class DocletInfo extends ExtensionInfo {
  +
  +        private Vector params = new Vector();
   
           public DocletParam createParam() {
               DocletParam param = new DocletParam();
  @@ -270,7 +272,8 @@
       private String packageList = null;
       private Vector links = new Vector(2);
       private Vector groups = new Vector(2);
  -    private Vector tags = new Vector(1);
  +    private Vector tags = new Vector(5);
  +    private Vector taglets = new Vector(2);
       private boolean useDefaultExcludes = true;
       private Html doctitle = null;
       private Html header = null;
  @@ -424,6 +427,10 @@
           return doclet;
       }
   
  +    public void addTaglet(ExtensionInfo tagletInfo) {
  +        taglets.addElement(tagletInfo);
  +    }
  +    
       public void setOld(boolean b) {
           add12ArgIf(b, "-1.1");
       }
  @@ -971,8 +978,12 @@
                       toExecute.createArgument().setValue("-doclet");
                       toExecute.createArgument().setValue(doclet.getName());
                       if (doclet.getPath() != null) {
  +                        Path docletPath 
  +                            = doclet.getPath().concatSystemClasspath("ignore");
  +                        if (docletPath.size() != 0) {
                           toExecute.createArgument().setValue("-docletpath");
  -                        toExecute.createArgument().setPath(doclet.getPath().concatSystemClasspath("ignore"));
  +                            toExecute.createArgument().setPath(docletPath);
  +                        }
                       }
                       for (Enumeration e = doclet.getParams(); e.hasMoreElements();) {
                           DocletParam param = (DocletParam)e.nextElement();
  @@ -1068,6 +1079,21 @@
               
               // JavaDoc 1.4 parameters
               if (javadoc4) {
  +                for (Enumeration e = taglets.elements(); e.hasMoreElements(); ) {
  +                    ExtensionInfo tagletInfo 
  +                        = (ExtensionInfo) e.nextElement();
  +                    toExecute.createArgument().setValue("-taglet");
  +                    toExecute.createArgument().setValue(tagletInfo.getName());
  +                    if (tagletInfo.getPath() != null) {
  +                        System.out.println("Taglet base path is " + tagletInfo.getPath());
  +                        Path tagletPath 
  +                            = tagletInfo.getPath().concatSystemClasspath("ignore");
  +                        if (tagletPath.size() != 0) {
  +                            toExecute.createArgument().setValue("-tagletpath");
  +                            toExecute.createArgument().setPath(tagletPath);
  +                        }
  +                    }
  +                }
                   for (Enumeration e = tags.elements(); e.hasMoreElements(); ) {
                       TagArgument ta = (TagArgument) e.nextElement();
                       toExecute.createArgument().setValue ("-tag");
  
  
  

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