continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r377730 - in /maven/continuum/branches/continuum-1.0.x: continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
Date Tue, 14 Feb 2006 14:02:41 GMT
Author: evenisse
Date: Tue Feb 14 06:02:40 2006
New Revision: 377730

URL: http://svn.apache.org/viewcvs?rev=377730&view=rev
Log:
Check build queue for couple project/buildDefinition instead of only project so a user can
allow 2 build definitions on a project on the same scheduler

Modified:
    maven/continuum/branches/continuum-1.0.x/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
    maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java

Modified: maven/continuum/branches/continuum-1.0.x/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
URL: http://svn.apache.org/viewcvs/maven/continuum/branches/continuum-1.0.x/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java?rev=377730&r1=377729&r2=377730&view=diff
==============================================================================
--- maven/continuum/branches/continuum-1.0.x/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
(original)
+++ maven/continuum/branches/continuum-1.0.x/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
Tue Feb 14 06:02:40 2006
@@ -76,6 +76,9 @@
     boolean isInBuildingQueue( int projectId )
         throws ContinuumException;
 
+    boolean isInBuildingQueue( int projectId, int buildDefinitionId )
+        throws ContinuumException;
+
     boolean isInCheckoutQueue( int projectId )
         throws ContinuumException;
     // ----------------------------------------------------------------------

Modified: maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewcvs/maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=377730&r1=377729&r2=377730&view=diff
==============================================================================
--- maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
(original)
+++ maven/continuum/branches/continuum-1.0.x/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
Tue Feb 14 06:02:40 2006
@@ -199,6 +199,12 @@
     public boolean isInBuildingQueue( int projectId )
         throws ContinuumException
     {
+        return isInBuildingQueue( projectId, -1 );
+    }
+
+    public boolean isInBuildingQueue( int projectId, int buildDefinitionId )
+        throws ContinuumException
+    {
         List queue;
 
         try
@@ -214,9 +220,19 @@
         {
             BuildProjectTask task = (BuildProjectTask) it.next();
 
-            if ( task.getProjectId() == projectId )
+            if ( buildDefinitionId < 0 )
             {
-                return true;
+                if ( task.getProjectId() == projectId )
+                {
+                    return true;
+                }
+            }
+            else
+            {
+                if ( task.getProjectId() == projectId && task.getBuildDefinitionId()
== buildDefinitionId )
+                {
+                    return true;
+                }
             }
         }
 
@@ -387,7 +403,8 @@
 
             Integer buildDefId = ( (Integer) projectsMap.get( new Integer( p.getId() ) )
);
 
-            if ( buildDefId != null && !isInBuildingQueue( p.getId() ) &&
!isInCheckoutQueue( p.getId() ) )
+            if ( buildDefId != null && !isInBuildingQueue( p.getId(), buildDefId.intValue()
) &&
+                !isInCheckoutQueue( p.getId() ) )
             {
                 buildProject( p.getId(), buildDefId.intValue(), ContinuumProjectState.TRIGGER_SCHEDULED,
false );
             }
@@ -429,7 +446,7 @@
     {
         if ( checkQueues )
         {
-            if ( isInBuildingQueue( projectId ) || isInCheckoutQueue( projectId ) )
+            if ( isInBuildingQueue( projectId, buildDefinitionId ) || isInCheckoutQueue(
projectId ) )
             {
                 return;
             }
@@ -447,7 +464,7 @@
                 if ( executor.isBuilding( project ) )
                 {
                     // project is building
-                    getLogger().info( "Project '" + project.getName() + "' always running.");
+                    getLogger().info( "Project '" + project.getName() + "' always running."
);
                     return;
                 }
                 else



Mime
View raw message