ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adammurd...@apache.org
Subject cvs commit: jakarta-ant-myrmidon/buildtools/src/java/org/apache/myrmidon/build AntTypeSubTask.java AntDocSubTask.java AntlibDescriptorTask.java ant-descriptor.j type.j types.j
Date Sun, 02 Jun 2002 04:58:52 GMT
adammurdoch    2002/06/01 21:58:52

  Modified:    buildtools/src/java/org/apache/myrmidon/build
                        AntDocSubTask.java AntlibDescriptorTask.java
                        ant-descriptor.j type.j types.j
  Added:       buildtools/src/java/org/apache/myrmidon/build
                        AntTypeSubTask.java
  Log:
  Was getting an occasional xdoclet error.  Declaring the 'ant' namespace
  in the task, rather than in the template files, seems to have fixed it.
  
  Revision  Changes    Path
  1.5       +2 -28     jakarta-ant-myrmidon/buildtools/src/java/org/apache/myrmidon/build/AntDocSubTask.java
  
  Index: AntDocSubTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/buildtools/src/java/org/apache/myrmidon/build/AntDocSubTask.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AntDocSubTask.java	1 Jun 2002 06:46:01 -0000	1.4
  +++ AntDocSubTask.java	2 Jun 2002 04:58:51 -0000	1.5
  @@ -12,16 +12,15 @@
   import xdoclet.TemplateSubTask;
   import xdoclet.XDocletException;
   import xjavadoc.XClass;
  -import xjavadoc.XTag;
   
   /**
    * Generates the XML Documentation for Ant types (including tasks and DataTypes).
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.4 $ $Date: 2002/06/01 06:46:01 $
  + * @version $Revision: 1.5 $ $Date: 2002/06/02 04:58:51 $
    */
   public class AntDocSubTask
  -    extends TemplateSubTask
  +    extends AntTypeSubTask
   {
       public static final String SUBTASK_NAME = "antdoc";
   
  @@ -29,8 +28,6 @@
       private static final String DEFAULT_TEMPLATE_FILE =
           "/org/apache/myrmidon/build/type.j";
   
  -    private File m_docsDestDir;
  -
       public AntDocSubTask()
       {
           setDestinationFile( GENERATED_FILE_NAME );
  @@ -42,32 +39,9 @@
           setExtent( extent );
       }
   
  -    /**
  -     * Specifies the directory that is the destination of generated generated
  -     * xml documentation for types.
  -     */
  -    public void setDocsDestDir( final File docsDestDir )
  -    {
  -        m_docsDestDir = docsDestDir;
  -    }
  -
       public String getSubTaskName()
       {
           return SUBTASK_NAME;
  -    }
  -
  -    /**
  -     * Called to validate configuration parameters.
  -     */
  -    public void validateOptions()
  -        throws XDocletException
  -    {
  -        super.validateOptions();
  -
  -        if( null == m_docsDestDir )
  -        {
  -            throw new XDocletException( "'docsDestDir' attribute is missing ." );
  -        }
       }
   
       protected boolean matchesGenerationRules( final XClass clazz )
  
  
  
  1.7       +10 -32    jakarta-ant-myrmidon/buildtools/src/java/org/apache/myrmidon/build/AntlibDescriptorTask.java
  
  Index: AntlibDescriptorTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/buildtools/src/java/org/apache/myrmidon/build/AntlibDescriptorTask.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- AntlibDescriptorTask.java	1 Jun 2002 06:46:01 -0000	1.6
  +++ AntlibDescriptorTask.java	2 Jun 2002 04:58:51 -0000	1.7
  @@ -8,7 +8,6 @@
   package org.apache.myrmidon.build;
   
   import java.net.URL;
  -import org.apache.tools.ant.BuildException;
   import xdoclet.DocletTask;
   import xdoclet.TemplateSubTask;
   
  @@ -25,15 +24,14 @@
       private static final String ROLES_TEMPLATE = "/org/apache/myrmidon/build/ant-roles.j";
       private static final String TYPES_TEMPLATE = "/org/apache/myrmidon/build/types.j";
   
  -    private String m_descriptorFileName;
  -    private String m_rolesFileName;
  -
       /**
        * Specifies the name of the file for the antlib types descriptor (optional).
        */
       public void setDescriptorName( final String descriptorFileName )
       {
  -        m_descriptorFileName = descriptorFileName;
  +        final TemplateSubTask descriptorTemplate =
  +            makeTemplateSubTask( DESCRIPTOR_TEMPLATE, descriptorFileName );
  +        addTemplate( descriptorTemplate );
       }
   
       /**
  @@ -41,9 +39,14 @@
        */
       public void setRolesDescriptorName( final String rolesFileName )
       {
  -        m_rolesFileName = rolesFileName;
  +        final TemplateSubTask rolesTemplate =
  +            makeTemplateSubTask( ROLES_TEMPLATE, rolesFileName );
  +        addTemplate( rolesTemplate );
       }
   
  +    /**
  +     * Adds a nested <antdoc> element.
  +     */
       public void addAntdoc( final AntDocSubTask antDocs )
       {
           addTemplate( antDocs );
  @@ -52,38 +55,13 @@
       }
   
       /**
  -     * Describe what the method does
  -     *
  -     * @exception BuildException  Describe the exception
  -     */
  -    protected void validateSubTasks() throws BuildException
  -    {
  -        // Add template subtasks.
  -        if( m_descriptorFileName != null )
  -        {
  -            final TemplateSubTask descriptorTemplate =
  -                makeTemplateSubTask( DESCRIPTOR_TEMPLATE, m_descriptorFileName );
  -            addTemplate( descriptorTemplate );
  -        }
  -
  -        if( m_rolesFileName != null )
  -        {
  -            final TemplateSubTask rolesTemplate =
  -                makeTemplateSubTask( ROLES_TEMPLATE, m_rolesFileName );
  -            addTemplate( rolesTemplate );
  -        }
  -
  -        super.validateSubTasks();
  -    }
  -
  -    /**
        * Creates a TemplateSubTask for a given template, which is read in
        * as a resource.
        */
       private TemplateSubTask makeTemplateSubTask( final String templateLocation,
                                                    final String destinationFile )
       {
  -        final TemplateSubTask templateSubTask = new TemplateSubTask();
  +        final TemplateSubTask templateSubTask = new AntTypeSubTask();
           final URL resource = getClass().getResource( templateLocation );
           templateSubTask.setTemplateURL( resource );
           templateSubTask.setDestinationFile( destinationFile );
  
  
  
  1.6       +0 -1      jakarta-ant-myrmidon/buildtools/src/java/org/apache/myrmidon/build/ant-descriptor.j
  
  Index: ant-descriptor.j
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/buildtools/src/java/org/apache/myrmidon/build/ant-descriptor.j,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ant-descriptor.j	1 Jun 2002 06:46:01 -0000	1.5
  +++ ant-descriptor.j	2 Jun 2002 04:58:51 -0000	1.6
  @@ -1,4 +1,3 @@
  -<XDtTagDef:tagDef namespace="Ant" handler="org.apache.myrmidon.build.AntTypeTagHandler"/>
   <ant-lib version="1.0">
   
     <types>
  
  
  
  1.2       +0 -1      jakarta-ant-myrmidon/buildtools/src/java/org/apache/myrmidon/build/type.j
  
  Index: type.j
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/buildtools/src/java/org/apache/myrmidon/build/type.j,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- type.j	1 Jun 2002 06:46:01 -0000	1.1
  +++ type.j	2 Jun 2002 04:58:51 -0000	1.2
  @@ -1,4 +1,3 @@
  -<XDtTagDef:tagDef namespace="Ant" handler="org.apache.myrmidon.build.AntTypeTagHandler"/>
   <type classname="<XDtClass:fullClassName/>">
     <names>
       <XDtAnt:forAllTypeTags>
  
  
  
  1.2       +0 -1      jakarta-ant-myrmidon/buildtools/src/java/org/apache/myrmidon/build/types.j
  
  Index: types.j
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/buildtools/src/java/org/apache/myrmidon/build/types.j,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- types.j	1 Jun 2002 06:46:01 -0000	1.1
  +++ types.j	2 Jun 2002 04:58:51 -0000	1.2
  @@ -1,4 +1,3 @@
  -<XDtTagDef:tagDef namespace="Ant" handler="org.apache.myrmidon.build.AntTypeTagHandler"/>
   <types>
     <XDtClass:forAllClasses extent="concrete-type">
   
  
  
  
  1.1                  jakarta-ant-myrmidon/buildtools/src/java/org/apache/myrmidon/build/AntTypeSubTask.java
  
  Index: AntTypeSubTask.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.myrmidon.build;
  
  import xdoclet.TemplateSubTask;
  import xdoclet.XDocletException;
  import xdoclet.template.TemplateException;
  
  /**
   * A subtask that deals with ant type tags.
   *
   * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
   * @version $Revision: 1.1 $ $Date: 2002/06/02 04:58:51 $
   */
  public class AntTypeSubTask
      extends TemplateSubTask
  {
      /**
       * Initialises the subtask.  Add a tag handler for ant type tags.
       */
      public void init() throws XDocletException
      {
          super.init();
          try
          {
              getEngine().setTagHandlerFor( "Ant", new AntTypeTagHandler() );
          }
          catch( TemplateException e )
          {
              throw new XDocletException( e, e.getMessage() );
          }
      }
  }
  
  
  

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