continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r741440 - in /continuum/trunk: continuum-api/src/main/java/org/apache/maven/continuum/release/ continuum-release/src/main/java/org/apache/maven/continuum/release/ continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ continu...
Date Fri, 06 Feb 2009 07:00:44 GMT
Author: evenisse
Date: Fri Feb  6 07:00:44 2009
New Revision: 741440

URL: http://svn.apache.org/viewvc?rev=741440&view=rev
Log:
[CONTINUUM-1504] Use autoVersionSubmodules when it is defined in the release plugin config

Modified:
    continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManager.java
    continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultContinuumReleaseManager.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePrepareAction.java
    continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
    continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum_fr.properties
    continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releasePrepare.jsp

Modified: continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManager.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManager.java?rev=741440&r1=741439&r2=741440&view=diff
==============================================================================
--- continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManager.java
(original)
+++ continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManager.java
Fri Feb  6 07:00:44 2009
@@ -49,10 +49,10 @@
      * @return
      * @throws ContinuumReleaseException
      */
-    String prepare( Project project, Properties releaseProperties, Map releaseVersions, Map
developmentVersions,
-                    ContinuumReleaseManagerListener listener )
+    String prepare( Project project, Properties releaseProperties, Map<String, String>
releaseVersions,
+                    Map<String, String> developmentVersions, ContinuumReleaseManagerListener
listener )
         throws ContinuumReleaseException;
-    
+
     /**
      * Prepare a project for release
      *
@@ -65,8 +65,8 @@
      * @return
      * @throws ContinuumReleaseException
      */
-    String prepare( Project project, Properties releaseProperties, Map releaseVersions, Map
developmentVersions,
-                    ContinuumReleaseManagerListener listener, Profile profile )
+    String prepare( Project project, Properties releaseProperties, Map<String, String>
releaseVersions,
+                    Map<String, String> developmentVersions, ContinuumReleaseManagerListener
listener, Profile profile )
         throws ContinuumReleaseException;
 
     /**
@@ -113,7 +113,7 @@
     Map getReleaseResults();
 
     Map getListeners();
-    
+
     void perform( String releaseId, File buildDirectory, String goals, boolean useReleaseProfile,
                   ContinuumReleaseManagerListener listener, LocalRepository repository )
         throws ContinuumReleaseException;

Modified: continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultContinuumReleaseManager.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultContinuumReleaseManager.java?rev=741440&r1=741439&r2=741440&view=diff
==============================================================================
--- continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultContinuumReleaseManager.java
(original)
+++ continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultContinuumReleaseManager.java
Fri Feb  6 07:00:44 2009
@@ -101,15 +101,15 @@
      */
     private static Map releaseResults;
 
-    public String prepare( Project project, Properties releaseProperties, Map relVersions,
Map devVersions,
-                           ContinuumReleaseManagerListener listener )
+    public String prepare( Project project, Properties releaseProperties, Map<String,
String> relVersions,
+                           Map<String, String> devVersions, ContinuumReleaseManagerListener
listener )
         throws ContinuumReleaseException
     {
         return prepare( project, releaseProperties, relVersions, devVersions, listener, null
);
     }
 
-    public String prepare( Project project, Properties releaseProperties, Map relVersions,
Map devVersions,
-                           ContinuumReleaseManagerListener listener, Profile profile )
+    public String prepare( Project project, Properties releaseProperties, Map<String,
String> relVersions,
+                           Map<String, String> devVersions, ContinuumReleaseManagerListener
listener, Profile profile )
         throws ContinuumReleaseException
     {
         String releaseId = project.getGroupId() + ":" + project.getArtifactId();
@@ -255,8 +255,9 @@
         return envVars;
     }
 
-    private ReleaseDescriptor getReleaseDescriptor( Project project, Properties releaseProperties,
Map relVersions,
-                                                    Map devVersions, Profile profile )
+    private ReleaseDescriptor getReleaseDescriptor( Project project, Properties releaseProperties,
+                                                    Map<String, String> relVersions,
Map<String, String> devVersions,
+                                                    Profile profile )
     {
         ContinuumReleaseDescriptor descriptor = new ContinuumReleaseDescriptor();
         String workingDirectory = workingDirectoryService.getWorkingDirectory( project ).getPath();

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=741440&r1=741439&r2=741440&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
Fri Feb  6 07:00:44 2009
@@ -75,13 +75,13 @@
 
     private boolean scmUseEditMode = false;
 
-    private List projects = new ArrayList();
+    private List<Map<String, String>> projects = new ArrayList<Map<String,
String>>();
 
-    private List projectKeys;
+    private List<String> projectKeys;
 
-    private List devVersions;
+    private List<String> devVersions;
 
-    private List relVersions;
+    private List<String> relVersions;
 
     private String prepareGoals;
 
@@ -95,6 +95,8 @@
 
     private int profileId;
 
+    private boolean autoVersionSubmodules = false;
+
     public String input()
         throws Exception
     {
@@ -161,10 +163,8 @@
 
         if ( model.getBuild() != null && model.getBuild().getPlugins() != null )
         {
-            for ( Iterator plugins = model.getBuild().getPlugins().iterator(); plugins.hasNext();
)
+            for ( Plugin plugin : (List<Plugin>) model.getBuild().getPlugins() )
             {
-                Plugin plugin = (Plugin) plugins.next();
-
                 if ( plugin.getGroupId() != null && plugin.getGroupId().equals( "org.apache.maven.plugins"
) &&
                     plugin.getArtifactId() != null && plugin.getArtifactId().equals(
"maven-release-plugin" ) )
                 {
@@ -201,6 +201,12 @@
                         {
                             scmCommentPrefix = configuration.getValue();
                         }
+
+                        configuration = dom.getChild( "autoVersionSubmodules" );
+                        if ( configuration != null )
+                        {
+                            autoVersionSubmodules = Boolean.valueOf( configuration.getValue()
);
+                        }
                     }
                 }
             }
@@ -320,16 +326,19 @@
 
         setProperties( model );
 
-        for ( Iterator modules = model.getModules().iterator(); modules.hasNext(); )
+        if ( !autoVersionSubmodules )
         {
-            processProject( workingDirectory + "/" + modules.next().toString(), "pom.xml"
);
+            for ( Iterator modules = model.getModules().iterator(); modules.hasNext(); )
+            {
+                processProject( workingDirectory + "/" + modules.next().toString(), "pom.xml"
);
+            }
         }
     }
 
     private void setProperties( Model model )
         throws Exception
     {
-        Map params = new HashMap();
+        Map<String, String> params = new HashMap<String, String>();
 
         params.put( "key", model.getGroupId() + ":" + model.getArtifactId() );
 
@@ -347,24 +356,32 @@
         projects.add( params );
     }
 
-    private Map getDevVersionMap()
+    private Map<String, String> getDevVersionMap()
     {
         return getVersionMap( projectKeys, devVersions );
     }
 
-    private Map getRelVersionMap()
+    private Map<String, String> getRelVersionMap()
     {
         return getVersionMap( projectKeys, relVersions );
     }
 
-    private Map getVersionMap( List keys, List versions )
+    private Map<String, String> getVersionMap( List<String> keys, List<String>
versions )
     {
-        Map versionMap = new HashMap();
+        Map<String, String> versionMap = new HashMap<String, String>();
 
         for ( int idx = 0; idx < keys.size(); idx++ )
         {
-            String key = keys.get( idx ).toString();
-            String version = versions.get( idx ).toString();
+            String key = keys.get( idx );
+            String version;
+            if ( !autoVersionSubmodules )
+            {
+                version = versions.get( idx );
+            }
+            else
+            {
+                version = versions.get( 0 );
+            }
 
             versionMap.put( key, version );
         }
@@ -403,32 +420,32 @@
         return p;
     }
 
-    public List getProjectKeys()
+    public List<String> getProjectKeys()
     {
         return projectKeys;
     }
 
-    public void setProjectKeys( List projectKeys )
+    public void setProjectKeys( List<String> projectKeys )
     {
         this.projectKeys = projectKeys;
     }
 
-    public List getDevVersions()
+    public List<String> getDevVersions()
     {
         return devVersions;
     }
 
-    public void setDevVersions( List devVersions )
+    public void setDevVersions( List<String> devVersions )
     {
         this.devVersions = devVersions;
     }
 
-    public List getRelVersions()
+    public List<String> getRelVersions()
     {
         return relVersions;
     }
 
-    public void setRelVersions( List relVersions )
+    public void setRelVersions( List<String> relVersions )
     {
         this.relVersions = relVersions;
     }
@@ -483,12 +500,12 @@
         this.scmTagBase = scmTagBase;
     }
 
-    public List getProjects()
+    public List<Map<String, String>> getProjects()
     {
         return projects;
     }
 
-    public void setProjects( List projects )
+    public void setProjects( List<Map<String, String>> projects )
     {
         this.projects = projects;
     }
@@ -593,5 +610,13 @@
         this.scmCommentPrefix = scmCommentPrefix;
     }
 
+    public boolean isAutoVersionSubmodules()
+    {
+        return autoVersionSubmodules;
+    }
 
+    public void setAutoVersionSubmodules( boolean autoVersionSubmodules )
+    {
+        this.autoVersionSubmodules = autoVersionSubmodules;
+    }
 }

Modified: continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties?rev=741440&r1=741439&r2=741440&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
(original)
+++ continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
Fri Feb  6 07:00:44 2009
@@ -681,6 +681,7 @@
 releasePrepare.prepareGoals.label=Preparation Goals
 releasePrepare.buildEnvironment.label=Build Environment
 releasePrepare.useEditMode.label=Use edit mode
+releasePrepare.autoVersionSubmodules=autoVersionSubmodules (defined in the POM)
 releasePerformFromScm.scmUrl.label=SCM Connection URL
 releasePerformFromScm.scmUsername.label=SCM Username
 releasePerformFromScm.scmPassword.label=SCM Password

Modified: continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum_fr.properties
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum_fr.properties?rev=741440&r1=741439&r2=741440&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum_fr.properties
(original)
+++ continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum_fr.properties
Fri Feb  6 07:00:44 2009
@@ -645,6 +645,15 @@
 releaseViewResult.error=ERREUR
 releaseViewResult.output=Sortie de l''ex\u00e9cution de la "release"
 releaseViewResult.noOutput=Aucune Sortie
+releasePrepare.scmUsername.label=Nom d''utilisateur SCM
+releasePrepare.scmPassword.label=Mot de passe SCM
+releasePrepare.scmTag.label=SCM Tag
+releasePrepare.scmTagBase.label=SCM Tag Base
+releasePrepare.scmCommentPrefix.label=Pr\u00e9fixe du commentaire SCM
+releasePrepare.prepareGoals.label=Preparation Goals
+releasePrepare.buildEnvironment.label=Environment de build
+releasePrepare.useEditMode.label=Utilisation du mode edit
+releasePrepare.autoVersionSubmodules=autoVersionSubmodules (d\u00e9fini dans le POM)
 
 # ----------------------------------------------------------------------
 # Page: User

Modified: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releasePrepare.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releasePrepare.jsp?rev=741440&r1=741439&r2=741440&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releasePrepare.jsp (original)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releasePrepare.jsp Fri Feb
 6 07:00:44 2009
@@ -30,6 +30,7 @@
       <s:form action="releasePrepare" method="post">
         <h3><s:text name="releasePrepare.parameters"/></h3>
         <input type="hidden" name="projectId" value="<s:property value="projectId"/>"/>
+        <input type="hidden" name="autoVersionSubmodules" value="<s:property value="autoVersionSubmodules"/>"/>
         <div class="axial">
           <table border="1" cellspacing="2" cellpadding="3" width="100%">
             <s:textfield label="%{getText('releasePrepare.scmUsername.label')}" name="scmUsername"
required="true"/>
@@ -43,6 +44,9 @@
             <s:select label="%{getText('releasePrepare.buildEnvironment.label')}" name="profileId"
list="profiles" listValue="name"
                        listKey="id" headerKey="-1" headerValue=""/>
 			      <s:checkbox label="%{getText('releasePrepare.useEditMode.label')}" name="scmUseEditMode"
fieldValue="false"/>
+            <c:if test="${autoVersionSubmodules}">
+              <s:checkbox label="%{getText('releasePrepare.autoVersionSubmodules')}" name="autoVersionSubmodules"
disabled="true" fieldValue="false"/>
+            </c:if>
           </table>
         </div>
 



Mime
View raw message