continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From och...@apache.org
Subject svn commit: r776308 - in /continuum/branches/continuum-flat-multi-module: continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/ continuum-release/src/main/java/org/apache/continuum/release/phase/ continuum-release/src/main/java/org/apache/...
Date Tue, 19 May 2009 13:23:18 GMT
Author: oching
Date: Tue May 19 13:23:18 2009
New Revision: 776308

URL: http://svn.apache.org/viewvc?rev=776308&view=rev
Log:
o set root project path in release descriptor
o more code cleanup

Modified:
    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-release/src/main/java/org/apache/continuum/release/phase/AbstractContinuumRunGoalsPhase.java
    continuum/branches/continuum-flat-multi-module/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PerformReleaseTaskExecutor.java

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=776308&r1=776307&r2=776308&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
Tue May 19 13:23:18 2009
@@ -197,7 +197,7 @@
             for ( ProjectScmRoot projectScmRoot : scmRoots )
             {
                 projectScmRootAddress = projectScmRoot.getScmRootAddress();
-                if ( projectScmUrl.contains( projectScmRoot.getScmRootAddress() ) )
+                if ( projectScmUrl.startsWith( projectScmRoot.getScmRootAddress() ) )
                 {                    
                     context.put( AbstractContinuumAction.KEY_PROJECT_SCM_ROOT, projectScmRoot
);
                     context.put( AbstractContinuumAction.KEY_PROJECT_SCM_ROOT_URL, projectScmRootAddress
);
@@ -220,7 +220,7 @@
                 List<Project> projectsWithCommonScmRoot = new ArrayList<Project>();
           
                 for( Project projectInGroup : projectsInGroup )
                 {
-                    if( projectInGroup.getScmUrl().contains( projectScmRootAddress ) )
+                    if( projectInGroup.getScmUrl().startsWith( projectScmRootAddress ) )
                     {
                         projectsWithCommonScmRoot.add( projectInGroup );
                     }

Modified: continuum/branches/continuum-flat-multi-module/continuum-release/src/main/java/org/apache/continuum/release/phase/AbstractContinuumRunGoalsPhase.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-release/src/main/java/org/apache/continuum/release/phase/AbstractContinuumRunGoalsPhase.java?rev=776308&r1=776307&r2=776308&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-release/src/main/java/org/apache/continuum/release/phase/AbstractContinuumRunGoalsPhase.java
(original)
+++ continuum/branches/continuum-flat-multi-module/continuum-release/src/main/java/org/apache/continuum/release/phase/AbstractContinuumRunGoalsPhase.java
Tue May 19 13:23:18 2009
@@ -75,7 +75,7 @@
                     executable = ( (ContinuumReleaseDescriptor) releaseDescriptor).getExecutable();
                 }
                 shellCommandHelper.executeGoals( determineWorkingDirectory( workingDirectory,
-                                                                            releaseDescriptor.getScmRelativePathProjectDirectory()
),
+                                                                            releaseDescriptor.getScmRelativePathProjectDirectory(),
releaseDescriptor.getRootProjectPath() ),
                                                  executable, goals, releaseDescriptor.isInteractive(),
additionalArguments, result, 
                                                  environments );
             }

Modified: continuum/branches/continuum-flat-multi-module/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PerformReleaseTaskExecutor.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-flat-multi-module/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PerformReleaseTaskExecutor.java?rev=776308&r1=776307&r2=776308&view=diff
==============================================================================
--- continuum/branches/continuum-flat-multi-module/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PerformReleaseTaskExecutor.java
(original)
+++ continuum/branches/continuum-flat-multi-module/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PerformReleaseTaskExecutor.java
Tue May 19 13:23:18 2009
@@ -41,6 +41,7 @@
 import org.apache.maven.shared.release.ReleaseManagerListener;
 import org.apache.maven.shared.release.ReleaseResult;
 import org.apache.maven.shared.release.config.ReleaseDescriptor;
+import org.apache.maven.shared.release.util.ReleaseUtil;
 import org.codehaus.plexus.PlexusConstants;
 import org.codehaus.plexus.PlexusContainer;
 import org.codehaus.plexus.context.Context;
@@ -83,76 +84,55 @@
 
         repository = performTask.getLocalRepository();
 
-        List<MavenProject> reactorProjects = getReactorProjects( performTask );
-
-        ReleaseResult result = releaseManager.performWithResult( descriptor, settings, reactorProjects,
listener );
-
-        //override to show the actual start time
-        result.setStartTime( getStartTime() );
-
-        if ( result.getResultCode() == ReleaseResult.SUCCESS )
-        {
-            continuumReleaseManager.getPreparedReleases().remove( performTask.getReleaseId()
);
-        }
-
-        continuumReleaseManager.getReleaseResults().put( performTask.getReleaseId(), result
);
-    }
-
-    protected List<MavenProject> getReactorProjects( PerformReleaseProjectTask releaseTask
)
-        throws TaskExecutionException
-    {
-        List<MavenProject> reactorProjects;
-        ReleaseDescriptor descriptor = releaseTask.getDescriptor();
-
-        if ( StringUtils.isEmpty( descriptor.getWorkingDirectory() ) )
-        {
-            //Perform with provided release parameters (CONTINUUM-1541)
-            descriptor.setCheckoutDirectory( releaseTask.getBuildDirectory().getAbsolutePath()
);
-            return null;
-        }
-
+        List reactorProjects = null;
+        MavenProject mavenProject = null;
+        
         try
         {
-            reactorProjects = getReactorProjects( descriptor );
+            mavenProject = getMavenProject( performTask );
+            if( mavenProject != null )
+            {
+                descriptor.setRootProjectPath( ReleaseUtil.getRootProjectPath( mavenProject
) );
+                reactorProjects = getReactorProjects( descriptor, mavenProject ); 
+            }
         }
-        catch ( ContinuumReleaseException e )
+        catch ( ContinuumReleaseException  e )
         {
             ReleaseResult result = createReleaseResult();
 
             result.appendError( e );
 
-            continuumReleaseManager.getReleaseResults().put( releaseTask.getReleaseId(),
result );
+            continuumReleaseManager.getReleaseResults().put( performTask.getReleaseId(),
result );
 
-            releaseTask.getListener().error( e.getMessage() );
+            performTask.getListener().error( e.getMessage() );
 
             throw new TaskExecutionException( "Failed to build reactor projects.", e );
         }
 
-        return reactorProjects;
+        ReleaseResult result = releaseManager.performWithResult( descriptor, settings, reactorProjects,
listener );
+
+        //override to show the actual start time
+        result.setStartTime( getStartTime() );
+
+        if ( result.getResultCode() == ReleaseResult.SUCCESS )
+        {
+            continuumReleaseManager.getPreparedReleases().remove( performTask.getReleaseId()
);
+        }
+
+        continuumReleaseManager.getReleaseResults().put( performTask.getReleaseId(), result
);
     }
 
     /**
      * @todo remove and use generate-reactor-projects phase
      */
-    protected List<MavenProject> getReactorProjects( ReleaseDescriptor descriptor )
+    protected List<MavenProject> getReactorProjects( ReleaseDescriptor descriptor,
MavenProject project )
         throws ContinuumReleaseException
     {
         List<MavenProject> reactorProjects = new ArrayList<MavenProject>();
+         
+        reactorProjects.add( project );
 
-        MavenProject project;
-        try
-        {
-            project = projectBuilder.build( getProjectDescriptorFile( descriptor ), getLocalRepository(),
-                                            getProfileManager( settings ) );
-
-            reactorProjects.add( project );
-
-            addModules( reactorProjects, project );
-        }
-        catch ( ProjectBuildingException e )
-        {
-            throw new ContinuumReleaseException( "Failed to build project.", e );
-        }
+        addModules( reactorProjects, project );
 
         try
         {
@@ -238,4 +218,30 @@
     {
         container = (PlexusContainer) context.get( PlexusConstants.PLEXUS_KEY );
     }
+    
+    protected MavenProject getMavenProject( PerformReleaseProjectTask releaseTask )
+        throws ContinuumReleaseException
+    {
+        ReleaseDescriptor descriptor = releaseTask.getDescriptor();
+    
+        if ( StringUtils.isEmpty( descriptor.getWorkingDirectory() ) )
+        {
+            //Perform with provided release parameters (CONTINUUM-1541)
+            descriptor.setCheckoutDirectory( releaseTask.getBuildDirectory().getAbsolutePath()
);
+            return null;
+        }
+    
+        MavenProject project;
+        try
+        {
+            project = projectBuilder.build( getProjectDescriptorFile( descriptor ), getLocalRepository(),
+                                            getProfileManager( settings ) );
+        }
+        catch ( ProjectBuildingException e )
+        {
+            throw new ContinuumReleaseException( "Failed to build project.", e );
+        }
+        
+        return project;
+    }    
 }



Mime
View raw message