continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvan...@apache.org
Subject svn commit: r179798 - in /maven/continuum/trunk/continuum-core/src/main: java/org/apache/maven/continuum/ java/org/apache/maven/continuum/core/action/ resources/META-INF/plexus/
Date Fri, 03 Jun 2005 14:27:22 GMT
Author: jvanzyl
Date: Fri Jun  3 07:27:22 2005
New Revision: 179798

URL: http://svn.apache.org/viewcvs?rev=179798&view=rev
Log:
o trygve and i are going to try some of the new action decomposition.

Modified:
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckOutProjectContinuumAction.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectAction.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProject.java
    maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=179798&r1=179797&r2=179798&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
Fri Jun  3 07:27:22 2005
@@ -17,6 +17,7 @@
  */
 
 import org.apache.maven.continuum.core.ContinuumCore;
+import org.apache.maven.continuum.core.action.BuildProjectsFromMetadataAction;
 import org.apache.maven.continuum.execution.ant.AntBuildExecutor;
 import org.apache.maven.continuum.execution.maven.m1.MavenOneBuildExecutor;
 import org.apache.maven.continuum.execution.maven.m2.MavenTwoBuildExecutor;
@@ -31,15 +32,19 @@
 import org.apache.maven.continuum.project.ContinuumProjectState;
 import org.apache.maven.continuum.project.builder.maven.MavenOneContinuumProjectBuilder;
 import org.apache.maven.continuum.project.builder.maven.MavenTwoContinuumProjectBuilder;
+import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult;
 import org.apache.maven.continuum.scm.CheckOutScmResult;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
 import org.codehaus.plexus.workflow.WorkflowEngine;
+import org.codehaus.plexus.action.ActionManager;
 
 import java.util.Collection;
 import java.util.Properties;
 import java.util.Iterator;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
+import java.util.HashMap;
 
 /**
  * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
@@ -54,6 +59,8 @@
 
     private WorkflowEngine workflowEngine;
 
+    private ActionManager actionManager;
+
     // ----------------------------------------------------------------------
     // Projects
     // ----------------------------------------------------------------------
@@ -327,12 +334,35 @@
     public void addMavenTwoProject( String metadataUrl )
         throws ContinuumException
     {
-        // <action id="build-projects-from-metadata" builderId="maven-two-builder"/>
-        // <action id="validate-project"/>
-        // <action id="store-project"/>
-        // <action id="checkout-project"/>
+        Map context = new HashMap();
+
+        context.put( BuildProjectsFromMetadataAction.KEY_PROJECT_BUILDER_ID, MavenTwoContinuumProjectBuilder.ID
);
+
+        context.put( BuildProjectsFromMetadataAction.KEY_URL, metadataUrl );
+
+        try
+        {
+            actionManager.lookup( "build-projects-from-metadata" ).execute( context );
+
+            ContinuumProjectBuildingResult result = (ContinuumProjectBuildingResult) context.get(
BuildProjectsFromMetadataAction.KEY_PROJECT_BUILDING_RESULT );
+
+            List projects = result.getProjects();
+
+            for ( Iterator i = projects.iterator(); i.hasNext(); )
+            {
+                actionManager.lookup( "validate-project" ).execute( context );
+
+                actionManager.lookup( "store-project" ).execute( context );
+
+                actionManager.lookup( "add-project-checkout-queue" ).execute( context );
+            }
+        }
+        catch ( Exception e )
+        {
+            throw new ContinuumException( "Error adding m2 project: ", e );
+        }
 
-        core.addProjectsFromUrl( metadataUrl, MavenTwoContinuumProjectBuilder.ID );
+        //core.addProjectsFromUrl( metadataUrl, MavenTwoContinuumProjectBuilder.ID );
     }
 
     public void addMavenTwoProject( MavenTwoProject project )

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckOutProjectContinuumAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckOutProjectContinuumAction.java?rev=179798&r1=179797&r2=179798&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckOutProjectContinuumAction.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckOutProjectContinuumAction.java
Fri Jun  3 07:27:22 2005
@@ -34,6 +34,7 @@
     {
         String projectId = getProjectId( context );
 
+        // TODO: just make this get project and hide the store
         ContinuumProject project = getStore().getProject( projectId );
 
         File workingDirectory = getWorkingDirectory( context );

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectAction.java?rev=179798&r1=179797&r2=179798&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectAction.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectAction.java
Fri Jun  3 07:27:22 2005
@@ -22,17 +22,13 @@
      */
     private ContinuumStore store;
 
-    /**
-     * @plexus.configuration
-     *   default-value="${plexus.home}/temp"
-     */
-    private String workingDirectory;
-
     public void execute( Map context )
         throws Exception
     {
         ContinuumProject project = getProject( context );
 
+        File workingDirectory = getWorkingDirectory( context );
+
         String projectId = store.addProject( project.getName(),
                                              project.getScmUrl(),
                                              project.getNagEmailAddress(),
@@ -53,6 +49,9 @@
             throw new ContinuumException( "Could not make the working directory for the project
" +
                                           "'" + projectWorkingDirectory.getAbsolutePath()
+ "'." );
         }
+
+        // The working directory is created based on the project id so we can always
+        // figure out what it is.
 
         project.setWorkingDirectory( projectWorkingDirectory.getAbsolutePath() );
     }

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProject.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProject.java?rev=179798&r1=179797&r2=179798&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProject.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProject.java
Fri Jun  3 07:27:22 2005
@@ -64,6 +64,8 @@
         // Validate each field
         // ----------------------------------------------------------------------
 
+        // This is not really validating but sanitizing.
+
         project.setCommandLineArguments( StringUtils.clean( project.getCommandLineArguments()
) );
     }
 }

Modified: maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml?rev=179798&r1=179797&r2=179798&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml
(original)
+++ maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml
Fri Jun  3 07:27:22 2005
@@ -498,5 +498,51 @@
       </configuration>
     </component>
 
+    <!--
+     |
+     | Actions
+     |
+     -->
+    <component>
+      <role>org.codehaus.plexus.action.Action</role>
+      <role-hint>add-project-to-checkout-queue</role-hint>
+      <implementation>org.apache.maven.continuum.core.action.AddProjectToCheckOutQueueAction</implementation>
+    </component>
+    <component>
+      <role>org.codehaus.plexus.action.Action</role>
+      <role-hint>build-projects-from-metadata</role-hint>
+      <implementation>org.apache.maven.continuum.core.action.BuildProjectsFromMetadataAction</implementation>
+    </component>
+    <component>
+      <role>org.codehaus.plexus.action.Action</role>
+      <role-hint>checkout-project</role-hint>
+      <implementation>org.apache.maven.continuum.core.action.CheckOutProjectContinuumAction</implementation>
+    </component>
+    <component>
+      <role>org.codehaus.plexus.action.Action</role>
+      <role-hint>build-project</role-hint>
+      <implementation>org.apache.maven.continuum.core.action.ExecuteBuilderContinuumAction</implementation>
+    </component>
+    <component>
+      <role>org.codehaus.plexus.action.Action</role>
+      <role-hint>store-project</role-hint>
+      <implementation>org.apache.maven.continuum.core.action.StoreProjectAction</implementation>
+    </component>
+    <component>
+      <role>org.codehaus.plexus.action.Action</role>
+      <role-hint></role-hint>
+      <implementation>org.apache.maven.continuum.core.action.</implementation>
+    </component>
+    <component>
+      <role>org.codehaus.plexus.action.Action</role>
+      <role-hint>update-project</role-hint>
+      <implementation>org.apache.maven.continuum.core.action.UpdateProjectFromScmContinuumAction</implementation>
+    </component>
+    <component>
+      <role>org.codehaus.plexus.action.Action</role>
+      <role-hint>update-project-metadata</role-hint>
+      <implementation>org.apache.maven.continuum.core.action.UpdateProjectMetadataContinuumAction</implementation>
+    </component>
+
   </components>
 </component-set>



Mime
View raw message