ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ehatc...@apache.org
Subject cvs commit: jakarta-ant/proposal/xdocs/templates task_xdoc.template
Date Thu, 28 Feb 2002 03:45:09 GMT
ehatcher    02/02/27 19:45:09

  Modified:    proposal/xdocs/src/org/apache/tools/ant/xdoclet
                        AntSubTask.java AntTagsHandler.java
               proposal/xdocs/templates task_xdoc.template
  Log:
  Changes by Bill Burton to collect tasks into categories rather than package space.  Very
cool, thanks!
  
  Revision  Changes    Path
  1.3       +1 -7      jakarta-ant/proposal/xdocs/src/org/apache/tools/ant/xdoclet/AntSubTask.java
  
  Index: AntSubTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/xdocs/src/org/apache/tools/ant/xdoclet/AntSubTask.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AntSubTask.java	27 Feb 2002 19:39:41 -0000	1.2
  +++ AntSubTask.java	28 Feb 2002 03:45:09 -0000	1.3
  @@ -83,11 +83,6 @@
        *       - and only throw BuildException if at all
        */
       protected boolean matchesGenerationRules(ClassDoc clazz) throws XDocletException {
  -
  -        if (clazz.isAbstract()) {
  -            return false;
  -        }
  -
           return isAntTask(clazz);;
       }
   
  @@ -124,8 +119,7 @@
           String dir = getDestDir().getAbsolutePath();
   
           if (filename.indexOf("{0}") != -1) {
  -            PackageDoc pak = clazz.containingPackage();
  -            dir = PackageTagsHandler.packageNameAsPathFor(pak);
  +            dir = AntTagsHandler.getCategoryName(clazz);
               String taskName = AntTagsHandler.getTaskName(clazz);
               filename = MessageFormat.format(getDestinationFile(), new Object[]{taskName});
           }
  
  
  
  1.3       +31 -0     jakarta-ant/proposal/xdocs/src/org/apache/tools/ant/xdoclet/AntTagsHandler.java
  
  Index: AntTagsHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/xdocs/src/org/apache/tools/ant/xdoclet/AntTagsHandler.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AntTagsHandler.java	27 Feb 2002 19:39:41 -0000	1.2
  +++ AntTagsHandler.java	28 Feb 2002 03:45:09 -0000	1.3
  @@ -81,6 +81,9 @@
    */
   public class AntTagsHandler extends XDocletTagSupport {
   
  +    /** Default category for tasks without a category attribute. */
  +    public static final String DEFAULT_CATEGORY = "other";
  +
       /**
        * @todo add check for execute method
        */
  @@ -163,6 +166,7 @@
        * Provides the Ant task name.
        *
        * @see getTaskName
  +	 * @doc:tag      type="content"
        */
       public String taskName() throws XDocletException {
           return getTaskName(getCurrentClass());
  @@ -192,6 +196,33 @@
               }
   
               tagValue = tagValue.toLowerCase();
  +        }
  +        return tagValue;
  +    }
  +
  +
  +    /**
  +     * Provides the Ant category name.
  +     *
  +     * @see getCategoryName
  +     */
  +    public String categoryName() throws XDocletException {
  +        return getCategoryName(getCurrentClass());
  +    }
  +
  +    /**
  +     * Provides the Ant category name as the Value of the category attribute, 
  +     * <code>@ant:task&nbsp;category="..."</code>.  This attribute is mandatory.
  +     */
  +    public static final String getCategoryName(ClassDoc clazz) throws XDocletException
{
  +        String tagValue = getTagValue(clazz, "ant:task", "category", -1,
  +                null, null, null, null,
  +                null, false, XDocletTagSupport.FOR_CLASS, true);
  +        if (tagValue != null) {
  +            tagValue = tagValue.toLowerCase();
  +        }
  +        else {
  +            tagValue = DEFAULT_CATEGORY;
           }
           return tagValue;
       }
  
  
  
  1.2       +2 -1      jakarta-ant/proposal/xdocs/templates/task_xdoc.template
  
  Index: task_xdoc.template
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/xdocs/templates/task_xdoc.template,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- task_xdoc.template	27 Feb 2002 05:26:41 -0000	1.1
  +++ task_xdoc.template	28 Feb 2002 03:45:09 -0000	1.2
  @@ -1,6 +1,7 @@
   <XDtTagDef:tagDef namespace="Ant" handler="org.apache.tools.ant.xdoclet.AntTagsHandler"/>
   
  -<task name="<XDtAnt:taskName/>" classname="<XDtClass:fullClassName/>">
  +<task name="<XDtAnt:taskName/>" category="<XDtAnt:categoryName/>"
  +      classname="<XDtClass:fullClassName/>">
   
     <short-description><![CDATA[<XDtClass:firstSentenceDescription/>]]></short-description>
     <long-description>
  
  
  

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