continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r579348 - in /maven/continuum/trunk: continuum-api/src/main/java/org/apache/maven/continuum/execution/ continuum-core/src/main/java/org/apache/maven/continuum/core/action/ continuum-core/src/main/java/org/apache/maven/continuum/execution/ c...
Date Tue, 25 Sep 2007 18:48:19 GMT
Author: evenisse
Date: Tue Sep 25 11:48:15 2007
New Revision: 579348

URL: http://svn.apache.org/viewvc?rev=579348&view=rev
Log:
[CONTINUUM-1483] Better support for SCM like clearcase or SYNERGY
Submitted by: David Causse

Modified:
    maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutor.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckoutProjectContinuumAction.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/DeployArtifactContinuumAction.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/AbstractBuildExecutor.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/ant/AntBuildExecutor.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneBuildExecutor.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/shell/ShellBuildExecutor.java
    maven/continuum/trunk/continuum-data-management/continuum-legacy/src/main/mdo/continuum.xml
    maven/continuum/trunk/continuum-model/src/main/mdo/continuum.xml

Modified: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutor.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutor.java?rev=579348&r1=579347&r2=579348&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutor.java
(original)
+++ maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutor.java
Tue Sep 25 11:48:15 2007
@@ -19,13 +19,13 @@
  * under the License.
  */
 
-import java.io.File;
-import java.util.List;
-
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.model.scm.TestResult;
 
+import java.io.File;
+import java.util.List;
+
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
  * @version $Id$
@@ -44,7 +44,7 @@
 
     void killProcess( Project project );
 
-    List getDeployableArtifacts( File workingDirectory, BuildDefinition buildDefinition )
+    List getDeployableArtifacts( Project project, File workingDirectory, BuildDefinition
buildDefinition )
         throws ContinuumBuildExecutorException;
 
     TestResult getTestResults( Project project, int buildResultId )

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckoutProjectContinuumAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckoutProjectContinuumAction.java?rev=579348&r1=579347&r2=579348&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckoutProjectContinuumAction.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckoutProjectContinuumAction.java
Tue Sep 25 11:48:15 2007
@@ -20,7 +20,6 @@
  */
 
 import org.apache.maven.continuum.Continuum;
-import org.apache.maven.continuum.execution.ContinuumBuildExecutorConstants;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.model.scm.ScmResult;
@@ -129,39 +128,14 @@
         }
         finally
         {
-            if ( oldState == ContinuumProjectState.NEW )
+            String relativePath = (String) getObject( context, KEY_PROJECT_RELATIVE_PATH,
"" );
+            if ( StringUtils.isNotEmpty( relativePath ) )
             {
-                String relativePath = (String) getObject( context, KEY_PROJECT_RELATIVE_PATH,
"" );
-                if ( StringUtils.isNotEmpty( relativePath ) )
-                {
-                    //CONTINUUM-1218 : updating only the default build definition only for
new projects
-                    BuildDefinition bd = continuum.getDefaultBuildDefinition( project.getId()
);
-
-                    String buildFile = "";
-                    if ( ContinuumBuildExecutorConstants.MAVEN_TWO_BUILD_EXECUTOR.equals(
project.getExecutorId() ) )
-                    {
-                        buildFile = "pom.xml";
-                        bd.setType( ContinuumBuildExecutorConstants.MAVEN_TWO_BUILD_EXECUTOR
);
-                    }
-                    else
-                    if ( ContinuumBuildExecutorConstants.MAVEN_ONE_BUILD_EXECUTOR.equals(
project.getExecutorId() ) )
-                    {
-                        buildFile = "project.xml";
-                        bd.setType( ContinuumBuildExecutorConstants.MAVEN_ONE_BUILD_EXECUTOR
);
-                    }
-                    else if ( ContinuumBuildExecutorConstants.ANT_BUILD_EXECUTOR.equals(
project.getExecutorId() ) )
-                    {
-                        buildFile = "build.xml";
-                        bd.setType( ContinuumBuildExecutorConstants.ANT_BUILD_EXECUTOR );
-                    }
-                    else
-                    {
-                        bd.setType( ContinuumBuildExecutorConstants.SHELL_BUILD_EXECUTOR
);
-                    }
-                    bd.setBuildFile( relativePath + "/" + buildFile );
-                    store.storeBuildDefinition( bd );
-                }
+
+                project.setRelativePath( relativePath );
+
             }
+
             project.setState( ContinuumProjectState.CHECKEDOUT );
 
             store.updateProject( project );

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/DeployArtifactContinuumAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/DeployArtifactContinuumAction.java?rev=579348&r1=579347&r2=579348&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/DeployArtifactContinuumAction.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/DeployArtifactContinuumAction.java
Tue Sep 25 11:48:15 2007
@@ -101,8 +101,9 @@
             {
                 BuildDefinition buildDefinition = getBuildDefinition( context );
 
-                List artifacts = buildExecutor.getDeployableArtifacts(
-                    workingDirectoryService.getWorkingDirectory( project ), buildDefinition
);
+                List artifacts = buildExecutor.getDeployableArtifacts( project,
+                                                                       workingDirectoryService.getWorkingDirectory(
+                                                                           project ), buildDefinition
);
 
                 for ( Iterator i = artifacts.iterator(); i.hasNext(); )
                 {

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/AbstractBuildExecutor.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/AbstractBuildExecutor.java?rev=579348&r1=579347&r2=579348&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/AbstractBuildExecutor.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/AbstractBuildExecutor.java
Tue Sep 25 11:48:15 2007
@@ -277,6 +277,19 @@
         return properties;
     }
 
+    protected String getBuildFileForProject( Project project, BuildDefinition buildDefinition
)
+    {
+        String buildFile = StringUtils.clean( buildDefinition.getBuildFile() );
+        String relPath = StringUtils.clean( project.getRelativePath() );
+
+        if ( StringUtils.isEmpty( relPath ) )
+        {
+            return buildFile;
+        }
+
+        return relPath + File.separator + buildFile;
+    }
+
     public boolean isBuilding( Project project )
     {
         return project.getState() == ContinuumProjectState.BUILDING || shellCommandHelper.isRunning(
project.getId() );
@@ -287,7 +300,7 @@
         shellCommandHelper.killProcess( project.getId() );
     }
 
-    public List getDeployableArtifacts( File workingDirectory, BuildDefinition buildDefinition
)
+    public List getDeployableArtifacts( Project project, File workingDirectory, BuildDefinition
buildDefinition )
         throws ContinuumBuildExecutorException
     {
         // Not supported by this builder

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/ant/AntBuildExecutor.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/ant/AntBuildExecutor.java?rev=579348&r1=579347&r2=579348&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/ant/AntBuildExecutor.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/ant/AntBuildExecutor.java
Tue Sep 25 11:48:15 2007
@@ -77,7 +77,7 @@
 
         StringBuffer arguments = new StringBuffer();
 
-        String buildFile = buildDefinition.getBuildFile();
+        String buildFile = getBuildFileForProject( project, buildDefinition );
 
         if ( !StringUtils.isEmpty( buildFile ) )
         {

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneBuildExecutor.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneBuildExecutor.java?rev=579348&r1=579347&r2=579348&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneBuildExecutor.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneBuildExecutor.java
Tue Sep 25 11:48:15 2007
@@ -76,7 +76,7 @@
 
         StringBuffer arguments = new StringBuffer();
 
-        String buildFile = StringUtils.clean( buildDefinition.getBuildFile() );
+        String buildFile = getBuildFileForProject( project, buildDefinition );
 
         if ( !StringUtils.isEmpty( buildFile ) && !"project.xml".equals( buildFile
) )
         {

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java?rev=579348&r1=579347&r2=579348&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java
Tue Sep 25 11:48:15 2007
@@ -119,7 +119,7 @@
 
         StringBuffer arguments = new StringBuffer();
 
-        String buildFile = StringUtils.clean( buildDefinition.getBuildFile() );
+        String buildFile = getBuildFileForProject( project, buildDefinition );
 
         if ( !StringUtils.isEmpty( buildFile ) && !"pom.xml".equals( buildFile )
)
         {
@@ -152,7 +152,7 @@
     public void updateProjectFromCheckOut( File workingDirectory, Project project, BuildDefinition
buildDefinition )
         throws ContinuumBuildExecutorException
     {
-        File f = getPomFile( buildDefinition, workingDirectory );
+        File f = getPomFile( getBuildFileForProject( project, buildDefinition ), workingDirectory
);
 
         if ( !f.exists() )
         {
@@ -169,18 +169,15 @@
         }
     }
 
-    private static File getPomFile( BuildDefinition buildDefinition, File workingDirectory
)
+    private static File getPomFile( String projectBuildFile, File workingDirectory )
     {
         File f = null;
 
-        if ( buildDefinition != null )
-        {
-            String buildFile = StringUtils.clean( buildDefinition.getBuildFile() );
+        String buildFile = StringUtils.clean( projectBuildFile );
 
-            if ( !StringUtils.isEmpty( buildFile ) )
-            {
-                f = new File( workingDirectory, buildFile );
-            }
+        if ( !StringUtils.isEmpty( buildFile ) )
+        {
+            f = new File( workingDirectory, buildFile );
         }
 
         if ( f == null )
@@ -191,10 +188,11 @@
         return f;
     }
 
-    public List getDeployableArtifacts( File workingDirectory, BuildDefinition buildDefinition
)
+    public List getDeployableArtifacts( Project continuumProject, File workingDirectory,
+                                        BuildDefinition buildDefinition )
         throws ContinuumBuildExecutorException
     {
-        File f = getPomFile( buildDefinition, workingDirectory );
+        File f = getPomFile( getBuildFileForProject( continuumProject, buildDefinition ),
workingDirectory );
 
         if ( !f.exists() )
         {

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/shell/ShellBuildExecutor.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/shell/ShellBuildExecutor.java?rev=579348&r1=579347&r2=579348&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/shell/ShellBuildExecutor.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/shell/ShellBuildExecutor.java
Tue Sep 25 11:48:15 2007
@@ -70,7 +70,7 @@
         throws ContinuumBuildExecutorException
     {
         // TODO: this should be validated earlier?
-        String executable = buildDefinition.getBuildFile();
+        String executable = getBuildFileForProject( project, buildDefinition );
 
         return executeShellCommand( project, executable, buildDefinition.getArguments(),
buildOutput,
                                     getEnvironments( buildDefinition ) );

Modified: maven/continuum/trunk/continuum-data-management/continuum-legacy/src/main/mdo/continuum.xml
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-data-management/continuum-legacy/src/main/mdo/continuum.xml?rev=579348&r1=579347&r2=579348&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-data-management/continuum-legacy/src/main/mdo/continuum.xml
(original)
+++ maven/continuum/trunk/continuum-data-management/continuum-legacy/src/main/mdo/continuum.xml
Tue Sep 25 11:48:15 2007
@@ -237,6 +237,11 @@
           <version>1.0.9+</version>
           <type>String</type>
         </field>
+        <field>
+          <name>relativePath</name>
+          <version>1.1.0+</version>
+          <type>String</type>
+        </field>
         <field jpox.mapped-by="project" jpox.fetch-groups="project-with-builds">
           <name>buildResults</name>
           <version>1.0.9+</version>

Modified: maven/continuum/trunk/continuum-model/src/main/mdo/continuum.xml
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-model/src/main/mdo/continuum.xml?rev=579348&r1=579347&r2=579348&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-model/src/main/mdo/continuum.xml (original)
+++ maven/continuum/trunk/continuum-model/src/main/mdo/continuum.xml Tue Sep 25 11:48:15 2007
@@ -237,6 +237,11 @@
           <version>1.0.9+</version>
           <type>String</type>
         </field>
+        <field>
+          <name>relativePath</name>
+          <version>1.1.0+</version>
+          <type>String</type>
+        </field>
         <field jpox.mapped-by="project" jpox.fetch-groups="project-with-builds">
           <name>buildResults</name>
           <version>1.0.9+</version>
@@ -299,7 +304,7 @@
             <type>BuildDefinition</type>
             <multiplicity>*</multiplicity>
           </association>
-        </field>
+        </field>        
       </fields>
     </class>
 



Mime
View raw message