continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r515173 - 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/
Date Tue, 06 Mar 2007 16:21:11 GMT
Author: evenisse
Date: Tue Mar  6 08:21:10 2007
New Revision: 515173

URL: http://svn.apache.org/viewvc?view=rev&rev=515173
Log:
[CONTINUUM-1202] Build only projects in current group

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

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=515173&r1=515172&r2=515173
==============================================================================
--- 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
Tue Mar  6 08:21:10 2007
@@ -176,6 +176,9 @@
     public void buildProjectGroup( int projectGroupId )
         throws ContinuumException;
 
+    public void buildProjectGroupWithBuildDefinition( int projectGroupId, int buildDefinitionId
)
+        throws ContinuumException;
+
     // ----------------------------------------------------------------------
     // Build information
     // ----------------------------------------------------------------------

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=515173&r1=515172&r2=515173
==============================================================================
--- 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
Tue Mar  6 08:21:10 2007
@@ -693,21 +693,6 @@
     public void buildProjectGroup( int projectGroupId )
         throws ContinuumException
     {
-        Collection projectsList;
-
-        try
-        {
-            projectsList = getProjectsInBuildOrder( store.getProjectsWithDependenciesByGroupId(
projectGroupId ) );
-        }
-        catch ( CycleDetectedException e )
-        {
-            getLogger().warn( "Cycle detected while sorting projects for building, falling
back to unsorted build." );
-
-            projectsList = getProjects();
-        }
-
-        //Map buildDefinitionsIds = store.getDefaultBuildDefinitions();
-
         BuildDefinition groupDefaultBD = null;
         try
         {
@@ -724,35 +709,79 @@
                 " doens't have a default build definition, this should be impossible, it
should always have a default definition set." );
         }
 
+        buildProjectGroupWithBuildDefinition( projectGroupId, groupDefaultBD.getId(), true
);
+    }
+
+    /**
+     * fire off a build for all of the projects in a project group using their default builds
+     *
+     * @param projectGroupId
+     * @throws ContinuumException
+     */
+    public void buildProjectGroupWithBuildDefinition( int projectGroupId, int buildDefinitionId
)
+        throws ContinuumException
+    {
+        buildProjectGroupWithBuildDefinition( projectGroupId, buildDefinitionId, false );
+    }
+
+    /**
+     * fire off a build for all of the projects in a project group using their default builds
+     *
+     * @param projectGroupId
+     * @throws ContinuumException
+     */
+    private void buildProjectGroupWithBuildDefinition( int projectGroupId, int buildDefinitionId,
+                                                       boolean checkDefaultBuildDefinitionForProject
)
+        throws ContinuumException
+    {
+        Collection projectsList;
+
+        try
+        {
+            projectsList = getProjectsInBuildOrder( store.getProjectsWithDependenciesByGroupId(
projectGroupId ) );
+        }
+        catch ( CycleDetectedException e )
+        {
+            getLogger().warn( "Cycle detected while sorting projects for building, falling
back to unsorted build." );
+
+            projectsList = getProjects();
+        }
+
+        //Map buildDefinitionsIds = store.getDefaultBuildDefinitions();
+
         for ( Iterator i = projectsList.iterator(); i.hasNext(); )
         {
             Project project = (Project) i.next();
 
-            int buildDefId = groupDefaultBD.getId();
+            int buildDefId = buildDefinitionId;
 
-            BuildDefinition projectDefaultBD = null;
-            try
-            {
-                projectDefaultBD = store.getDefaultBuildDefinitionForProject( project.getId()
);
-            }
-            catch ( ContinuumObjectNotFoundException e )
+            if ( checkDefaultBuildDefinitionForProject )
             {
-                getLogger().debug( e.getMessage() );
-            }
-            catch ( ContinuumStoreException e )
-            {
-                getLogger().debug( e.getMessage() );
+                BuildDefinition projectDefaultBD = null;
+                try
+                {
+                    projectDefaultBD = store.getDefaultBuildDefinitionForProject( project.getId()
);
+                }
+                catch ( ContinuumObjectNotFoundException e )
+                {
+                    getLogger().debug( e.getMessage() );
+                }
+                catch ( ContinuumStoreException e )
+                {
+                    getLogger().debug( e.getMessage() );
+                }
+
+                if ( projectDefaultBD != null )
+                {
+                    buildDefId = projectDefaultBD.getId();
+                    getLogger().debug( "Project " + project.getId() +
+                        " has own default build definition, will use it instead of group's."
);
+                }
             }
 
-            if ( projectDefaultBD != null )
-            {
-                buildDefId = projectDefaultBD.getId();
-                getLogger().debug( "Project " + project.getId() +
-                    " has own default build definition, will use it instead of group's."
);
-            }
-            else if ( !"maven2".equals( project.getExecutorId() ) )
+            if ( !"maven2".equals( project.getExecutorId() ) )
             {
-                getLogger().debug(
+                getLogger().info(
                     "Project " + project.getId() + " is not a maven2 project, will not be
included in group build." );
                 continue;
             }

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=515173&r1=515172&r2=515173
==============================================================================
--- 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
Tue Mar  6 08:21:10 2007
@@ -70,7 +70,7 @@
         {
             if ( buildDefinitionId > 0 )
             {
-                getContinuum().buildProjectsWithBuildDefinition( buildDefinitionId );
+                getContinuum().buildProjectGroupWithBuildDefinition( projectGroupId, buildDefinitionId
);
             }
             else
             {



Mime
View raw message