ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/builder DefaultProjectBuilder.java
Date Tue, 21 May 2002 01:32:56 GMT
donaldp     02/05/20 18:32:56

  Modified:    container/src/java/org/apache/myrmidon/interfaces/oldmodel
                        Target.java
               container/src/java/org/apache/myrmidon/components/builder
                        DefaultProjectBuilder.java
  Log:
  Target implements TargetMetaData for now and carries its own name.
  
  Revision  Changes    Path
  1.4       +40 -2     jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/interfaces/oldmodel/Target.java
  
  Index: Target.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/interfaces/oldmodel/Target.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Target.java	5 May 2002 21:18:06 -0000	1.3
  +++ Target.java	21 May 2002 01:32:55 -0000	1.4
  @@ -9,26 +9,32 @@
   
   import java.util.ArrayList;
   import org.apache.myrmidon.api.metadata.ModelElement;
  +import org.apache.myrmidon.interfaces.model.TargetMetaData;
   
   /**
    * Targets in build file.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.3 $ $Date: 2002/05/05 21:18:06 $
  + * @version $Revision: 1.4 $ $Date: 2002/05/21 01:32:55 $
    */
   public class Target
  +    implements TargetMetaData
   {
       private final ArrayList m_dependencies = new ArrayList();
       private final ArrayList m_tasks = new ArrayList();
  +    private final String m_name;
   
       /**
        * Constructs a target.
  +     *
        * @param tasks The task models for all tasks in this target.
        * @param dependencies The dependencies for executing this target.
        */
  -    public Target( final ModelElement[] tasks,
  +    public Target( final String name,
  +        final ModelElement[] tasks,
                      final Dependency[] dependencies )
       {
  +        m_name = name;
           for( int i = 0; i < tasks.length; i++ )
           {
               m_tasks.add( tasks[ i ] );
  @@ -61,5 +67,37 @@
       public final ModelElement[] getTasks()
       {
           return (ModelElement[])m_tasks.toArray( new ModelElement[ 0 ] );
  +    }
  +
  +    /**
  +     * Retrieve the name of the Target.
  +     *
  +     * @return the name of the Target.
  +     */
  +    public String getName()
  +    {
  +        return m_name;
  +    }
  +
  +    /**
  +     * Retrieve a description of the target.
  +     *
  +     * @return a description of the target.
  +     */
  +    public String getDescription()
  +    {
  +        return null;
  +    }
  +
  +    /**
  +     * Return an array of child targets.
  +     * Must return a non-null value, even when there
  +     * are no child targets.
  +     *
  +     * @return a non-null array of child targets.
  +     */
  +    public TargetMetaData[] getTargets()
  +    {
  +        return new TargetMetaData[ 0 ];
       }
   }
  
  
  
  1.54      +3 -3      jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/builder/DefaultProjectBuilder.java
  
  Index: DefaultProjectBuilder.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/builder/DefaultProjectBuilder.java,v
  retrieving revision 1.53
  retrieving revision 1.54
  diff -u -r1.53 -r1.54
  --- DefaultProjectBuilder.java	21 May 2002 01:03:02 -0000	1.53
  +++ DefaultProjectBuilder.java	21 May 2002 01:32:56 -0000	1.54
  @@ -34,7 +34,7 @@
    * Default implementation to construct project from a build file.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.53 $ $Date: 2002/05/21 01:03:02 $
  + * @version $Revision: 1.54 $ $Date: 2002/05/21 01:32:56 $
    *
    * @ant.type type="project-builder" name="ant2"
    */
  @@ -334,7 +334,7 @@
           final ModelElement[] implicitTasks =
               (ModelElement[])implicitTaskList.toArray( new ModelElement[ implicitTaskList.size()
] );
   
  -        final Target implicitTarget = new Target( implicitTasks, null );
  +        final Target implicitTarget = new Target( "<init>", implicitTasks, null );
           project.setImplicitTarget( implicitTarget );
       }
   
  @@ -429,7 +429,7 @@
   
           final Dependency[] dependencies = buildDependsList( depends, target );
           final Target targetModel =
  -            new Target( target.getChildren(), dependencies );
  +            new Target( name, target.getChildren(), dependencies );
   
           //add target to project
           project.addTarget( name, targetModel );
  
  
  

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