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/interfaces/oldmodel ProjectHelper.java
Date Tue, 11 Jun 2002 06:11:31 GMT
donaldp     2002/06/10 23:11:30

  Modified:    container/src/java/org/apache/myrmidon/components/embeddor
                        DefaultEmbeddor.java
               container/src/test/org/apache/myrmidon/components/embeddor/test
                        DefaultEmbeddorTest.java
               container/src/java/org/apache/myrmidon/components/workspace
                        DefaultWorkspace.java
               container/src/java/org/apache/myrmidon/interfaces
                        EmbeddedAnt.java
               container/src/java/org/apache/myrmidon/interfaces/embeddor
                        Embeddor.java
               framework/src/java/org/apache/myrmidon/framework
                        ExecuteTarget.java
  Removed:     container/src/java/org/apache/myrmidon/interfaces/oldmodel
                        ProjectHelper.java
  Log:
  Remove ProjectHelper hack and move execution functionality back into embeddor for the time
being.
  
  Revision  Changes    Path
  1.87      +25 -1     jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/embeddor/DefaultEmbeddor.java
  
  Index: DefaultEmbeddor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/embeddor/DefaultEmbeddor.java,v
  retrieving revision 1.86
  retrieving revision 1.87
  diff -u -r1.86 -r1.87
  --- DefaultEmbeddor.java	9 Jun 2002 13:24:05 -0000	1.86
  +++ DefaultEmbeddor.java	11 Jun 2002 06:11:29 -0000	1.87
  @@ -29,10 +29,12 @@
   import org.apache.avalon.framework.service.ServiceManager;
   import org.apache.myrmidon.Constants;
   import org.apache.myrmidon.api.TaskContext;
  +import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.api.event.TaskListener;
   import org.apache.myrmidon.api.metadata.ModelElement;
   import org.apache.myrmidon.components.property.DefaultPropertyStore;
   import org.apache.myrmidon.components.workspace.DefaultTaskContext;
  +import org.apache.myrmidon.components.workspace.DefaultWorkspace;
   import org.apache.myrmidon.interfaces.builder.ModelBuilder;
   import org.apache.myrmidon.interfaces.builder.ProjectBuilder;
   import org.apache.myrmidon.interfaces.configurer.Configurer;
  @@ -48,6 +50,7 @@
   import org.apache.myrmidon.interfaces.library.Library;
   import org.apache.myrmidon.interfaces.library.LibraryManager;
   import org.apache.myrmidon.interfaces.oldmodel.Project;
  +import org.apache.myrmidon.interfaces.oldmodel.Target;
   import org.apache.myrmidon.interfaces.property.NameValidatorManager;
   import org.apache.myrmidon.interfaces.property.PropertyResolver;
   import org.apache.myrmidon.interfaces.property.PropertyStore;
  @@ -58,6 +61,7 @@
   import org.apache.myrmidon.interfaces.type.TypeManager;
   import org.apache.myrmidon.interfaces.type.TypeRegistry;
   import org.apache.myrmidon.interfaces.workspace.ProjectDescriptor;
  +import org.apache.myrmidon.interfaces.workspace.Workspace;
   
   /**
    * Default implementation of Embeddor.
  @@ -252,6 +256,26 @@
           m_deployer = null;
           m_serviceManager = null;
           m_context = null;
  +    }
  +
  +    public void execute( ExecutionFrame frame,
  +                         Project project,
  +                         Target target )
  +        throws TaskException
  +    {
  +        final Workspace workspace = createWorkspace( frame );
  +        workspace.execute( project.getProjectDescriptor(), target.getName() );
  +    }
  +
  +    /**
  +     * Creates a new workspace to execute this project in.
  +     */
  +    private Workspace createWorkspace( final ExecutionFrame frame )
  +    {
  +        final DefaultWorkspace workspace = new DefaultWorkspace();
  +        setupLogger( workspace );
  +        workspace.setFrame( frame );
  +        return workspace;
       }
   
       /**
  
  
  
  1.28      +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.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- DefaultEmbeddorTest.java	11 Jun 2002 04:47:10 -0000	1.27
  +++ DefaultEmbeddorTest.java	11 Jun 2002 06:11:30 -0000	1.28
  @@ -19,7 +19,6 @@
   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.ProjectHelper;
   import org.apache.myrmidon.interfaces.oldmodel.Target;
   import org.apache.myrmidon.interfaces.workspace.ProjectDescriptor;
   
  @@ -140,7 +139,7 @@
           // Execute the default target
           final String defaultTargetName = project.getDefaultTargetName();
           final Target target = project.getTarget( defaultTargetName );
  -        ProjectHelper.execute( frame, getLogger(), project, target );
  +        embeddor.execute( frame, project, target );
   
           // Cleanup
           listener.assertComplete();
  
  
  
  1.82      +2 -2      jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/workspace/DefaultWorkspace.java
  
  Index: DefaultWorkspace.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/workspace/DefaultWorkspace.java,v
  retrieving revision 1.81
  retrieving revision 1.82
  diff -u -r1.81 -r1.82
  --- DefaultWorkspace.java	11 Jun 2002 05:30:47 -0000	1.81
  +++ DefaultWorkspace.java	11 Jun 2002 06:11:30 -0000	1.82
  @@ -142,7 +142,7 @@
               for( int i = 0; i < refs.length; i++ )
               {
                   ProjectRef ref = refs[ i ];
  -                propertyStore.setProperty( ProjectDescriptor.KEY + "/" + ref.getName(),
  +                propertyStore.setProperty( ProjectDescriptor.KEY + "-" + ref.getName(),
                                              ref.getProject() );
               }
   
  
  
  
  1.22      +3 -4      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.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- EmbeddedAnt.java	11 Jun 2002 04:47:10 -0000	1.21
  +++ EmbeddedAnt.java	11 Jun 2002 06:11:30 -0000	1.22
  @@ -25,7 +25,6 @@
   import org.apache.myrmidon.interfaces.event.TaskEventManager;
   import org.apache.myrmidon.interfaces.executor.ExecutionFrame;
   import org.apache.myrmidon.interfaces.oldmodel.Project;
  -import org.apache.myrmidon.interfaces.oldmodel.ProjectHelper;
   import org.apache.myrmidon.interfaces.oldmodel.Target;
   import org.apache.myrmidon.interfaces.workspace.ProjectDescriptor;
   
  @@ -221,14 +220,14 @@
               final String defaultTargetName = project.getDefaultTargetName();
               final Target target = project.getTarget( defaultTargetName );
               //Next line an utter hack - need to rejif it completely
  -            ProjectHelper.execute( frame, getLogger(), project, target );
  +            m_embeddor.execute( frame, project, target );
           }
           else
           {
               for( int i = 0; i < targets.length; i++ )
               {
                   final Target target = project.getTarget( targets[ i ] );
  -                ProjectHelper.execute( frame, getLogger(), project, target );
  +                m_embeddor.execute( frame, project, target );
               }
           }
       }
  
  
  
  1.22      +7 -1      jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/interfaces/embeddor/Embeddor.java
  
  Index: Embeddor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/interfaces/embeddor/Embeddor.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- Embeddor.java	9 Jun 2002 03:58:35 -0000	1.21
  +++ Embeddor.java	11 Jun 2002 06:11:30 -0000	1.22
  @@ -8,10 +8,12 @@
   package org.apache.myrmidon.interfaces.embeddor;
   
   import java.util.Map;
  +import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.api.event.TaskListener;
   import org.apache.myrmidon.api.metadata.ModelElement;
   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.ProjectDescriptor;
   
   /**
  @@ -57,4 +59,8 @@
       ExecutionFrame createExecutionFrame( Map properties )
           throws Exception;
   
  +    void execute( ExecutionFrame frame,
  +                  Project project,
  +                  Target target )
  +        throws TaskException;
   }
  
  
  
  1.17      +2 -6      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.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- ExecuteTarget.java	11 Jun 2002 04:47:10 -0000	1.16
  +++ ExecuteTarget.java	11 Jun 2002 06:11:30 -0000	1.17
  @@ -18,10 +18,8 @@
   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.ProjectHelper;
   import org.apache.myrmidon.interfaces.oldmodel.Target;
   import org.apache.myrmidon.interfaces.workspace.ProjectDescriptor;
  -import org.apache.myrmidon.interfaces.BasicLogger;
   
   /**
    * A utility class that simplifies executing a target in a project.
  @@ -117,9 +115,7 @@
               // TODO - need to be able to inherit services (TypeManager specifically)
               final ExecutionFrame frame =
                   embeddor.createExecutionFrame( properties );
  -
  -            //Next line an utter hack - need to rejif it completely
  -            ProjectHelper.execute( frame, new BasicLogger( "", BasicLogger.LEVEL_INFO ),
project, target );
  +            embeddor.execute( frame, project, target );
           }
           catch( final Exception e )
           {
  
  
  

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