continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From och...@apache.org
Subject svn commit: r772935 - in /continuum/branches/continuum-flat-multi-module: continuum-api/src/main/java/org/apache/maven/continuum/execution/ continuum-api/src/main/java/org/apache/maven/continuum/utils/ continuum-commons/src/main/java/org/apache/maven/c...
Date Fri, 08 May 2009 10:53:48 GMT
Author: oching
Date: Fri May  8 10:53:47 2009
New Revision: 772935

URL: http://svn.apache.org/viewvc?rev=772935&view=rev
Log:
[CONTINUUM-2193]
o more bug fixes

Modified:
    continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutor.java
    continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/maven/continuum/utils/WorkingDirectoryService.java
    continuum/branches/continuum-flat-multi-module/continuum-commons/src/main/java/org/apache/maven/continuum/utils/ChrootJailWorkingDirectoryService.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/buildcontroller/DefaultBuildController.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/DeployArtifactContinuumAction.java
    continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java
    continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/execution/AbstractBuildExecutor.java
    continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java
    continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/PrepareBuildProjectsTaskExecutor.java

Modified: continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutor.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutor.java?rev=772935&r1=772934&r2=772935&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutor.java
(original)
+++ continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutor.java
Fri May  8 10:53:47 2009
@@ -52,7 +52,7 @@
         throws ContinuumBuildExecutorException;
 
     //TODO: Move as a plugin
-    void backupTestFiles( Project project, int buildId );
+    void backupTestFiles( Project project, int buildId, String projectScmRootUrl, List<Project>
projectsWithCommonScmRoot );
 
     boolean shouldBuild( List<ChangeSet> changes, Project continuumProject, File workingDirectory,
                          BuildDefinition buildDefinition )

Modified: continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/maven/continuum/utils/WorkingDirectoryService.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/maven/continuum/utils/WorkingDirectoryService.java?rev=772935&r1=772934&r2=772935&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/maven/continuum/utils/WorkingDirectoryService.java
(original)
+++ continuum/branches/continuum-flat-multi-module/continuum-api/src/main/java/org/apache/maven/continuum/utils/WorkingDirectoryService.java
Fri May  8 10:53:47 2009
@@ -34,5 +34,5 @@
 
     File getWorkingDirectory( Project project );
     
-    File getWorkingDirectory( Project project, String projectScmRoot, List<Project>
projects );
+    File getWorkingDirectory( Project project, String projectScmRootUrl, List<Project>
projects );
 }

Modified: continuum/branches/continuum-flat-multi-module/continuum-commons/src/main/java/org/apache/maven/continuum/utils/ChrootJailWorkingDirectoryService.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-commons/src/main/java/org/apache/maven/continuum/utils/ChrootJailWorkingDirectoryService.java?rev=772935&r1=772934&r2=772935&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-commons/src/main/java/org/apache/maven/continuum/utils/ChrootJailWorkingDirectoryService.java
(original)
+++ continuum/branches/continuum-flat-multi-module/continuum-commons/src/main/java/org/apache/maven/continuum/utils/ChrootJailWorkingDirectoryService.java
Fri May  8 10:53:47 2009
@@ -76,6 +76,6 @@
     
     public File getWorkingDirectory( Project project, String projectScmRoot, List<Project>
projects )
     {
-        return null;
+        return getWorkingDirectory( project );
     }
 }

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=772935&r1=772934&r2=772935&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
Fri May  8 10:53:47 2009
@@ -30,6 +30,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;
 
@@ -3353,8 +3354,31 @@
                 projectsAndBuildDefinitionsMap = new HashMap<Integer, Integer>();
             }
             
-            projectsAndBuildDefinitionsMap.put( projectId, buildDefId );                
-            map.put( scmRoot, projectsAndBuildDefinitionsMap );
+            if( project.isCheckedOutInSingleDirectory() )
+            {
+                Set<Integer> keys = projectsAndBuildDefinitionsMap.keySet();
+                if( keys != null && !keys.isEmpty() )
+                {                
+                    for( Integer key : keys )
+                    {
+                        if( key.intValue() > projectId )
+                        {
+                            projectsAndBuildDefinitionsMap.put( projectId, buildDefId );
+                            map.put( scmRoot, projectsAndBuildDefinitionsMap );
+                        }
+                    } 
+                }
+                else
+                {
+                    projectsAndBuildDefinitionsMap.put( projectId, buildDefId );        
           
+                    map.put( scmRoot, projectsAndBuildDefinitionsMap );
+                }
+            }
+            else
+            {
+                projectsAndBuildDefinitionsMap.put( projectId, buildDefId );            
       
+                map.put( scmRoot, projectsAndBuildDefinitionsMap );
+            }
         }
 
         prepareBuildProjects( map, trigger );
@@ -3392,8 +3416,31 @@
                     projectsAndBuildDefinitionsMap = new HashMap<Integer, Integer>();
                 }
              
-                projectsAndBuildDefinitionsMap.put( projectId, buildDefinitionId );     
              
-                map.put( scmRoot, projectsAndBuildDefinitionsMap );                
+                if( project.isCheckedOutInSingleDirectory() )
+                {
+                    Set<Integer> keys = projectsAndBuildDefinitionsMap.keySet();
+                    if( keys != null && !keys.isEmpty() )
+                    {                
+                        for( Integer key : keys )
+                        {
+                            if( key.intValue() > projectId )
+                            {
+                                projectsAndBuildDefinitionsMap.put( projectId, buildDefinitionId
);
+                                map.put( scmRoot, projectsAndBuildDefinitionsMap );
+                            }
+                        } 
+                    }
+                    else
+                    {
+                        projectsAndBuildDefinitionsMap.put( projectId, buildDefinitionId
);                    
+                        map.put( scmRoot, projectsAndBuildDefinitionsMap );
+                    }
+                }
+                else
+                {
+                    projectsAndBuildDefinitionsMap.put( projectId, buildDefinitionId ); 
                  
+                    map.put( scmRoot, projectsAndBuildDefinitionsMap );
+                }   
             }
             catch ( BuildManagerException e )
             {

Modified: continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java?rev=772935&r1=772934&r2=772935&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
(original)
+++ continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
Fri May  8 10:53:47 2009
@@ -369,7 +369,7 @@
                 projectScmRootAddress = projectScmRoot.getScmRootAddress();
                 if ( projectScmUrl.contains( projectScmRoot.getScmRootAddress() ) )
                 {                    
-                    actionContext.put( AbstractContinuumAction.KEY_PROJECT_SCM_ROOT_URL,
projectScmRoot.getScmRootAddress() );
+                    actionContext.put( AbstractContinuumAction.KEY_PROJECT_SCM_ROOT_URL,
projectScmRoot.getScmRootAddress() );                    
                     break;
                 }
             }
@@ -559,10 +559,10 @@
                 
                 Map<String, Object> actionContext = context.getActionContext();   
            
                 List<Project> projectsWithCommonScmRoot = AbstractContinuumAction.getListOfProjectsInGroupWithCommonScmRoot(
actionContext );
-                ProjectScmRoot projectScmRoot = AbstractContinuumAction.getProjectScmRoot(
actionContext );
+                String projectScmRootUrl = AbstractContinuumAction.getString( actionContext,
AbstractContinuumAction.KEY_PROJECT_SCM_ROOT_URL, project.getScmUrl() );
 
                 shouldBuild = executor.shouldBuild( context.getScmResult().getChanges(),
project, 
-                       workingDirectoryService.getWorkingDirectory( project, projectScmRoot.getScmRootAddress(),
projectsWithCommonScmRoot ), context.getBuildDefinition() );                
+                       workingDirectoryService.getWorkingDirectory( project, projectScmRootUrl,
projectsWithCommonScmRoot ), context.getBuildDefinition() );                
             }
             catch ( Exception e )
             {

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=772935&r1=772934&r2=772935&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
Fri May  8 10:53:47 2009
@@ -196,13 +196,13 @@
             
             // update state of sub-projects 
             // if multi-module project was checked out in a single directory, these must
not be null            
-            for( Project projectWithSimilarScmRoot : projectsWithSimilarScmRoot )
+            for( Project projectWithCommonScmRoot : projectsWithSimilarScmRoot )
             {
-                projectWithSimilarScmRoot = projectDao.getProject( projectWithSimilarScmRoot.getId()
);
-                if( projectWithSimilarScmRoot != null && projectWithSimilarScmRoot.getId()
!= project.getId() )
+                projectWithCommonScmRoot = projectDao.getProject( projectWithCommonScmRoot.getId()
);
+                if( projectWithCommonScmRoot != null && projectWithCommonScmRoot.getId()
!= project.getId() )
                 {
-                    projectWithSimilarScmRoot.setState( ContinuumProjectState.CHECKEDOUT
);
-                    projectDao.updateProject( projectWithSimilarScmRoot );              
     
+                    projectWithCommonScmRoot.setState( ContinuumProjectState.CHECKEDOUT );
+                    projectDao.updateProject( projectWithCommonScmRoot );               
    
                 }
             }
             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=772935&r1=772934&r2=772935&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
Fri May  8 10:53:47 2009
@@ -53,7 +53,7 @@
     {
         Project project = projectDao.getProject( getProjectId( context ) );
         List<Project> projectsWithCommonScmRoot = getListOfProjectsInGroupWithCommonScmRoot(
context );        
-        String projectScmRootUrl = getString( context, KEY_PROJECT_SCM_ROOT_URL, null );
+        String projectScmRootUrl = getString( context, KEY_PROJECT_SCM_ROOT_URL, project.getScmUrl()
);
 
         File workingDirectory =
             workingDirectoryService.getWorkingDirectory( project, projectScmRootUrl,

Modified: continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/DeployArtifactContinuumAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/DeployArtifactContinuumAction.java?rev=772935&r1=772934&r2=772935&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/DeployArtifactContinuumAction.java
(original)
+++ continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/DeployArtifactContinuumAction.java
Fri May  8 10:53:47 2009
@@ -103,9 +103,12 @@
             {
                 BuildDefinition buildDefinition = getBuildDefinition( context );
 
+                String projectScmRootUrl = getString( context, KEY_PROJECT_SCM_ROOT_URL,
project.getScmUrl() );
+                List<Project> projectsWithCommonScmRoot = getListOfProjectsInGroupWithCommonScmRoot(
context );
+                
                 List<Artifact> artifacts = buildExecutor.getDeployableArtifacts( project,
-                                                                       workingDirectoryService.getWorkingDirectory(
-                                                                           project ), buildDefinition
);
+                                           workingDirectoryService.getWorkingDirectory(
+                                               project, projectScmRootUrl, projectsWithCommonScmRoot
), buildDefinition );
 
                 LocalRepository repository = project.getProjectGroup().getLocalRepository();
                 

Modified: continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java?rev=772935&r1=772934&r2=772935&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java
(original)
+++ continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java
Fri May  8 10:53:47 2009
@@ -200,11 +200,14 @@
 
             projectDao.updateProject( project );
 
+            String projectScmRootUrl = getString( context, KEY_PROJECT_SCM_ROOT_URL, project.getScmUrl()
);
+            List<Project> projectsWithCommonScmRoot = getListOfProjectsInGroupWithCommonScmRoot(
context );
+            
             // ----------------------------------------------------------------------
             // Backup test result files
             // ----------------------------------------------------------------------
             //TODO: Move as a plugin
-            buildExecutor.backupTestFiles( project, buildResult.getId() );
+            buildExecutor.backupTestFiles( project, buildResult.getId(), projectScmRootUrl,
projectsWithCommonScmRoot );
         }
     }
 }

Modified: continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/execution/AbstractBuildExecutor.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/execution/AbstractBuildExecutor.java?rev=772935&r1=772934&r2=772935&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/execution/AbstractBuildExecutor.java
(original)
+++ continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/execution/AbstractBuildExecutor.java
Fri May  8 10:53:47 2009
@@ -244,7 +244,7 @@
         throws ContinuumBuildExecutorException
     {
 
-        File workingDirectory = getWorkingDirectory( project );
+        File workingDirectory = getWorkingDirectory( project, null, null );
 
         String actualExecutable = findExecutable( executable, defaultExecutable, resolveExecutable,
workingDirectory );
 
@@ -336,7 +336,7 @@
         return jdk.getVarValue();
     }
 
-    public void backupTestFiles( Project project, int buildId )
+    public void backupTestFiles( Project project, int buildId, String projectScmRootUrl,
List<Project> projectsWithCommonScmRoot )
     {
         //Nothing to do, by default
     }
@@ -416,9 +416,9 @@
         return Collections.EMPTY_LIST;
     }
 
-    public File getWorkingDirectory( Project project )
+    public File getWorkingDirectory( Project project, String projectScmRootUrl, List<Project>
projectsWithCommonScmRoot )
     {
-        return getWorkingDirectoryService().getWorkingDirectory( project );
+        return getWorkingDirectoryService().getWorkingDirectory( project, projectScmRootUrl,
projectsWithCommonScmRoot );
     }
 
     public InstallationService getInstallationService()

Modified: continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java?rev=772935&r1=772934&r2=772935&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java
(original)
+++ continuum/branches/continuum-flat-multi-module/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java
Fri May  8 10:53:47 2009
@@ -335,7 +335,7 @@
     }
 
     @Override
-    public void backupTestFiles( Project project, int buildId )
+    public void backupTestFiles( Project project, int buildId, String projectScmRootUrl,
List<Project> projectsWithCommonScmRoot )
     {
         File backupDirectory = null;
         try
@@ -350,7 +350,7 @@
         {
             log.info( "error on surefire backup directory creation skip backup " + e.getMessage(),
e );
         }
-        backupTestFiles( getWorkingDirectory( project ), backupDirectory );
+        backupTestFiles( getWorkingDirectory( project, projectScmRootUrl, projectsWithCommonScmRoot
), backupDirectory );
     }
 
     private void backupTestFiles( File workingDir, File backupDirectory )

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=772935&r1=772934&r2=772935&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
Fri May  8 10:53:47 2009
@@ -278,7 +278,7 @@
 
             context.put( AbstractContinuumAction.KEY_WORKING_DIRECTORY,
                          workingDirectoryService.getWorkingDirectory( project ).getAbsolutePath()
);
-
+            
             performAction( "checkout-project", context );
 
             scmResult = AbstractContinuumAction.getCheckoutResult( context, null );
@@ -554,7 +554,7 @@
                 }
             }
             else if ( project.getState() == ContinuumProjectState.CHECKEDOUT ||
-                project.getState() == ContinuumProjectState.NEW ) //check if no build result
yet for project
+                project.getState() == ContinuumProjectState.NEW || project.isCheckedOutInSingleDirectory()
) //check if no build result yet for project
             {
                 try
                 {



Mime
View raw message