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/frontends ProjectFileFilter.java
Date Fri, 07 Jun 2002 02:46:32 GMT
donaldp     2002/06/06 19:46:32

  Modified:    container/src/test/org/apache/myrmidon/components/embeddor/test
                        DefaultEmbeddorTest.java
               container/src/java/org/apache/myrmidon/components/builder
                        DefaultProject.java
               container/src/java/org/apache/myrmidon/interfaces
                        EmbeddedAnt.java
               framework/src/java/org/apache/myrmidon/framework
                        ExecuteTarget.java
               container/src/java/org/apache/myrmidon/interfaces/model
                        Module.java
               container/src/java/org/apache/myrmidon/frontends
                        ProjectFileFilter.java
  Log:
  Start moving responsibility of executing back into module
  
  Revision  Changes    Path
  1.20      +2 -3      jakarta-ant-myrmidon/container/src/test/org/apache/myrmidon/components/embeddor/test/DefaultEmbeddorTest.java
  
  Index: DefaultEmbeddorTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/test/org/apache/myrmidon/components/embeddor/test/DefaultEmbeddorTest.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- DefaultEmbeddorTest.java	2 Jun 2002 14:08:06 -0000	1.19
  +++ DefaultEmbeddorTest.java	7 Jun 2002 02:46:31 -0000	1.20
  @@ -26,7 +26,7 @@
    * Test cases for the default embeddor.
    *
    * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
  - * @version $Revision: 1.19 $ $Date: 2002/06/02 14:08:06 $
  + * @version $Revision: 1.20 $ $Date: 2002/06/07 02:46:31 $
    */
   public class DefaultEmbeddorTest
       extends AbstractContainerTestCase
  @@ -126,7 +126,6 @@
   
           // Build the workspace
           final ExecutionFrame frame = embeddor.createExecutionFrame( new HashMap() );
  -        final Workspace workspace = project.createWorkspace( frame );
   
           // Install a listener
           final LogMessageTracker listener = new LogMessageTracker();
  @@ -136,7 +135,7 @@
   
           // Execute the default target
           final Target target = project.getDefaultTarget();
  -        workspace.executeTarget( target );
  +        project.execute( frame, target );
   
           // Cleanup
           listener.assertComplete();
  
  
  
  1.19      +10 -3     jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/builder/DefaultProject.java
  
  Index: DefaultProject.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/builder/DefaultProject.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- DefaultProject.java	2 Jun 2002 14:08:05 -0000	1.18
  +++ DefaultProject.java	7 Jun 2002 02:46:31 -0000	1.19
  @@ -28,7 +28,7 @@
    * Default project implementation.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.18 $ $Date: 2002/06/02 14:08:05 $
  + * @version $Revision: 1.19 $ $Date: 2002/06/07 02:46:31 $
    */
   public class DefaultProject
       extends AbstractLogEnabled
  @@ -239,11 +239,18 @@
           return this;
       }
   
  +    public void execute( final ExecutionFrame frame,
  +                         final TargetMetaData target )
  +        throws TaskException
  +    {
  +        final Workspace workspace = createWorkspace( frame );
  +        workspace.executeTarget( target );
  +    }
  +
       /**
        * Creates a new workspace to execute this project in.
        */
  -    public Workspace createWorkspace( final ExecutionFrame frame )
  -        throws TaskException
  +    private Workspace createWorkspace( final ExecutionFrame frame )
       {
           final DefaultWorkspace workspace = new DefaultWorkspace();
           setupLogger( workspace );
  
  
  
  1.16      +5 -9      jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/interfaces/EmbeddedAnt.java
  
  Index: EmbeddedAnt.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/interfaces/EmbeddedAnt.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- EmbeddedAnt.java	2 Jun 2002 14:08:06 -0000	1.15
  +++ EmbeddedAnt.java	7 Jun 2002 02:46:31 -0000	1.16
  @@ -27,7 +27,6 @@
   import org.apache.myrmidon.interfaces.executor.ExecutionFrame;
   import org.apache.myrmidon.interfaces.model.TargetMetaData;
   import org.apache.myrmidon.interfaces.oldmodel.Project;
  -import org.apache.myrmidon.interfaces.workspace.Workspace;
   
   /**
    * A utility class, that takes care of launching Myrmidon, and building and
  @@ -40,7 +39,7 @@
    *
    * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.15 $ $Date: 2002/06/02 14:08:06 $
  + * @version $Revision: 1.16 $ $Date: 2002/06/07 02:46:31 $
    */
   public class EmbeddedAnt
       extends AbstractLogEnabled
  @@ -194,11 +193,8 @@
               embeddor.createExecutionFrame( m_workspaceProperties );
           prepareListeners( embeddor, frame );
   
  -        // Create a new workspace
  -        final Workspace workspace = project.createWorkspace( frame );
  -
           //execute the project
  -        executeTargets( workspace, project, targets );
  +        executeTargets( frame, project, targets );
       }
   
       /**
  @@ -224,7 +220,7 @@
       /**
        * Actually do the build.
        */
  -    private void executeTargets( final Workspace workspace,
  +    private void executeTargets( final ExecutionFrame frame,
                                    final Project project,
                                    final String[] targets )
           throws TaskException
  @@ -233,14 +229,14 @@
           if( targets == null || targets.length == 0 )
           {
               final TargetMetaData target = project.getDefaultTarget();
  -            workspace.executeTarget( target );
  +            project.execute( frame, target );
           }
           else
           {
               for( int i = 0; i < targets.length; i++ )
               {
                   final TargetMetaData target = project.getTarget( targets[ i ] );
  -                workspace.executeTarget( target );
  +                project.execute( frame, target );
               }
           }
       }
  
  
  
  1.9       +6 -8      jakarta-ant-myrmidon/framework/src/java/org/apache/myrmidon/framework/ExecuteTarget.java
  
  Index: ExecuteTarget.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/framework/src/java/org/apache/myrmidon/framework/ExecuteTarget.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ExecuteTarget.java	2 Jun 2002 14:08:07 -0000	1.8
  +++ ExecuteTarget.java	7 Jun 2002 02:46:31 -0000	1.9
  @@ -7,18 +7,17 @@
    */
   package org.apache.myrmidon.framework;
   
  +import java.io.File;
   import java.util.HashMap;
   import java.util.Map;
  -import java.io.File;
  +import org.apache.avalon.excalibur.i18n.ResourceManager;
  +import org.apache.avalon.excalibur.i18n.Resources;
   import org.apache.myrmidon.api.TaskContext;
   import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.interfaces.embeddor.Embeddor;
  +import org.apache.myrmidon.interfaces.executor.ExecutionFrame;
   import org.apache.myrmidon.interfaces.oldmodel.Project;
   import org.apache.myrmidon.interfaces.oldmodel.Target;
  -import org.apache.myrmidon.interfaces.workspace.Workspace;
  -import org.apache.myrmidon.interfaces.executor.ExecutionFrame;
  -import org.apache.avalon.excalibur.i18n.ResourceManager;
  -import org.apache.avalon.excalibur.i18n.Resources;
   
   /**
    * A utility class that simplifies executing a target in a project.
  @@ -26,7 +25,7 @@
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
    * @author <a href="mailto:darrell@apache.org">Darrell DeBoer</a>
    * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
  - * @version $Revision: 1.8 $ $Date: 2002/06/02 14:08:07 $
  + * @version $Revision: 1.9 $ $Date: 2002/06/07 02:46:31 $
    */
   public class ExecuteTarget
   {
  @@ -112,8 +111,7 @@
               // TODO - need to be able to inherit services (TypeManager specifically)
               final ExecutionFrame frame =
                   embeddor.createExecutionFrame( properties );
  -            final Workspace workspace = project.createWorkspace( frame );
  -            workspace.executeTarget( target );
  +            project.execute( frame, target );
           }
           catch( final Exception e )
           {
  
  
  
  1.3       +9 -6      jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/interfaces/model/Module.java
  
  Index: Module.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/interfaces/model/Module.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Module.java	2 Jun 2002 14:08:06 -0000	1.2
  +++ Module.java	7 Jun 2002 02:46:31 -0000	1.3
  @@ -7,9 +7,8 @@
    */
   package org.apache.myrmidon.interfaces.model;
   
  -import org.apache.myrmidon.interfaces.workspace.Workspace;
  -import org.apache.myrmidon.interfaces.executor.ExecutionFrame;
   import org.apache.myrmidon.api.TaskException;
  +import org.apache.myrmidon.interfaces.executor.ExecutionFrame;
   
   /**
    * A Module represents a executable module that Myrmidon is
  @@ -19,7 +18,7 @@
    * object implement the Module interface.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.2 $ $Date: 2002/06/02 14:08:06 $
  + * @version $Revision: 1.3 $ $Date: 2002/06/07 02:46:31 $
    */
   public interface Module
   {
  @@ -33,10 +32,14 @@
       TargetMetaData getMetaData();
   
       /**
  -     * Creates a new workspace to execute this module in.
  +     * Execute the specified target in module
  +     * using specified {@link ExecutionFrame}.
        *
  -     * @param frame the execution frame to use for the workspace.
  +     * @param frame the frame in which to execute
  +     * @param target the target to execute
  +     * @throws TaskException if an error occurs executing module
        */
  -    Workspace createWorkspace( ExecutionFrame frame )
  +    void execute( ExecutionFrame frame,
  +                  TargetMetaData target )
           throws TaskException;
   }
  
  
  
  1.2       +1 -1      jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/frontends/ProjectFileFilter.java
  
  Index: ProjectFileFilter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/frontends/ProjectFileFilter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ProjectFileFilter.java	30 May 2002 06:22:53 -0000	1.1
  +++ ProjectFileFilter.java	7 Jun 2002 02:46:31 -0000	1.2
  @@ -14,7 +14,7 @@
   /**
    * A basic file filter for Ant project files.
    */
  -public class ProjectFileFilter
  +class ProjectFileFilter
       extends FileFilter
   {
       /**
  
  
  

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