continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r744111 - in /continuum/trunk: continuum-api/src/main/java/org/apache/maven/continuum/release/ continuum-release/src/main/java/org/apache/maven/continuum/release/ continuum-release/src/main/resources/META-INF/plexus/ continuum-webapp/src/ma...
Date Fri, 13 Feb 2009 13:44:43 GMT
Author: evenisse
Date: Fri Feb 13 13:44:43 2009
New Revision: 744111

URL: http://svn.apache.org/viewvc?rev=744111&view=rev
Log:
[CONTINUUM-1503] Use sanitizaTagname from maven-scm to provide a correct tag name like the
release plugin

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-release/src/main/resources/META-INF/plexus/components.xml
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePrepareAction.java
    continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releasePerform.jsp
    continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releasePerformFromScm.jsp
    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=744111&r1=744110&r2=744111&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 13 13:44:43 2009
@@ -105,7 +105,7 @@
      * @param listener
      * @throws ContinuumReleaseException
      */
-    public void rollback( String releaseId, String workingDirectory, ContinuumReleaseManagerListener
listener )
+    void rollback( String releaseId, String workingDirectory, ContinuumReleaseManagerListener
listener )
         throws ContinuumReleaseException;
 
     Map getPreparedReleases();
@@ -119,4 +119,14 @@
         throws ContinuumReleaseException;
 
     Map<String, String> getEnvironments( Profile profile );
+
+    /**
+     * Clean up the tagname to respect the scm provider policy.
+     *
+     * @param scmUrl  The scm url
+     * @param tagName The tag name
+     * @return The cleaned tag name
+     */
+    String sanitizeTagName( String scmUrl, String tagName )
+        throws Exception;
 }

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=744111&r1=744110&r2=744111&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 13 13:44:43 2009
@@ -30,6 +30,9 @@
 import org.apache.maven.continuum.release.tasks.PrepareReleaseProjectTask;
 import org.apache.maven.continuum.release.tasks.RollbackReleaseProjectTask;
 import org.apache.maven.continuum.utils.WorkingDirectoryService;
+import org.apache.maven.scm.manager.ScmManager;
+import org.apache.maven.scm.provider.ScmProvider;
+import org.apache.maven.scm.repository.ScmRepository;
 import org.apache.maven.shared.release.ReleaseManagerListener;
 import org.apache.maven.shared.release.config.ReleaseDescriptor;
 import org.apache.maven.shared.release.config.ReleaseDescriptorStore;
@@ -85,6 +88,11 @@
      */
     private InstallationService installationService;
 
+    /**
+     * @plexus.requirement
+     */
+    private ScmManager scmManager;
+
     private Map<String, ContinuumReleaseManagerListener> listeners;
 
     /**
@@ -175,9 +183,9 @@
         {
             getListeners().put( releaseId, listener );
 
-            performReleaseQueue.put( new PerformReleaseProjectTask( releaseId, descriptor,
buildDirectory, goals,
-                                                                    useReleaseProfile,
-                                                                    (ReleaseManagerListener)
listener, repository ) );
+            performReleaseQueue.put(
+                new PerformReleaseProjectTask( releaseId, descriptor, buildDirectory, goals,
useReleaseProfile,
+                                               (ReleaseManagerListener) listener, repository
) );
         }
         catch ( TaskQueueException e )
         {
@@ -276,6 +284,8 @@
         descriptor.setPreparationGoals( releaseProperties.getProperty( "prepareGoals" ) );
         descriptor.setAdditionalArguments( releaseProperties.getProperty( "arguments" ) );
         descriptor.setAddSchema( Boolean.valueOf( releaseProperties.getProperty( "addSchema"
) ) );
+        descriptor.setAutoVersionSubmodules(
+            Boolean.valueOf( releaseProperties.getProperty( "autoVersionSubmodules" ) ) );
 
         String useEditMode = releaseProperties.getProperty( "useEditMode" );
         if ( BooleanUtils.toBoolean( useEditMode ) )
@@ -354,4 +364,12 @@
         }
         return jdk.getVarValue();
     }
+
+    public String sanitizeTagName( String scmUrl, String tagName )
+        throws Exception
+    {
+        ScmRepository scmRepo = scmManager.makeScmRepository( scmUrl );
+        ScmProvider scmProvider = scmManager.getProviderByRepository( scmRepo );
+        return scmProvider.sanitizeTagName( tagName );
+    }
 }

Modified: continuum/trunk/continuum-release/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-release/src/main/resources/META-INF/plexus/components.xml?rev=744111&r1=744110&r2=744111&view=diff
==============================================================================
--- continuum/trunk/continuum-release/src/main/resources/META-INF/plexus/components.xml (original)
+++ continuum/trunk/continuum-release/src/main/resources/META-INF/plexus/components.xml Fri
Feb 13 13:44:43 2009
@@ -49,6 +49,9 @@
         <requirement>
           <role>org.apache.maven.continuum.installation.InstallationService</role>
         </requirement>
+        <requirement>
+          <role>org.apache.maven.scm.manager.ScmManager</role>
+        </requirement>
       </requirements>
     </component>
 

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=744111&r1=744110&r2=744111&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 13 13:44:43 2009
@@ -152,6 +152,11 @@
 
         getReleasePluginParameters( workingDirectory, "pom.xml" );
 
+        ContinuumReleaseManager releaseManager = getContinuum().getReleaseManager();
+
+        //CONTINUUM-1503
+        releaseManager.sanitizeTagName( scmUrl, scmTag );
+
         processProject( workingDirectory, "pom.xml" );
 
         profiles = this.getContinuum().getProfileService().getAllProfiles();
@@ -261,8 +266,9 @@
 
         ContinuumReleaseManager releaseManager = getContinuum().getReleaseManager();
 
-        releaseId = releaseManager.prepare( project, getReleaseProperties(), getRelVersionMap(),
getDevVersionMap(),
-                                            listener, profile );
+        releaseId =
+            releaseManager.prepare( project, getReleaseProperties(), getRelVersionMap(),
getDevVersionMap(), listener,
+                                    profile );
 
         return SUCCESS;
     }
@@ -435,6 +441,7 @@
         p.setProperty( "arguments", arguments );
         p.setProperty( "useEditMode", Boolean.toString( scmUseEditMode ) );
         p.setProperty( "addSchema", Boolean.toString( addSchema ) );
+        p.setProperty( "autoVersionSubmodules", Boolean.toString( autoVersionSubmodules )
);
 
         return p;
     }

Modified: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releasePerform.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releasePerform.jsp?rev=744111&r1=744110&r2=744111&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releasePerform.jsp (original)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releasePerform.jsp Fri Feb
13 13:44:43 2009
@@ -32,7 +32,7 @@
         <div class="axial">
           <table border="1" cellspacing="2" cellpadding="3" width="100%">
             <s:textfield label="%{getText('releasePerformFromScm.goals.label')}" name="goals"/>
-            <s:textfield label="%{getText('releasePrepare.arguments.label')}" name="arguments"
required="true"/>
+            <s:textfield label="%{getText('releasePrepare.arguments.label')}" name="arguments"/>
             <s:checkbox label="%{getText('releasePerformFromScm.useReleaseProfile.label')}"
name="useReleaseProfile" fieldValue="false"/>
           </table>
         </div>

Modified: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releasePerformFromScm.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releasePerformFromScm.jsp?rev=744111&r1=744110&r2=744111&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releasePerformFromScm.jsp
(original)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releasePerformFromScm.jsp
Fri Feb 13 13:44:43 2009
@@ -39,7 +39,7 @@
               <s:textfield label="%{getText('releasePerformFromScm.scmTagBase.label')}"
name="scmTagBase"/>
             </c:if>
             <s:textfield label="%{getText('releasePerformFromScm.goals.label')}" name="goals"/>
-            <s:textfield label="%{getText('releasePrepare.arguments.label')}" name="arguments"
required="true"/>
+            <s:textfield label="%{getText('releasePrepare.arguments.label')}" name="arguments"/>
             <s:checkbox label="%{getText('releasePerformFromScm.useReleaseProfile.label')}"
name="useReleaseProfile"/>
             <s:select label="%{getText('releasePerformFromScm.buildEnvironment.label')}"
name="profileId" list="profiles" listValue="name"
                        listKey="id" headerKey="-1" headerValue=""/>

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=744111&r1=744110&r2=744111&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
13 13:44:43 2009
@@ -41,7 +41,7 @@
             </c:if>
             <s:textfield label="%{getText('releasePrepare.scmCommentPrefix.label')}" name="scmCommentPrefix"/>
             <s:textfield label="%{getText('releasePrepare.prepareGoals.label')}" name="prepareGoals"
required="true"/>
-            <s:textfield label="%{getText('releasePrepare.arguments.label')}" name="arguments"
required="true"/>
+            <s:textfield label="%{getText('releasePrepare.arguments.label')}" name="arguments"/>
             <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"/>



Mime
View raw message