continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r494080 - in /maven/continuum/trunk: continuum-api/src/main/java/org/apache/maven/continuum/ continuum-core/src/main/java/org/apache/maven/continuum/ continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ continuum-webapp/src...
Date Mon, 08 Jan 2007 14:35:22 GMT
Author: evenisse
Date: Mon Jan  8 06:35:21 2007
New Revision: 494080

URL: http://svn.apache.org/viewvc?view=rev&rev=494080
Log:
[CONTINUUM-1110] Allow to force a build of a non-default build definition

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-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildProjectAction.java
    maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/buildDefinitionGroupSummaryComponent.jsp
    maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/buildDefinitionSummaryComponent.jsp
    maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/projectSummaryComponent.jsp

Modified: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java?view=diff&rev=494080&r1=494079&r2=494080
==============================================================================
--- 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
Mon Jan  8 06:35:21 2007
@@ -140,9 +140,15 @@
     void buildProjects()
         throws ContinuumException;
 
+    void buildProjectsWithBuildDefinition( int buildDefinitionId )
+        throws ContinuumException;
+
     void buildProjects( int trigger )
         throws ContinuumException;
 
+    void buildProjects( int trigger, int buildDefinitionId )
+        throws ContinuumException;
+
     void buildProjects( Schedule schedule )
         throws ContinuumException;
 
@@ -150,6 +156,9 @@
         throws ContinuumException;
 
     void buildProject( int projectId, int trigger )
+        throws ContinuumException;
+
+    void buildProjectWithBuildDefinition( int projectId, int buildDefinitionId )
         throws ContinuumException;
 
     void buildProject( int projectId, int buildDefinitionId, int trigger )

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?view=diff&rev=494080&r1=494079&r2=494080
==============================================================================
--- 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
Mon Jan  8 06:35:21 2007
@@ -568,6 +568,12 @@
         buildProjects( ContinuumProjectState.TRIGGER_FORCED );
     }
 
+    public void buildProjectsWithBuildDefinition( int buildDefinitionId )
+        throws ContinuumException
+    {
+        buildProjects( ContinuumProjectState.TRIGGER_FORCED, buildDefinitionId );
+    }
+
     /**
      * fire of the builds of all projects across all project groups using their default build
definitions
      *
@@ -590,8 +596,6 @@
             projectsList = getProjects();
         }
 
-        //Map buildDefinitionsIds = store.getDefaultBuildDefinitions();
-
         for ( Iterator i = projectsList.iterator(); i.hasNext(); )
         {
             Project project = (Project) i.next();
@@ -609,6 +613,37 @@
             }
 
             buildProject( project, buildDefId.intValue(), trigger );
+        }
+    }
+
+    /**
+     * fire of the builds of all projects across all project groups using the group build
definition
+     *
+     * @param trigger
+     * @param buildDefinitionId
+     * @throws ContinuumException
+     */
+    public void buildProjects( int trigger, int buildDefinitionId )
+        throws ContinuumException
+    {
+        Collection projectsList;
+
+        try
+        {
+            projectsList = getProjectsInBuildOrder();
+        }
+        catch ( CycleDetectedException e )
+        {
+            getLogger().warn( "Cycle detected while sorting projects for building, falling
back to unsorted build." );
+
+            projectsList = getProjects();
+        }
+
+        for ( Iterator i = projectsList.iterator(); i.hasNext(); )
+        {
+            Project project = (Project) i.next();
+
+            buildProject( project, buildDefinitionId, trigger );
         }
     }
 

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildProjectAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildProjectAction.java?view=diff&rev=494080&r1=494079&r2=494080
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildProjectAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildProjectAction.java
Mon Jan  8 06:35:21 2007
@@ -32,19 +32,34 @@
 public class BuildProjectAction
     extends ContinuumActionSupport
 {
-
     private int projectId;
 
+    private int buildDefinitionId;
+
     public String execute()
         throws ContinuumException
     {
         if ( projectId > 0 )
         {
-            getContinuum().buildProject( projectId );
+            if ( buildDefinitionId > 0 )
+            {
+                getContinuum().buildProjectWithBuildDefinition( projectId, buildDefinitionId
);
+            }
+            else
+            {
+                getContinuum().buildProject( projectId );
+            }
         }
         else
         {
-            getContinuum().buildProjects();
+            if ( buildDefinitionId > 0 )
+            {
+                getContinuum().buildProjectsWithBuildDefinition( buildDefinitionId );
+            }
+            else
+            {
+                getContinuum().buildProjects();
+            }
         }
 
         return SUCCESS;
@@ -58,5 +73,15 @@
     public int getProjectId()
     {
         return projectId;
+    }
+
+    public void setBuildDefinitionId( int buildDefinitionId )
+    {
+        this.buildDefinitionId = buildDefinitionId;
+    }
+
+    public int getBuildDefinition()
+    {
+        return buildDefinitionId;
     }
 }

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/buildDefinitionGroupSummaryComponent.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/buildDefinitionGroupSummaryComponent.jsp?view=diff&rev=494080&r1=494079&r2=494080
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/buildDefinitionGroupSummaryComponent.jsp
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/buildDefinitionGroupSummaryComponent.jsp
Mon Jan  8 06:35:21 2007
@@ -42,6 +42,17 @@
       <ec:column property="scheduleName" title="schedule"/>
       <ec:column property="from" title="projectView.buildDefinition.from"/>
       <ec:column property="isDefault" title="projectView.buildDefinition.default"/>
+      <ec:column property="buildAction" title="&nbsp;" width="1%">
+        <pss:ifAuthorized permission="continuum-build-group" resource="${projectGroupName}">
+          <ww:url id="buildUrl" action="buildProject" namespace="/">
+            <ww:param name="buildDefinitionId">${pageScope.buildDefinitionSummary.id}</ww:param>
+          </ww:url>
+          <ww:a href="%{buildUrl}"><img src="<ww:url value='/images/buildnow.gif'/>"
alt="<ww:text name='build'/>" title="<ww:text name='build'/>" border="0"></ww:a>
+        </pss:ifAuthorized>
+        <pss:elseAuthorized>
+          <img src="<ww:url value='/images/buildnow_disabled.gif'/>" alt="<ww:text
name='build'/>" title="<ww:text name='build'/>" border="0" />
+        </pss:elseAuthorized>
+      </ec:column>
       <ec:column property="editActions" title="&nbsp;" width="1%">
         <center>
         <pss:ifAuthorized permission="continuum-modify-group" resource="${projectGroupName}">
@@ -107,8 +118,9 @@
       <ec:column property="from" title="projectView.buildDefinition.from"/>
       <ec:column property="isDefault" title="projectView.buildDefinition.default"/>
       <ec:column property="buildNowAction" title="&nbsp;" width="1%">
-        <ww:url id="buildProjectUrl" action="buildProject" namespace="/">
-          <ww:param name="projectId" value="${project.id}"/>
+        <ww:url id="buildProjectUrl" action="buildProject" namespace="/" includeParams="none">
+          <ww:param name="projectId">${pageScope.buildDefinitionSummary.projectId}</ww:param>
+          <ww:param name="buildDefinitionId">${pageScope.buildDefinitionSummary.id}</ww:param>
         </ww:url>
         <ww:a href="%{buildProjectUrl}">
           <img src="<c:url value='/images/buildnow.gif'/>" alt="Build Now" title="Build
Now" border="0">

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/buildDefinitionSummaryComponent.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/buildDefinitionSummaryComponent.jsp?view=diff&rev=494080&r1=494079&r2=494080
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/buildDefinitionSummaryComponent.jsp
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/buildDefinitionSummaryComponent.jsp
Mon Jan  8 06:35:21 2007
@@ -39,6 +39,18 @@
       <ec:column property="scheduleName" title="schedule"/>
       <ec:column property="from" title="projectView.buildDefinition.from"/>
       <ec:column property="isDefault" title="projectView.buildDefinition.default"/>
+      <ec:column property="buildAction" title="&nbsp;" width="1%">
+        <pss:ifAuthorized permission="continuum-build-group" resource="${projectGroupName}">
+          <ww:url id="buildProjectUrl" action="buildProject" namespace="/">
+            <ww:param name="projectId">${pageScope.buildDefinitionSummary.projectId}</ww:param>
+            <ww:param name="buildDefinitionId">${pageScope.buildDefinitionSummary.id}</ww:param>
+          </ww:url>
+          <ww:a href="%{buildProjectUrl}"><img src="<ww:url value='/images/buildnow.gif'/>"
alt="<ww:text name='build'/>" title="<ww:text name='build'/>" border="0"></ww:a>
+        </pss:ifAuthorized>
+        <pss:elseAuthorized>
+          <img src="<ww:url value='/images/buildnow_disabled.gif'/>" alt="<ww:text
name='build'/>" title="<ww:text name='build'/>" border="0" />
+        </pss:elseAuthorized>
+      </ec:column>
       <ec:column property="editAction" title="&nbsp;" width="1%">
         <%-- if the from is PROJECT then render the links differently --%>
         <ww:if test="${pageScope.buildDefinitionSummary.from == 'PROJECT'}">

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/projectSummaryComponent.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/projectSummaryComponent.jsp?view=diff&rev=494080&r1=494079&r2=494080
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/projectSummaryComponent.jsp
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/projectSummaryComponent.jsp
Mon Jan  8 06:35:21 2007
@@ -55,7 +55,7 @@
         <pss:ifAuthorized permission="continuum-build-group" resource="${projectGroupName}">
           <c:choose>
             <c:when test="${!project.inBuildingQueue and !project.inCheckoutQueue and
( project.state gt 0 ) and ( project.state lt 5 )}">
-              <ww:url id="buildProjectUrl" action="buildProject" namespace="/">
+              <ww:url id="buildProjectUrl" action="buildProject" namespace="/" includeParams="none">
                 <ww:param name="projectId" value="${project.id}"/>
               </ww:url>
               <ww:a href="%{buildProjectUrl}">



Mime
View raw message