continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From och...@apache.org
Subject svn commit: r945005 - in /continuum/branches/continuum-flat-multi-module-updated: continuum-api/src/main/java/org/apache/maven/continuum/execution/ continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/ continuum-core/src/main/java/or...
Date Mon, 17 May 2010 07:42:18 GMT
Author: oching
Date: Mon May 17 07:42:17 2010
New Revision: 945005

URL: http://svn.apache.org/viewvc?rev=945005&view=rev
Log:
fixed building of projects checked out in single directory

Modified:
    continuum/branches/continuum-flat-multi-module-updated/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutor.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/execution/AbstractBuildExecutor.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/execution/ant/AntBuildExecutor.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneBuildExecutor.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/execution/shell/ShellBuildExecutor.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/PrepareBuildProjectsTaskExecutor.java
    continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/test/java/org/apache/maven/continuum/execution/ContinuumBuildExecutorTest.java

Modified: continuum/branches/continuum-flat-multi-module-updated/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutor.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module-updated/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutor.java?rev=945005&r1=945004&r2=945005&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module-updated/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutor.java
(original)
+++ continuum/branches/continuum-flat-multi-module-updated/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutor.java
Mon May 17 07:42:17 2010
@@ -27,7 +27,6 @@ import org.apache.maven.continuum.model.
 
 import java.io.File;
 import java.util.List;
-import java.util.Map;
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
@@ -38,9 +37,9 @@ public interface ContinuumBuildExecutor
     String ROLE = ContinuumBuildExecutor.class.getName();
 
     // TODO: stream the build output
-    ContinuumBuildExecutionResult build( Project project, BuildDefinition buildDefinition,
File buildOutput )
+    ContinuumBuildExecutionResult build( Project project, BuildDefinition buildDefinition,
File buildOutput, List<Project> projectsWithCommonScmRoot, String projectScmRootUrl
)
         throws ContinuumBuildExecutorException;
-
+    
     // TODO: rename to be clearer
     void updateProjectFromCheckOut( File workingDirectory, Project project, BuildDefinition
buildDefinition,
                                     ScmResult scmResult )

Modified: continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java?rev=945005&r1=945004&r2=945005&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
(original)
+++ continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
Mon May 17 07:42:17 2010
@@ -386,7 +386,7 @@ public class DefaultBuildController
                         projectsWithCommonScmRoot.add( projectInGroup );
                     }
                 }
-                AbstractContinuumAction.setListOfProjects( actionContext, projectsWithCommonScmRoot
);
+                AbstractContinuumAction.setListOfProjectsInGroupWithCommonScmRoot( actionContext,
projectsWithCommonScmRoot );
             }
 
             // CONTINUUM-1871 olamy if continuum is killed during building oldBuildResult
will have a endTime 0

Modified: continuum/branches/continuum-flat-multi-module-updated/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-updated/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java?rev=945005&r1=945004&r2=945005&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java
(original)
+++ continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java
Mon May 17 07:42:17 2010
@@ -123,14 +123,19 @@ public class ExecuteBuilderContinuumActi
         setCancelled( context, false );
 
         buildResult = buildResultDao.getBuildResult( buildResult.getId() );
-
+        
+        String projectScmRootUrl = getProjectScmRootUrl( context, project.getScmUrl() );
+        List<Project> projectsWithCommonScmRoot = getListOfProjectsInGroupWithCommonScmRoot(
context );
+        
         try
         {
             notifier.runningGoals( project, buildDefinition, buildResult );
 
             File buildOutputFile = configurationService.getBuildOutputFile( buildResult.getId(),
project.getId() );
-
-            ContinuumBuildExecutionResult result = buildExecutor.build( project, buildDefinition,
buildOutputFile );
+            
+            ContinuumBuildExecutionResult result =
+                buildExecutor.build( project, buildDefinition, buildOutputFile, projectsWithCommonScmRoot,
+                                     projectScmRootUrl );
 
             buildResult.setState( result.getExitCode() == 0 ? ContinuumProjectState.OK :
ContinuumProjectState.FAILED );
 
@@ -205,8 +210,8 @@ public class ExecuteBuilderContinuumActi
 
             projectDao.updateProject( project );
             
-            String projectScmRootUrl = getProjectScmRootUrl( context, project.getScmUrl()
);
-            List<Project> projectsWithCommonScmRoot = getListOfProjectsInGroupWithCommonScmRoot(
context );
+            projectScmRootUrl = getProjectScmRootUrl( context, project.getScmUrl() );
+            projectsWithCommonScmRoot = getListOfProjectsInGroupWithCommonScmRoot( context
);
 
             // ----------------------------------------------------------------------
             // Backup test result files

Modified: continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/execution/AbstractBuildExecutor.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/execution/AbstractBuildExecutor.java?rev=945005&r1=945004&r2=945005&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/execution/AbstractBuildExecutor.java
(original)
+++ continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/execution/AbstractBuildExecutor.java
Mon May 17 07:42:17 2010
@@ -244,11 +244,13 @@ public abstract class AbstractBuildExecu
     }
 
     protected ContinuumBuildExecutionResult executeShellCommand( Project project, String
executable, String arguments,
-                                                                 File output, Map<String,
String> environments )
+                                                                 File output, Map<String,
String> environments,
+                                                                 List<Project> projectsWithCommonScmRoot,
+                                                                 String projectScmRootUrl
)
         throws ContinuumBuildExecutorException
     {
 
-    	File workingDirectory = getWorkingDirectory( project, null, null );
+    	File workingDirectory = getWorkingDirectory( project, projectScmRootUrl, projectsWithCommonScmRoot
);
 
         String actualExecutable = findExecutable( executable, defaultExecutable, resolveExecutable,
workingDirectory );
 
@@ -453,12 +455,12 @@ public abstract class AbstractBuildExecu
         throws ContinuumBuildExecutorException
     {
         // Not supported by this builder
-        return Collections.EMPTY_LIST;
+        return Collections.emptyList();
     }
 
     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-updated/continuum-core/src/main/java/org/apache/maven/continuum/execution/ant/AntBuildExecutor.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/execution/ant/AntBuildExecutor.java?rev=945005&r1=945004&r2=945005&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/execution/ant/AntBuildExecutor.java
(original)
+++ continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/execution/ant/AntBuildExecutor.java
Mon May 17 07:42:17 2010
@@ -36,6 +36,7 @@ import java.io.File;
 import java.util.Collections;
 import java.util.Enumeration;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.Properties;
 
@@ -70,7 +71,7 @@ public class AntBuildExecutor
     // ContinuumBuilder Implementation
     // ----------------------------------------------------------------------
 
-    public ContinuumBuildExecutionResult build( Project project, BuildDefinition buildDefinition,
File buildOutput )
+    public ContinuumBuildExecutionResult build( Project project, BuildDefinition buildDefinition,
File buildOutput, List<Project> projectsWithCommonScmRoot, String projectScmRootUrl
)
         throws ContinuumBuildExecutorException
     {
         String executable = getInstallationService().getExecutorConfigurator( InstallationService.ANT_TYPE
)
@@ -105,7 +106,7 @@ public class AntBuildExecutor
             setResolveExecutable( false );
         }
 
-        return executeShellCommand( project, executable, arguments.toString(), buildOutput,
environments );
+        return executeShellCommand( project, executable, arguments.toString(), buildOutput,
environments, null, null );
     }
 
     protected Map<String, String> getEnvironments( BuildDefinition buildDefinition
)

Modified: continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneBuildExecutor.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneBuildExecutor.java?rev=945005&r1=945004&r2=945005&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneBuildExecutor.java
(original)
+++ continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneBuildExecutor.java
Mon May 17 07:42:17 2010
@@ -23,6 +23,7 @@ import java.io.File;
 import java.util.Collections;
 import java.util.Enumeration;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.Properties;
 
@@ -81,7 +82,7 @@ public class MavenOneBuildExecutor
     // Builder Implementation
     // ----------------------------------------------------------------------
 
-    public ContinuumBuildExecutionResult build( Project project, BuildDefinition buildDefinition,
File buildOutput )
+    public ContinuumBuildExecutionResult build( Project project, BuildDefinition buildDefinition,
File buildOutput, List<Project> projectsWithCommonScmRoot, String projectScmRootUrl
)
         throws ContinuumBuildExecutorException
     {
         String executable =
@@ -124,7 +125,7 @@ public class MavenOneBuildExecutor
             setResolveExecutable( false );
         }
 
-        return executeShellCommand( project, executable, arguments.toString(), buildOutput,
environments );
+        return executeShellCommand( project, executable, arguments.toString(), buildOutput,
environments, null, null );
     }
 
     protected Map<String, String> getEnvironments( BuildDefinition buildDefinition
)

Modified: continuum/branches/continuum-flat-multi-module-updated/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-updated/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java?rev=945005&r1=945004&r2=945005&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java
(original)
+++ continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java
Mon May 17 07:42:17 2010
@@ -135,7 +135,8 @@ public class MavenTwoBuildExecutor
     // ContinuumBuilder Implementation
     // ----------------------------------------------------------------------
 
-    public ContinuumBuildExecutionResult build( Project project, BuildDefinition buildDefinition,
File buildOutput )
+    public ContinuumBuildExecutionResult build( Project project, BuildDefinition buildDefinition,
File buildOutput,
+                                                List<Project> projectsWithCommonScmRoot,
String projectScmRootUrl )
         throws ContinuumBuildExecutorException
     {
         String executable = getInstallationService().getExecutorConfigurator( InstallationService.MAVEN2_TYPE
)
@@ -177,7 +178,7 @@ public class MavenTwoBuildExecutor
             setResolveExecutable( false );
         }
 
-        return executeShellCommand( project, executable, arguments.toString(), buildOutput,
environments );
+        return executeShellCommand( project, executable, arguments.toString(), buildOutput,
environments, null, null );
     }
 
     public void updateProjectFromCheckOut( File workingDirectory, Project project, BuildDefinition
buildDefinition,

Modified: continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/execution/shell/ShellBuildExecutor.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/execution/shell/ShellBuildExecutor.java?rev=945005&r1=945004&r2=945005&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/execution/shell/ShellBuildExecutor.java
(original)
+++ continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/execution/shell/ShellBuildExecutor.java
Mon May 17 07:42:17 2010
@@ -35,6 +35,7 @@ import org.codehaus.plexus.util.StringUt
 import java.io.File;
 import java.util.Collections;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -67,14 +68,14 @@ public class ShellBuildExecutor
     // ----------------------------------------------------------------------
 
     public synchronized ContinuumBuildExecutionResult build( Project project, BuildDefinition
buildDefinition,
-                                                             File buildOutput )
+                                                             File buildOutput, List<Project>
projectsWithCommonScmRoot, String projectScmRootUrl )
         throws ContinuumBuildExecutorException
     {
         // TODO: this should be validated earlier?
         String executable = getBuildFileForProject( project, buildDefinition );
 
         return executeShellCommand( project, executable, buildDefinition.getArguments(),
buildOutput,
-                                    getEnvironments( buildDefinition ) );
+                                    getEnvironments( buildDefinition ), null, null );
     }
 
     protected Map<String, String> getEnvironments( BuildDefinition buildDefinition
)

Modified: continuum/branches/continuum-flat-multi-module-updated/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-updated/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/PrepareBuildProjectsTaskExecutor.java?rev=945005&r1=945004&r2=945005&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/PrepareBuildProjectsTaskExecutor.java
(original)
+++ continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/PrepareBuildProjectsTaskExecutor.java
Mon May 17 07:42:17 2010
@@ -133,7 +133,7 @@ public class PrepareBuildProjectsTaskExe
                 projectGroupId = projectGroup.getId();
 
                 List<Project> projects = projectDao.getProjectsWithDependenciesByGroupId(
projectGroupId );
-                                projectList = ProjectSorter.getSortedProjects( projects,
log );
+                projectList = ProjectSorter.getSortedProjects( projects, log );
             }
 
             Project rootProject = null;
@@ -295,7 +295,7 @@ public class PrepareBuildProjectsTaskExe
 
     private void updateWorkingDirectory( Map<String, Object> context, Project rootProject
)
         throws TaskExecutionException
-    {
+    {   
         performAction( "check-working-directory", context );
 
         boolean workingDirectoryExists = CheckWorkingDirectoryAction.isWorkingDirectoryExists(
context );
@@ -349,7 +349,7 @@ public class PrepareBuildProjectsTaskExe
 
             if ( rootProject.getId() != project.getId() || ( rootProject.getId() == project.getId()
&& !isRootDirectory( workingDir, rootProject ) ) )
             {
-                AbstractContinuumAction.setRootDirectory(context, false );
+                AbstractContinuumAction.setRootDirectory( context, false );
             }
 
             performAction( "checkout-project", context );

Modified: continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/test/java/org/apache/maven/continuum/execution/ContinuumBuildExecutorTest.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/test/java/org/apache/maven/continuum/execution/ContinuumBuildExecutorTest.java?rev=945005&r1=945004&r2=945005&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/test/java/org/apache/maven/continuum/execution/ContinuumBuildExecutorTest.java
(original)
+++ continuum/branches/continuum-flat-multi-module-updated/continuum-core/src/test/java/org/apache/maven/continuum/execution/ContinuumBuildExecutorTest.java
Mon May 17 07:42:17 2010
@@ -21,6 +21,7 @@ package org.apache.maven.continuum.execu
 
 import java.io.File;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 import org.apache.continuum.utils.shell.ExecutionResult;
@@ -110,7 +111,7 @@ public class ContinuumBuildExecutorTest
                 will( returnValue( result ) );
             }} );
 
-        executor.executeShellCommand( project, executable, arguments, output, environments
);
+        executor.executeShellCommand( project, executable, arguments, output, environments,
null, null );
 
         context.assertIsSatisfied();
     }
@@ -137,7 +138,7 @@ public class ContinuumBuildExecutorTest
             return null;
         }
 
-        public ContinuumBuildExecutionResult build( Project project, BuildDefinition buildDefinition,
File buildOutput )
+        public ContinuumBuildExecutionResult build( Project project, BuildDefinition buildDefinition,
File buildOutput, List<Project> projectsWithCommonScmRoot, String projectScmRootUrl
)
             throws ContinuumBuildExecutorException
         {
             // TODO Auto-generated method stub



Mime
View raw message