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/model DefaultProject.java DefaultTarget.java Target.java
Date Tue, 29 May 2001 07:33:24 GMT
donaldp     01/05/29 00:33:23

  Modified:    proposal/myrmidon/src/java/org/apache/ant Main.java
               proposal/myrmidon/src/java/org/apache/ant/project
                        DefaultProjectEngine.java
               proposal/myrmidon/src/java/org/apache/myrmidon/components/embeddor
                        Embeddor.java MyrmidonEmbeddor.java
               proposal/myrmidon/src/java/org/apache/myrmidon/model
                        DefaultProject.java DefaultTarget.java Target.java
  Log:
  Made model work with Arrays rather than Iterators (more typesafe).
  
  Revision  Changes    Path
  1.20      +2 -0      jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/Main.java
  
  Index: Main.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/Main.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- Main.java	2001/05/29 07:13:12	1.19
  +++ Main.java	2001/05/29 07:33:22	1.20
  @@ -311,6 +311,7 @@
           setupLogger( embeddor );
           embeddor.parameterize( parameters );
           embeddor.initialize();
  +        embeddor.start();
   
           final ProjectBuilder builder = embeddor.getProjectBuilder();
   
  @@ -350,6 +351,7 @@
   
           }
   
  +        embeddor.stop();
           embeddor.dispose();
       }
   
  
  
  
  1.14      +7 -9      jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/project/DefaultProjectEngine.java
  
  Index: DefaultProjectEngine.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/project/DefaultProjectEngine.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- DefaultProjectEngine.java	2001/05/29 06:56:19	1.13
  +++ DefaultProjectEngine.java	2001/05/29 07:33:23	1.14
  @@ -138,13 +138,12 @@
           done.add( targetName );
   
           //execute all dependencies
  -        final Iterator dependencies = target.getDependencies();
  -        while( dependencies.hasNext() )
  +        final String[] dependencies = target.getDependencies();
  +        for( int i = 0; i < dependencies.length; i++ )
           {
  -            final String dependency = (String)dependencies.next();
  -            if( !done.contains( dependency ) )
  +            if( !done.contains( dependencies[ i ] ) )
               {
  -                execute( project, dependency, context, done );
  +                execute( project, dependencies[ i ], context, done );
               }
           }
   
  @@ -210,11 +209,10 @@
           getLogger().debug( "Executing target " + name );
   
           //execute all tasks assciated with target
  -        final Iterator tasks = target.getTasks();
  -        while( tasks.hasNext() )
  +        final Configuration[] tasks = target.getTasks();
  +        for( int i = 0; i < tasks.length; i++ )
           {
  -            final Configuration task = (Configuration)tasks.next();
  -            executeTask( task, context );
  +            executeTask( tasks[ i ], context );
           }
       }
   
  
  
  
  1.3       +2 -1      jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/embeddor/Embeddor.java
  
  Index: Embeddor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/embeddor/Embeddor.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Embeddor.java	2001/05/29 07:13:14	1.2
  +++ Embeddor.java	2001/05/29 07:33:23	1.3
  @@ -10,6 +10,7 @@
   import org.apache.ant.project.ProjectEngine;
   import org.apache.avalon.framework.activity.Disposable;
   import org.apache.avalon.framework.activity.Initializable;
  +import org.apache.avalon.framework.activity.Startable;
   import org.apache.avalon.framework.component.Component;
   import org.apache.avalon.framework.parameters.Parameterizable;
   import org.apache.myrmidon.components.builder.ProjectBuilder;
  @@ -20,7 +21,7 @@
    * @author <a href="mailto:donaldp@apache.org">Peter Donald</a>
    */
   public interface Embeddor
  -    extends Component, Parameterizable, Initializable, Disposable
  +    extends Component, Parameterizable, Initializable, Startable, Disposable
   {
       /**
        * Retrieve builder for runtime.
  
  
  
  1.4       +9 -0      jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/embeddor/MyrmidonEmbeddor.java
  
  Index: MyrmidonEmbeddor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/embeddor/MyrmidonEmbeddor.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- MyrmidonEmbeddor.java	2001/05/29 07:13:14	1.3
  +++ MyrmidonEmbeddor.java	2001/05/29 07:33:23	1.4
  @@ -113,8 +113,17 @@
           setupComponents();
   
           setupFiles();
  +    }
   
  +    public void start()
  +        throws Exception
  +    {
           CamelotUtil.deployFromDirectory( m_deployer, m_taskLibDir, ".tsk" );
  +    }
  +
  +    public void stop()
  +    {
  +        //Undeploy all the tasks by killing ExecutionFrame???
       }
   
       /**
  
  
  
  1.2       +0 -4      jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/model/DefaultProject.java
  
  Index: DefaultProject.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/model/DefaultProject.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultProject.java	2001/05/29 06:17:04	1.1
  +++ DefaultProject.java	2001/05/29 07:33:23	1.2
  @@ -9,12 +9,8 @@
   
   import java.io.File;
   import java.io.IOException;
  -import java.util.ArrayList;
   import java.util.HashMap;
  -import java.util.Iterator;
   import org.apache.ant.AntException;
  -import org.apache.myrmidon.api.DefaultTaskContext;
  -import org.apache.myrmidon.api.TaskContext;
   
   /**
    * Default project implementation.
  
  
  
  1.2       +9 -10     jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/model/DefaultTarget.java
  
  Index: DefaultTarget.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/model/DefaultTarget.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultTarget.java	2001/05/29 06:17:04	1.1
  +++ DefaultTarget.java	2001/05/29 07:33:23	1.2
  @@ -8,7 +8,6 @@
   package org.apache.myrmidon.model;
   
   import java.util.ArrayList;
  -import java.util.Iterator;
   import org.apache.ant.util.Condition;
   import org.apache.avalon.framework.configuration.Configuration;
   
  @@ -20,9 +19,9 @@
   public class DefaultTarget
       implements Target
   {
  -    protected final ArrayList   m_dependencies     = new ArrayList();
  -    protected final ArrayList   m_tasks            = new ArrayList();
  -    protected final Condition   m_condition;
  +    private final ArrayList   m_dependencies     = new ArrayList();
  +    private final ArrayList   m_tasks            = new ArrayList();
  +    private final Condition   m_condition;
   
       /**
        * Constructor taking condition for target.
  @@ -56,9 +55,9 @@
        *
        * @return the dependency list
        */
  -    public Iterator getDependencies()
  +    public String[] getDependencies()
       {
  -        return m_dependencies.iterator();
  +        return (String[])m_dependencies.toArray( new String[ 0 ] );
       }
   
       /**
  @@ -66,9 +65,9 @@
        *
        * @return the target list
        */
  -    public Iterator getTasks()
  +    public Configuration[] getTasks()
       {
  -        return m_tasks.iterator();
  +        return (Configuration[])m_tasks.toArray( new Configuration[ 0 ] );
       }
   
       /**
  @@ -86,8 +85,8 @@
        *
        * @param taskConfiguration the task representation
        */
  -    public void addTask( final Configuration taskConfiguration )
  +    public void addTask( final Configuration taskData )
       {
  -        m_tasks.add( taskConfiguration );
  +        m_tasks.add( taskData );
       }
   }
  
  
  
  1.2       +3 -3      jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/model/Target.java
  
  Index: Target.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/model/Target.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Target.java	2001/05/29 06:17:04	1.1
  +++ Target.java	2001/05/29 07:33:23	1.2
  @@ -7,9 +7,9 @@
    */
   package org.apache.myrmidon.model;
   
  -import java.util.Iterator;
   import org.apache.ant.util.Condition;
   import org.apache.avalon.framework.component.Component;
  +import org.apache.avalon.framework.configuration.Configuration;
   
   /**
    * Interface to represent targets in build file.
  @@ -24,14 +24,14 @@
        *
        * @return the dependency list
        */
  -    Iterator getDependencies();
  +    String[] getDependencies();
   
       /**
        * Get tasks in target
        *
        * @return the target list
        */
  -    Iterator getTasks();
  +    Configuration[] getTasks();
   
       /**
        * Get condition under which target is executed.
  
  
  

Mime
View raw message