continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From och...@apache.org
Subject svn commit: r770168 - in /continuum/branches/continuum-flat-multi-module: continuum-api/src/main/java/org/apache/continuum/buildmanager/ continuum-api/src/main/java/org/apache/continuum/taskqueue/ continuum-core/src/main/java/org/apache/continuum/build...
Date Thu, 30 Apr 2009 11:22:50 GMT
Author: oching
Date: Thu Apr 30 11:22:50 2009
New Revision: 770168

URL: http://svn.apache.org/viewvc?rev=770168&view=rev
Log:
[CONTINUUM-2193]
o get correct working directory for multi-module projects

Modified:
    continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/continuum/buildmanager/BuildsManager.java
    continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/continuum/taskqueue/CheckOutTask.java
    continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java
    continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java
    continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddProjectToCheckOutQueueAction.java
    continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckWorkingDirectoryAction.java
    continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckoutProjectContinuumAction.java
    continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CleanWorkingDirectoryAction.java
    continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateWorkingDirectoryFromScmContinuumAction.java
    continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java
    continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/PrepareBuildProjectsTaskExecutor.java
    continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadataTest.java

Modified: continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/continuum/buildmanager/BuildsManager.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/continuum/buildmanager/BuildsManager.java?rev=770168&r1=770167&r2=770168&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/continuum/buildmanager/BuildsManager.java
(original)
+++ continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/continuum/buildmanager/BuildsManager.java
Thu Apr 30 11:22:50 2009
@@ -95,7 +95,7 @@
      * @throws BuildManagerException
      */
     void checkoutProject( int projectId, String projectName, File workingDirectory, String
scmRootUrl,
-                          String scmUsername, String scmPassword, BuildDefinition defaultBuildDefinition,
List<Integer> subProjects )
+                          String scmUsername, String scmPassword, BuildDefinition defaultBuildDefinition,
List<Project> subProjects )
         throws BuildManagerException;
 
     /**

Modified: continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/continuum/taskqueue/CheckOutTask.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/continuum/taskqueue/CheckOutTask.java?rev=770168&r1=770167&r2=770168&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/continuum/taskqueue/CheckOutTask.java
(original)
+++ continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/continuum/taskqueue/CheckOutTask.java
Thu Apr 30 11:22:50 2009
@@ -22,6 +22,7 @@
 import java.io.File;
 import java.util.List;
 
+import org.apache.maven.continuum.model.project.Project;
 import org.codehaus.plexus.taskqueue.Task;
 
 /**
@@ -43,10 +44,10 @@
     
     private final String scmRootUrl;
     
-    private final List<Integer> subProjects;
+    private final List<Project> projectsWithSimilarScmRoot;
 
     public CheckOutTask( int projectId, File workingDirectory, String projectName, String
scmUserName,
-                         String scmPassword, String scmRootUrl, List<Integer> subProjects
)
+                         String scmPassword, String scmRootUrl, List<Project> projectsWithSimilarScmRoot
)
     {
         this.projectId = projectId;
 
@@ -60,7 +61,7 @@
         
         this.scmRootUrl = scmRootUrl;
         
-        this.subProjects = subProjects;
+        this.projectsWithSimilarScmRoot = projectsWithSimilarScmRoot;
     }
 
     public int getProjectId()
@@ -105,8 +106,8 @@
         return scmRootUrl;
     }
 
-    public List<Integer> getSubProjects()
+    public List<Project> getProjectsWithSimilarScmRoot()
     {
-        return subProjects;
+        return projectsWithSimilarScmRoot;
     }
 }

Modified: continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java?rev=770168&r1=770167&r2=770168&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java
(original)
+++ continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java
Thu Apr 30 11:22:50 2009
@@ -370,7 +370,7 @@
      * @see BuildsManager#checkoutProject(int, String, File, String, String, String, BuildDefinition,
List)
      */
     public void checkoutProject( int projectId, String projectName, File workingDirectory,
String scmRootUrl,
-                                 String scmUsername, String scmPassword, BuildDefinition
defaultBuildDefinition, List<Integer> subProjects )
+                                 String scmUsername, String scmPassword, BuildDefinition
defaultBuildDefinition, List<Project> subProjects )
         throws BuildManagerException
     {
         try

Modified: continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=770168&r1=770167&r2=770168&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
(original)
+++ continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
Thu Apr 30 11:22:50 2009
@@ -23,6 +23,7 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
@@ -30,6 +31,7 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Properties;
+import java.util.Set;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
@@ -985,6 +987,8 @@
         Map<Integer, Integer> projectsBuildDefinitionsMap = new HashMap<Integer,
Integer>();
         projectsBuildDefinitionsMap.put( projectId, buildDef.getId() );
 
+        // TODO: deng - projects under the same root project should be queued in the same
checkout & build queue!
+        //   - not sure where this should be fixed
         ProjectScmRoot scmRoot = getProjectScmRootByProject( projectId );
         prepareBuildProjects( projectsBuildDefinitionsMap, trigger, scmRoot.getScmRootAddress(),
                               scmRoot.getProjectGroup().getId(), scmRoot.getId() );
@@ -1627,16 +1631,13 @@
                     
                     if( rootProject != null )
                     {   
-                        List<Integer> subProjects = new ArrayList<Integer>();
-                        for( Project subProject : projects )
+                        List<Project> projectsWithSimilarScmRoot = new ArrayList<Project>();
+                        for( Project projectWithSimilarScmRoot : projects )
                         {
-                            if( subProject.getId() != rootProject.getId() )
-                            {
-                                subProjects.add( new Integer( subProject.getId() ) );
-                            }
+                            projectsWithSimilarScmRoot.add( projectWithSimilarScmRoot );
                           
                         }
 
-                        context.put( AbstractContinuumAction.KEY_PROJECTS_UNDER_ROOT_PROJECT,
subProjects );
+                        context.put( AbstractContinuumAction.KEY_PROJECTS_IN_GROUP_WITH_SIMILAR_SCM_ROOT,
projectsWithSimilarScmRoot );
                     }
                     
                     addProjectToCheckoutQueue( projectBuilderId, buildDefinitionTemplateId,
context, projectGroupCreation,
@@ -3387,14 +3388,16 @@
 
                 ProjectScmRoot scmRoot = getProjectScmRootByProject( projectId );
 
+                // TODO: deng - do we still need a projectsAndBuildDefinitionsMap? All multi-module
projects
+                //    are now checked out in a single directory so once they are built
                 Map<Integer, Integer> projectsAndBuildDefinitionsMap = map.get( scmRoot
);
 
                 if ( projectsAndBuildDefinitionsMap == null )
                 {
                     projectsAndBuildDefinitionsMap = new HashMap<Integer, Integer>();
                 }
-
-                projectsAndBuildDefinitionsMap.put( projectId, buildDefinitionId );
+                
+                projectsAndBuildDefinitionsMap.put( projectId, buildDefinitionId );     
          
 
                 map.put( scmRoot, projectsAndBuildDefinitionsMap );
             }

Modified: continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java?rev=770168&r1=770167&r2=770168&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java
(original)
+++ continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java
Thu Apr 30 11:22:50 2009
@@ -102,7 +102,7 @@
     
     public static final String KEY_URL = "url";
     
-    public static final String KEY_PROJECTS_UNDER_ROOT_PROJECT = "projects-under-root-project";
+    public static final String KEY_PROJECTS_IN_GROUP_WITH_SIMILAR_SCM_ROOT = "projects-in-group-with-similar-scm-root";
 
     // ----------------------------------------------------------------------
     //
@@ -234,9 +234,9 @@
         return (Map<Integer, ScmResult>) getObject( context, KEY_SCM_RESULT_MAP );
     }
     
-    public static List<Integer> getListOfProjectsUnderRootProject( Map<String, Object>
context )
+    public static List<Project> getListOfProjectsInGroupWithSimilarScmRoot( Map<String,
Object> context )
     {
-        return (List<Integer>) getObject( context, KEY_PROJECTS_UNDER_ROOT_PROJECT,
new ArrayList<Integer>() );
+        return (List<Project>) getObject( context, KEY_PROJECTS_IN_GROUP_WITH_SIMILAR_SCM_ROOT,
new ArrayList<Integer>() );
     }
     
     

Modified: continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddProjectToCheckOutQueueAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddProjectToCheckOutQueueAction.java?rev=770168&r1=770167&r2=770168&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddProjectToCheckOutQueueAction.java
(original)
+++ continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddProjectToCheckOutQueueAction.java
Thu Apr 30 11:22:50 2009
@@ -67,6 +67,6 @@
         parallelBuildsManager.checkoutProject( project.getId(), project.getName(),
                                                workingDirectoryService.getWorkingDirectory(
project ),
                                                scmRootUrl, project.getScmUsername(),
-                                               project.getScmPassword(), defaultBuildDefinition,
getListOfProjectsUnderRootProject( context ) );
+                                               project.getScmPassword(), defaultBuildDefinition,
getListOfProjectsInGroupWithSimilarScmRoot( context ) );
     }
 }

Modified: continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckWorkingDirectoryAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckWorkingDirectoryAction.java?rev=770168&r1=770167&r2=770168&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckWorkingDirectoryAction.java
(original)
+++ continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckWorkingDirectoryAction.java
Thu Apr 30 11:22:50 2009
@@ -20,9 +20,11 @@
  */
 
 import java.io.File;
+import java.util.List;
 import java.util.Map;
 
 import org.apache.continuum.dao.ProjectDao;
+import org.apache.continuum.model.project.ProjectScmRoot;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.utils.WorkingDirectoryService;
 
@@ -49,8 +51,13 @@
         throws Exception
     {
         Project project = projectDao.getProject( getProjectId( context ) );
+        List<Project> projectsWithSimilarScmRoot = getListOfProjectsInGroupWithSimilarScmRoot(
context );
+        ProjectScmRoot projectScmRoot = getProjectScmRoot( context );
 
-        File workingDirectory = workingDirectoryService.getWorkingDirectory( project );
+       // File workingDirectory = workingDirectoryService.getWorkingDirectory( project );
+        File workingDirectory =
+            workingDirectoryService.getWorkingDirectory( project, projectScmRoot.getScmRootAddress(),
+                                                         projectsWithSimilarScmRoot );
 
         if ( !workingDirectory.exists() )
         {

Modified: continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckoutProjectContinuumAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckoutProjectContinuumAction.java?rev=770168&r1=770167&r2=770168&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckoutProjectContinuumAction.java
(original)
+++ continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckoutProjectContinuumAction.java
Thu Apr 30 11:22:50 2009
@@ -93,7 +93,7 @@
 
         ScmResult result;
 
-        List<Integer> subProjects = getListOfProjectsUnderRootProject( context );
+        List<Project> projectsWithSimilarScmRoot = getListOfProjectsInGroupWithSimilarScmRoot(
context );
         
         try
         {
@@ -195,14 +195,14 @@
             projectDao.updateProject( project );
             
             // update state of sub-projects 
-            // if multi-module project was checked out in a single directory, subProjects
must not be null            
-            for( Integer id : subProjects )
+            // if multi-module project was checked out in a single directory, these must
not be null            
+            for( Project projectWithSimilarScmRoot : projectsWithSimilarScmRoot )
             {
-                Project subProject = projectDao.getProject( id.intValue() );
-                if( subProject != null )
+                projectWithSimilarScmRoot = projectDao.getProject( projectWithSimilarScmRoot.getId()
);
+                if( projectWithSimilarScmRoot != null && projectWithSimilarScmRoot.getId()
!= project.getId() )
                 {
-                    subProject.setState( ContinuumProjectState.CHECKEDOUT );
-                    projectDao.updateProject( subProject );                    
+                    projectWithSimilarScmRoot.setState( ContinuumProjectState.CHECKEDOUT
);
+                    projectDao.updateProject( projectWithSimilarScmRoot );              
     
                 }
             }
             notifier.checkoutComplete( project, buildDefinition );

Modified: continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CleanWorkingDirectoryAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CleanWorkingDirectoryAction.java?rev=770168&r1=770167&r2=770168&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CleanWorkingDirectoryAction.java
(original)
+++ continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CleanWorkingDirectoryAction.java
Thu Apr 30 11:22:50 2009
@@ -20,12 +20,14 @@
  */
 
 import org.apache.continuum.dao.ProjectDao;
+import org.apache.continuum.model.project.ProjectScmRoot;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.utils.WorkingDirectoryService;
 import org.apache.maven.shared.model.fileset.FileSet;
 import org.apache.maven.shared.model.fileset.util.FileSetManager;
 
 import java.io.File;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -51,8 +53,11 @@
         throws Exception
     {
         Project project = projectDao.getProject( getProjectId( context ) );
+        List<Project> projectsWithSimilarScmRoot = getListOfProjectsInGroupWithSimilarScmRoot(
context );
+        ProjectScmRoot projectScmRoot = getProjectScmRoot( context ); 
 
-        File workingDirectory = workingDirectoryService.getWorkingDirectory( project );
+        //File workingDirectory = workingDirectoryService.getWorkingDirectory( project );
+        File workingDirectory = workingDirectoryService.getWorkingDirectory( project, projectScmRoot.getScmRootAddress(),
projectsWithSimilarScmRoot );
 
         if ( workingDirectory.exists() )
         {

Modified: continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateWorkingDirectoryFromScmContinuumAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateWorkingDirectoryFromScmContinuumAction.java?rev=770168&r1=770167&r2=770168&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateWorkingDirectoryFromScmContinuumAction.java
(original)
+++ continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateWorkingDirectoryFromScmContinuumAction.java
Thu Apr 30 11:22:50 2009
@@ -21,6 +21,7 @@
 
 import org.apache.continuum.dao.BuildResultDao;
 import org.apache.continuum.dao.ProjectDao;
+import org.apache.continuum.model.project.ProjectScmRoot;
 import org.apache.continuum.scm.ContinuumScm;
 import org.apache.continuum.scm.ContinuumScmConfiguration;
 import org.apache.continuum.utils.ContinuumUtils;
@@ -103,12 +104,22 @@
         {
         }
 
+        // TODO: deng - should the update be from the scm root url? if so, then it seems
that not all the projects within
+        //      the same scm root should update! maybe only the root project? OR all projects
sharing the same scm 
+        //      root must update from the scm root! (second option is more sensible)
+        
         try
         {
             notifier.checkoutStarted( project, buildDefinition );
 
+            List<Project> projectsWithSimilarScmRoot = getListOfProjectsInGroupWithSimilarScmRoot(
context );
+            ProjectScmRoot projectScmRoot = getProjectScmRoot( context );
+
             // TODO: not sure why this is different to the context, but it all needs to change
-            File workingDirectory = workingDirectoryService.getWorkingDirectory( project
);
+            //File workingDirectory = workingDirectoryService.getWorkingDirectory( project
);
+            File workingDirectory =
+                workingDirectoryService.getWorkingDirectory( project, projectScmRoot.getScmRootAddress(),
+                                                             projectsWithSimilarScmRoot );
             ContinuumScmConfiguration config = createScmConfiguration( project, workingDirectory
);
             config.setLatestUpdateDate( latestUpdateDate );
             String tag = config.getTag();

Modified: continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java?rev=770168&r1=770167&r2=770168&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java
(original)
+++ continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/CheckOutTaskExecutor.java
Thu Apr 30 11:22:50 2009
@@ -95,7 +95,7 @@
 
         context.put( AbstractContinuumAction.KEY_PROJECT_SCM_ROOT, task.getScmRootUrl() );
 
-        context.put( AbstractContinuumAction.KEY_PROJECTS_UNDER_ROOT_PROJECT, task.getSubProjects()
);
+        context.put( AbstractContinuumAction.KEY_PROJECTS_IN_GROUP_WITH_SIMILAR_SCM_ROOT,
task.getProjectsWithSimilarScmRoot() );
         
         try
         {

Modified: continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/PrepareBuildProjectsTaskExecutor.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/PrepareBuildProjectsTaskExecutor.java?rev=770168&r1=770167&r2=770168&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/PrepareBuildProjectsTaskExecutor.java
(original)
+++ continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/PrepareBuildProjectsTaskExecutor.java
Thu Apr 30 11:22:50 2009
@@ -187,11 +187,13 @@
 
             List<ProjectScmRoot> scmRoots = projectScmRootDao.getProjectScmRootByProjectGroup(
projectGroup.getId() );
             String projectScmUrl = project.getScmUrl();
-
+            String projectScmRootAddress = "";
+            
             for ( ProjectScmRoot projectScmRoot : scmRoots )
             {
+                projectScmRootAddress = projectScmRoot.getScmRootAddress();
                 if ( projectScmUrl.contains( projectScmRoot.getScmRootAddress() ) )
-                {
+                {                    
                     context.put( AbstractContinuumAction.KEY_PROJECT_SCM_ROOT, projectScmRoot
);
                     break;
                 }
@@ -205,6 +207,19 @@
             context.put( AbstractContinuumAction.KEY_BUILD_DEFINITION,
                          buildDefinitionDao.getBuildDefinition( buildDefinitionId ) );
 
+          //TODO: deng - put all projects in group with the same scm root in the context!

+            //  this, together with the project scm root, will be used to determine the working
dir            
+            List<Project> projectsInGroup = projectGroup.getProjects();
+            List<Project> projectsWithCommonScmRoot = new ArrayList<Project>();
           
+            for( Project projectInGroup : projectsInGroup )
+            {
+                if( projectInGroup.getScmUrl().contains( projectScmRootAddress ) )
+                {
+                    projectsWithCommonScmRoot.add( projectInGroup );
+                }
+            }            
+            context.put( AbstractContinuumAction.KEY_PROJECTS_IN_GROUP_WITH_SIMILAR_SCM_ROOT,
projectsWithCommonScmRoot );
+            
             BuildResult oldBuildResult =
                 buildResultDao.getLatestBuildResultForBuildDefinition( projectId, buildDefinitionId
);
 

Modified: continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadataTest.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadataTest.java?rev=770168&r1=770167&r2=770168&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadataTest.java
(original)
+++ continuum/branches/continuum-flat-multi-module/continuum-core/src/test/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadataTest.java
Thu Apr 30 11:22:50 2009
@@ -149,7 +149,6 @@
             result.hasErrors() );
     }
     
-    // TODO: deng --> should this work with non-recursive mode?    
     public void testExecuteWithCheckoutProjectsInSingleDirectory()
         throws Exception
     {   



Mime
View raw message