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/proposal/myrmidon/src/java/org/apache/myrmidon/components/model Target.java DefaultTarget.java
Date Tue, 12 Jun 2001 13:39:32 GMT
donaldp     01/06/12 06:39:32

  Modified:    proposal/myrmidon/src/java/org/apache/myrmidon/components/model
                        Target.java
  Removed:     proposal/myrmidon/src/java/org/apache/myrmidon/components/model
                        DefaultTarget.java
  Log:
  No longer separate Target interface and implementation.
  
  Revision  Changes    Path
  1.4       +48 -16    jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/model/Target.java
  
  Index: Target.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/model/Target.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Target.java	2001/06/02 08:46:12	1.3
  +++ Target.java	2001/06/12 13:39:31	1.4
  @@ -7,39 +7,71 @@
    */
   package org.apache.myrmidon.components.model;
   
  -import org.apache.avalon.framework.component.Component;
  +import java.util.ArrayList;
   import org.apache.avalon.framework.configuration.Configuration;
   
   /**
  - * Interface to represent targets in build file.
  + * Targets in build file.
    *
    * @author <a href="mailto:donaldp@apache.org">Peter Donald</a>
    */
  -public interface Target
  -    extends Component
  +public class Target
   {
  -    String ROLE = "org.apache.myrmidon.components.model.Target";
  +    private final ArrayList   m_dependencies     = new ArrayList();
  +    private final ArrayList   m_tasks            = new ArrayList();
  +    private final Condition   m_condition;
   
       /**
  -     * Get dependencies of target
  +     * Constructor taking condition for target.
        *
  -     * @return the dependency list
  +     * @param condition the condition
        */
  -    String[] getDependencies();
  +    public Target( final Condition condition, 
  +                   final Configuration[] tasks, 
  +                   final String[] dependencies )
  +    {
  +        m_condition = condition;
  +
  +        for( int i = 0; i < tasks.length; i++ )
  +        {
  +            m_tasks.add( tasks[ i ] );
  +        }
  +
  +        if( null != dependencies )
  +        {
  +            for( int i = 0; i < dependencies.length; i++ )
  +            {
  +                m_dependencies.add( dependencies[ i ] );
  +            }
  +        }
  +    }
   
       /**
  -     * Get tasks in target
  +     * Get condition under which target is executed.
        *
  -     * @return the target list
  +     * @return the condition for target or null
        */
  -    Configuration[] getTasks();
  +    public final Condition getCondition()
  +    {
  +        return m_condition;
  +    }
  +    /**
  +     * Get dependencies of target
  +     *
  +     * @return the dependency list
  +     */
  +    public final String[] getDependencies()
  +    {
  +        return (String[])m_dependencies.toArray( new String[ 0 ] );
  +    }
   
       /**
  -     * Get condition under which target is executed.
  +     * Get tasks in target
        *
  -     * @return the condition for target or null
  +     * @return the target list
        */
  -    Condition getCondition();
  +    public final Configuration[] getTasks()
  +    {
  +        return (Configuration[])m_tasks.toArray( new Configuration[ 0 ] );
  +    }
   }
  -
  -
  
  
  

Mime
View raw message