continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r788262 - in /continuum/trunk: continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/ continuum-core/src/main/java/org/apache/maven/continuum/core/action/ continuum-store/src/main/java/org/apache/continuum/dao/
Date Thu, 25 Jun 2009 05:08:38 GMT
Author: evenisse
Date: Thu Jun 25 05:08:38 2009
New Revision: 788262

URL: http://svn.apache.org/viewvc?rev=788262&view=rev
Log:
- Use the right project dao method to check project dependencies so we use less SQL requests
- Remove duplicated code
merge 788259:788260 from continuum-1.3.x branch

Modified:
    continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
    continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectAction.java
    continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectGroupAction.java
    continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateBuildProjectTaskAction.java
    continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/BuildResultDaoImpl.java

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java?rev=788262&r1=788261&r2=788262&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
(original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
Thu Jun 25 05:08:38 2009
@@ -85,11 +85,6 @@
     /**
      * @plexus.requirement
      */
-    private ProjectGroupDao projectGroupDao;
-
-    /**
-     * @plexus.requirement
-     */
     private ProjectScmRootDao projectScmRootDao;
 
     /**
@@ -605,7 +600,7 @@
 
         try
         {
-            Project project = projectDao.getProjectWithAllDetails( context.getProject().getId()
);
+            Project project = projectDao.getProjectWithDependencies( context.getProject().getId()
);
             List<ProjectDependency> dependencies = project.getDependencies();
 
             if ( dependencies == null )

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectAction.java?rev=788262&r1=788261&r2=788262&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectAction.java
(original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectAction.java
Thu Jun 25 05:08:38 2009
@@ -55,7 +55,6 @@
 
                 project.addBuildDefinition( buildDefinition );
 
-                projectDao.updateProject( project );
                 if ( buildDefinition.isDefaultForProject() )
                 {
                     AbstractContinuumAction.setBuildDefinition( context, buildDefinition
);
@@ -69,9 +68,10 @@
 
             project.addBuildDefinition( buildDefinition );
 
-            projectDao.updateProject( project );
             AbstractContinuumAction.setBuildDefinition( context, buildDefinition );
         }
 
+        // Save the project
+        projectDao.updateProject( project );
     }
 }

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectGroupAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectGroupAction.java?rev=788262&r1=788261&r2=788262&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectGroupAction.java
(original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddBuildDefinitionToProjectGroupAction.java
Thu Jun 25 05:08:38 2009
@@ -57,8 +57,6 @@
                 resolveDefaultBuildDefinitionsForProjectGroup( buildDefinition, projectGroup
);
 
                 projectGroup.addBuildDefinition( buildDefinition );
-
-                projectGroupDao.updateProjectGroup( projectGroup );
             }
         }
         else
@@ -68,9 +66,11 @@
             resolveDefaultBuildDefinitionsForProjectGroup( buildDefinition, projectGroup
);
 
             projectGroup.addBuildDefinition( buildDefinition );
-
-            projectGroupDao.updateProjectGroup( projectGroup );
         }
+
+        // Save the project group
+        projectGroupDao.updateProjectGroup( projectGroup );
+
         //map.put( AbstractContinuumAction.KEY_BUILD_DEFINITION, buildDefinition );
     }
 }

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateBuildProjectTaskAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateBuildProjectTaskAction.java?rev=788262&r1=788261&r2=788262&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateBuildProjectTaskAction.java
(original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateBuildProjectTaskAction.java
Thu Jun 25 05:08:38 2009
@@ -102,23 +102,14 @@
                     }
                     else
                     {
-                        project.setOldState( project.getState() );
-
                         project.setState( ContinuumProjectState.ERROR );
-
-                        projectDao.updateProject( project );
-
-                        project = projectDao.getProject( project.getId() );
                     }
                 }
-                else
-                {
-                    project.setOldState( project.getState() );
+                project.setOldState( project.getState() );
 
-                    projectDao.updateProject( project );
+                projectDao.updateProject( project );
 
-                    project = projectDao.getProject( project.getId() );
-                }
+                project = projectDao.getProject( project.getId() );
 
                 projectsToBeBuilt.add( project );
             }
@@ -129,7 +120,7 @@
             }
         }
 
-        parallelBuildsManager.buildProjects( projectsToBeBuilt, projectsBuildDefinitionsMap,

-        		                             buildTrigger, scmResultMap, projectGroupId );
+        parallelBuildsManager.buildProjects( projectsToBeBuilt, projectsBuildDefinitionsMap,
trigger, scmResultMap,
+                                             projectGroupId );
     }
 }

Modified: continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/BuildResultDaoImpl.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/BuildResultDaoImpl.java?rev=788262&r1=788261&r2=788262&view=diff
==============================================================================
--- continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/BuildResultDaoImpl.java
(original)
+++ continuum/trunk/continuum-store/src/main/java/org/apache/continuum/dao/BuildResultDaoImpl.java
Thu Jun 25 05:08:38 2009
@@ -71,6 +71,7 @@
 
             project.setState( build.getState() );
 
+            //TODO: Use projectDao
             pm.makePersistent( project );
 
             tx.commit();
@@ -142,7 +143,7 @@
 
             if ( result != null && !result.isEmpty() )
             {
-                return (BuildResult) result.get( 0 );
+                return result.get( 0 );
             }
         }
         finally



Mime
View raw message