continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From batkin...@apache.org
Subject svn commit: r1661276 - in /continuum/trunk: continuum-api/src/main/java/org/apache/continuum/utils/release/ continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ continuum-webapp/src/main/java/org/apache/maven/co...
Date Sat, 21 Feb 2015 05:04:16 GMT
Author: batkinson
Date: Sat Feb 21 05:04:16 2015
New Revision: 1661276

URL: http://svn.apache.org/r1661276
Log:
Documented and renamed release utility methods to clarify purpose.

Modified:
    continuum/trunk/continuum-api/src/main/java/org/apache/continuum/utils/release/ReleaseUtil.java
    continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePerformAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePrepareAction.java
    continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java

Modified: continuum/trunk/continuum-api/src/main/java/org/apache/continuum/utils/release/ReleaseUtil.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-api/src/main/java/org/apache/continuum/utils/release/ReleaseUtil.java?rev=1661276&r1=1661275&r2=1661276&view=diff
==============================================================================
--- continuum/trunk/continuum-api/src/main/java/org/apache/continuum/utils/release/ReleaseUtil.java
(original)
+++ continuum/trunk/continuum-api/src/main/java/org/apache/continuum/utils/release/ReleaseUtil.java
Sat Feb 21 05:04:16 2015
@@ -36,8 +36,15 @@ import java.util.Map;
 
 public class ReleaseUtil
 {
-    @SuppressWarnings( "unchecked" )
-    public static Map<String, Object> getReleasePluginParameters( String workingDirectory,
String pomFilename )
+    /**
+     * Extracts parameters specified for the maven-release-plugin from the given project's
metadata.
+     *
+     * @param workingDirectory working directory of project containing pom file
+     * @param pomFilename      the name of the pom file in working directory
+     * @return a map consisting of the release plugin parameters from project metadata
+     * @throws Exception
+     */
+    public static Map<String, Object> extractPluginParameters( String workingDirectory,
String pomFilename )
         throws Exception
     {
         Map<String, Object> params = new HashMap<String, Object>();
@@ -47,7 +54,7 @@ public class ReleaseUtil
 
         if ( model.getBuild() != null && model.getBuild().getPlugins() != null )
         {
-            for ( Plugin plugin : (List<Plugin>) model.getBuild().getPlugins() )
+            for ( Plugin plugin : model.getBuild().getPlugins() )
             {
                 if ( plugin.getGroupId() != null && plugin.getGroupId().equals( "org.apache.maven.plugins"
) &&
                     plugin.getArtifactId() != null && plugin.getArtifactId().equals(
"maven-release-plugin" ) )
@@ -130,8 +137,24 @@ public class ReleaseUtil
         return params;
     }
 
-    public static void processProject( String workingDirectory, String pomFilename, boolean
autoVersionSubmodules,
-                                       List<Map<String, String>> projects )
+    /**
+     * Constructs a list of release preparation parameters for the given project and its
modules. The parameter map for
+     * each project consists of:
+     * <ul>
+     * <li>key - groupId:artifactId</li>
+     * <li>name - name or artifactId if none</li>
+     * <li>dev - the version the project will assume after preparation</li>
+     * <li>release - the version the project will ultimately released as when performing</li>
+     * </ul>
+     *
+     * @param workingDirectory      working directory of project
+     * @param pomFilename           the filename of the pom inside the working directory
+     * @param autoVersionSubmodules true sets all modules to the root project's version,
false uses module versions
+     * @param projects              the resulting list of parameter maps for the project
and its modules
+     * @throws Exception
+     */
+    public static void buildVersionParams( String workingDirectory, String pomFilename, boolean
autoVersionSubmodules,
+                                           List<Map<String, String>> projects
)
         throws Exception
     {
         Model model = getMavenModel( workingDirectory, pomFilename );
@@ -152,7 +175,7 @@ public class ReleaseUtil
         {
             String module = StringUtils.replace( modules.next().toString(), '\\', '/' );
 
-            processProject( workingDirectory + "/" + module, "pom.xml", autoVersionSubmodules,
projects );
+            buildVersionParams( workingDirectory + "/" + module, "pom.xml", autoVersionSubmodules,
projects );
         }
     }
 

Modified: continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java?rev=1661276&r1=1661275&r2=1661276&view=diff
==============================================================================
--- continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java
(original)
+++ continuum/trunk/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java
Sat Feb 21 05:04:16 2015
@@ -364,7 +364,7 @@ public class ContinuumBuildAgentServiceI
         try
         {
             log.debug( "Getting release plugin parameters of project {}", projectId );
-            return ReleaseUtil.getReleasePluginParameters( workingDirectory, pomFilename
);
+            return ReleaseUtil.extractPluginParameters( workingDirectory, pomFilename );
         }
         catch ( Exception e )
         {
@@ -381,7 +381,7 @@ public class ContinuumBuildAgentServiceI
 
         try
         {
-            ReleaseUtil.processProject( workingDirectory, pomFilename, autoVersionSubmodules,
projects );
+            ReleaseUtil.buildVersionParams( workingDirectory, pomFilename, autoVersionSubmodules,
projects );
         }
         catch ( Exception e )
         {

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePerformAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePerformAction.java?rev=1661276&r1=1661275&r2=1661276&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePerformAction.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePerformAction.java
Sat Feb 21 05:04:16 2015
@@ -42,7 +42,6 @@ import org.codehaus.plexus.util.StringUt
 
 import java.io.File;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -171,7 +170,7 @@ public class ReleasePerformAction
     private void getReleasePluginParameters( String workingDirectory, String pomFilename
)
         throws Exception
     {
-        Map<String, Object> params = ReleaseUtil.getReleasePluginParameters( workingDirectory,
pomFilename );
+        Map<String, Object> params = ReleaseUtil.extractPluginParameters( workingDirectory,
pomFilename );
 
         if ( params.get( "use-release-profile" ) != null )
         {

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePrepareAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePrepareAction.java?rev=1661276&r1=1661275&r2=1661276&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePrepareAction.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePrepareAction.java
Sat Feb 21 05:04:16 2015
@@ -184,7 +184,7 @@ public class ReleasePrepareAction
 
                 getReleasePluginParameters( workingDirectory, "pom.xml" );
 
-                ReleaseUtil.processProject( workingDirectory, "pom.xml", autoVersionSubmodules,
projects );
+                ReleaseUtil.buildVersionParams( workingDirectory, "pom.xml", autoVersionSubmodules,
projects );
             }
             catch ( Exception e )
             {
@@ -204,7 +204,7 @@ public class ReleasePrepareAction
     private void getReleasePluginParameters( String workingDirectory, String pomFilename
)
         throws Exception
     {
-        Map<String, Object> params = ReleaseUtil.getReleasePluginParameters( workingDirectory,
pomFilename );
+        Map<String, Object> params = ReleaseUtil.extractPluginParameters( workingDirectory,
pomFilename );
 
         // TODO: use constants for this
         if ( params.get( "scm-tag" ) != null )

Modified: continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java?rev=1661276&r1=1661275&r2=1661276&view=diff
==============================================================================
--- continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java
(original)
+++ continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java
Sat Feb 21 05:04:16 2015
@@ -4001,8 +4001,8 @@ public class ContinuumServiceImpl
             }
             else
             {
-                params = ReleaseUtil.getReleasePluginParameters( continuum.getWorkingDirectory(
projectId ).getPath(),
-                                                                 "pom.xml" );
+                params = ReleaseUtil.extractPluginParameters( continuum.getWorkingDirectory(
projectId ).getPath(),
+                                                              "pom.xml" );
             }
 
             // set scm tag and scm tag base if no values yet
@@ -4076,8 +4076,8 @@ public class ContinuumServiceImpl
             }
             else
             {
-                ReleaseUtil.processProject( continuum.getWorkingDirectory( projectId ).getPath(),
pomFilename,
-                                            autoVersionSubmodules, projects );
+                ReleaseUtil.buildVersionParams( continuum.getWorkingDirectory( projectId
).getPath(), pomFilename,
+                                                autoVersionSubmodules, projects );
             }
 
             return projects;



Mime
View raw message