continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvan...@apache.org
Subject svn commit: r219026 - in /maven/continuum/trunk: continuum-api/src/main/java/org/apache/maven/continuum/ continuum-core/src/main/java/org/apache/maven/continuum/ continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/ continuum-core...
Date Thu, 14 Jul 2005 10:06:39 GMT
Author: jvanzyl
Date: Thu Jul 14 03:06:35 2005
New Revision: 219026

URL: http://svn.apache.org/viewcvs?rev=219026&view=rev
Log:
p starting to add build ordering but needs testing

Added:
    maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/BuildOrder.vm
Modified:
    maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
    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/execution/maven/m2/DefaultMavenBuilderHelper.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStore.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/ProjectSorter.java
    maven/continuum/trunk/continuum-model/src/main/resources/continuum.mdo
    maven/continuum/trunk/continuum-plexus-application/app.properties
    maven/continuum/trunk/continuum-web/src/main/resources/templates/navigations/Menu.vm

Modified: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java?rev=219026&r1=219025&r2=219026&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
(original)
+++ maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
Thu Jul 14 03:06:35 2005
@@ -18,6 +18,7 @@
 
 import java.util.Collection;
 import java.util.Map;
+import java.util.List;
 
 import org.apache.maven.continuum.project.AntProject;
 import org.apache.maven.continuum.project.ContinuumBuild;
@@ -28,6 +29,7 @@
 import org.apache.maven.continuum.project.ContinuumNotifier;
 import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult;
 import org.apache.maven.continuum.scm.ScmResult;
+import org.codehaus.plexus.util.dag.CycleDetectedException;
 
 /**
  * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
@@ -73,6 +75,9 @@
     // ----------------------------------------------------------------------
     // Building
     // ----------------------------------------------------------------------
+
+    List getProjectsInBuildOrder()
+        throws CycleDetectedException, ContinuumException;
 
     void buildProjects()
         throws ContinuumException;

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=219026&r1=219025&r2=219026&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
Thu Jul 14 03:06:35 2005
@@ -36,8 +36,10 @@
 import org.apache.maven.continuum.project.builder.maven.MavenOneContinuumProjectBuilder;
 import org.apache.maven.continuum.project.builder.maven.MavenTwoContinuumProjectBuilder;
 import org.apache.maven.continuum.scm.ScmResult;
+import org.apache.maven.continuum.utils.ProjectSorter;
 import org.codehaus.plexus.action.ActionManager;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
+import org.codehaus.plexus.util.dag.CycleDetectedException;
 
 import java.util.Collection;
 import java.util.HashMap;
@@ -155,6 +157,35 @@
 
             buildProject( project.getId(), force );
         }
+
+        /*
+        try
+        {
+            for ( Iterator i = getProjectsInBuildOrder().iterator(); i.hasNext(); )
+            {
+                ContinuumProject project = (ContinuumProject) i.next();
+
+                buildProject( project.getId(), force );
+            }
+        }
+        catch ( CycleDetectedException e )
+        {
+            getLogger().warn( "Cycle detected while sorting projects for building, falling
back to unsorted build." );
+
+            for ( Iterator i = getProjects().iterator(); i.hasNext(); )
+            {
+                ContinuumProject project = (ContinuumProject) i.next();
+
+                buildProject( project.getId(), force );
+            }
+        }
+        */
+    }
+
+    public List getProjectsInBuildOrder()
+        throws CycleDetectedException, ContinuumException
+    {
+        return ProjectSorter.getSortedProjects( getProjects() );
     }
 
     public void buildProject( String projectId )
@@ -357,7 +388,7 @@
 
             actionManager.lookup( "create-projects-from-metadata" ).execute( context );
 
-            result = (ContinuumProjectBuildingResult) context.get( CreateProjectsFromMetadata.KEY_PROJECT_BUILDING_RESULT
);            
+            result = (ContinuumProjectBuildingResult) context.get( CreateProjectsFromMetadata.KEY_PROJECT_BUILDING_RESULT
);
 
             if ( result.getWarnings().size() > 0 )
             {
@@ -551,7 +582,7 @@
 
             if ( value instanceof String )
             {
-                notifierProperties.setProperty( (String) key, (String) value  );
+                notifierProperties.setProperty( (String) key, (String) value );
             }
         }
 

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java?rev=219026&r1=219025&r2=219026&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java
Thu Jul 14 03:06:35 2005
@@ -22,6 +22,7 @@
 import org.apache.maven.continuum.project.ContinuumDeveloper;
 import org.apache.maven.continuum.project.ContinuumNotifier;
 import org.apache.maven.continuum.project.MavenTwoProject;
+import org.apache.maven.continuum.project.ContinuumDependency;
 import org.apache.maven.model.CiManagement;
 import org.apache.maven.model.Developer;
 import org.apache.maven.model.Notifier;
@@ -170,9 +171,17 @@
 
             for ( Iterator i = mavenProject.getDependencies().iterator(); i.hasNext(); )
             {
-                Dependency d = (Dependency) i.next();
+                Dependency dependency = (Dependency) i.next();
 
-                dependencies.add( d.getGroupId() + ":" + d.getArtifactId() );
+                ContinuumDependency cd = new ContinuumDependency();
+
+                cd.setGroupId( dependency.getGroupId() );
+
+                cd.setArtifactId( dependency.getArtifactId() );
+
+                cd.setVersion( dependency.getVersion() );
+
+                dependencies.add( cd );
             }
 
             continuumProject.setDependencies( dependencies );

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStore.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStore.java?rev=219026&r1=219025&r2=219026&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStore.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStore.java
Thu Jul 14 03:06:35 2005
@@ -16,26 +16,23 @@
  * limitations under the License.
  */
 
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Collections;
-
-import javax.jdo.JDOHelper;
-import javax.jdo.PersistenceManager;
-import javax.jdo.Query;
-
 import org.apache.maven.continuum.project.ContinuumBuild;
 import org.apache.maven.continuum.project.ContinuumJPoxStore;
 import org.apache.maven.continuum.project.ContinuumProject;
 import org.apache.maven.continuum.project.ContinuumProjectState;
-import org.apache.maven.continuum.scm.ScmResult;
 import org.apache.maven.continuum.scm.ScmFile;
-
+import org.apache.maven.continuum.scm.ScmResult;
 import org.codehaus.plexus.jdo.JdoFactory;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
 import org.codehaus.plexus.util.StringUtils;
+
+import javax.jdo.JDOHelper;
+import javax.jdo.PersistenceManager;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/ProjectSorter.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/ProjectSorter.java?rev=219026&r1=219025&r2=219026&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/ProjectSorter.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/ProjectSorter.java
Thu Jul 14 03:06:35 2005
@@ -3,13 +3,14 @@
  */
 package org.apache.maven.continuum.utils;
 
-import org.apache.maven.model.Dependency;
+import org.apache.maven.continuum.project.ContinuumDependency;
 import org.apache.maven.continuum.project.ContinuumProject;
 import org.codehaus.plexus.util.dag.CycleDetectedException;
 import org.codehaus.plexus.util.dag.DAG;
 import org.codehaus.plexus.util.dag.TopologicalSorter;
 
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
@@ -39,7 +40,7 @@
      * <li>do a topo sort on the graph that remains.</li>
      * </ul>
      */
-    public static List getSortedProjects( List projects )
+    public static List getSortedProjects( Collection projects )
         throws CycleDetectedException
     {
         DAG dag = new DAG();
@@ -65,7 +66,13 @@
 
             for ( Iterator j = project.getDependencies().iterator(); j.hasNext(); )
             {
-                String dependencyId = (String) i.next();
+                Object o = i.next();
+
+                System.out.println( "o = " + o );
+
+                ContinuumDependency dependency = (ContinuumDependency) o;
+
+                String dependencyId = getDependencyId( dependency );
 
                 if ( dag.getVertex( dependencyId ) != null )
                 {
@@ -87,6 +94,11 @@
     }
 
     private static String getProjectId( ContinuumProject project )
+    {
+        return project.getGroupId() + ":" + project.getArtifactId();
+    }
+
+    private static String getDependencyId( ContinuumDependency project )
     {
         return project.getGroupId() + ":" + project.getArtifactId();
     }

Modified: maven/continuum/trunk/continuum-model/src/main/resources/continuum.mdo
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-model/src/main/resources/continuum.mdo?rev=219026&r1=219025&r2=219026&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-model/src/main/resources/continuum.mdo (original)
+++ maven/continuum/trunk/continuum-model/src/main/resources/continuum.mdo Thu Jul 14 03:06:35
2005
@@ -57,7 +57,7 @@
           <type>String</type>
         </field>
         <field>
-          <name>lastBuildId</name>
+          <name>latestBuildId</name>
           <version>1.0.0</version>
           <type>String</type>
         </field>
@@ -149,6 +149,14 @@
             <multiplicity>*</multiplicity>
           </association>
         </field>
+        <field>
+          <name>dependencies</name>
+          <version>1.0.0</version>
+          <association stash.part="true">
+            <type>ContinuumDependency</type>
+            <multiplicity>*</multiplicity>
+          </association>
+        </field>
       </fields>
     </class>
 
@@ -196,6 +204,29 @@
         </field>
         <field>
           <name>email</name>
+          <version>1.0.0</version>
+          <type>String</type>
+        </field>
+      </fields>
+    </class>
+    
+    <class stash.storable="true">
+      <name>ContinuumDependency</name>
+      <version>1.0.0</version>
+      <fields>
+        <field>
+          <name>groupId</name>
+          <identifier>true</identifier>
+          <version>1.0.0</version>
+          <type>String</type>
+        </field>
+        <field>
+          <name>artifactId</name>
+          <version>1.0.0</version>
+          <type>String</type>
+        </field>
+        <field>
+          <name>version</name>
           <version>1.0.0</version>
           <type>String</type>
         </field>

Modified: maven/continuum/trunk/continuum-plexus-application/app.properties
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-plexus-application/app.properties?rev=219026&r1=219025&r2=219026&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-plexus-application/app.properties (original)
+++ maven/continuum/trunk/continuum-plexus-application/app.properties Thu Jul 14 03:06:35
2005
@@ -21,20 +21,20 @@
 # Development properties
 # ----------------------------------------------------------
 
-#localization.directory=${plexus.home}/../../../../../continuum-web/src/main/resources/localization
-#velocity.templates.directory=${plexus.home}/../../../../../continuum-web/src/main/resources/templates
-#velocimacro.reload = true
-#velocity.resource.caching = false
-#forms.directory=${plexus.home}/../../../../../continuum-web/src/main/resources/forms
-#jetty.port=8080
+localization.directory=${plexus.home}/../../../../../continuum-web/src/main/resources/localization
+velocity.templates.directory=${plexus.home}/../../../../../continuum-web/src/main/resources/templates
+velocimacro.reload = true
+velocity.resource.caching = false
+forms.directory=${plexus.home}/../../../../../continuum-web/src/main/resources/forms
+jetty.port=8080
 
 # ----------------------------------------------------------
 # Production properties
 # ----------------------------------------------------------
 
-localization.directory=${plexus.home}/webapp/localization
-velocity.templates.directory=${plexus.home}/webapp/templates
-velocimacro.reload = false
-velocity.resource.caching = true
-forms.directory=${plexus.home}/webapp/forms
-jetty.port=8080
+#localization.directory=${plexus.home}/webapp/localization
+#velocity.templates.directory=${plexus.home}/webapp/templates
+#velocimacro.reload = false
+#velocity.resource.caching = true
+#forms.directory=${plexus.home}/webapp/forms
+#jetty.port=8080

Modified: maven/continuum/trunk/continuum-web/src/main/resources/templates/navigations/Menu.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/templates/navigations/Menu.vm?rev=219026&r1=219025&r2=219026&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/navigations/Menu.vm (original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/navigations/Menu.vm Thu
Jul 14 03:06:35 2005
@@ -18,6 +18,13 @@
   </div>
  </div>
 
+  <div id="projecttools" class="toolgroup">
+   <div class="label">Build</div>
+   <div class="body">
+     <div><a href="$link.setPage('BuildOrder.vm')">Build Order</a></div>
+   </div>
+  </div>
+
   <!--
   <div id="projecttools" class="toolgroup">
    <div class="label">Import Project</div>

Added: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/BuildOrder.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/BuildOrder.vm?rev=219026&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/BuildOrder.vm
(added)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/BuildOrder.vm
Thu Jul 14 03:06:35 2005
@@ -0,0 +1,14 @@
+$page.setTitle( "Continuum - Build Order" )
+
+<div class="app">
+  <div id="axial" class="h3">
+  <h3>Build Order</h3>
+    <table border="1" cellspacing="2" cellpadding="3" width="100%">
+      #foreach ( $project in $continuum.projectsInBuildOrder )
+      <tr class="$css.nextClass">
+        <td>$project.name</td>
+      </tr>
+      #end
+    </table>
+  </div>
+</div>
\ No newline at end of file



Mime
View raw message