You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by lt...@apache.org on 2005/09/23 22:31:12 UTC

svn commit: r291201 - in /maven/maven-1/plugins/trunk/announcement: src/plugin-resources/announcement.jsl xdocs/changes.xml

Author: ltheussl
Date: Fri Sep 23 13:30:31 2005
New Revision: 291201

URL: http://svn.apache.org/viewcvs?rev=291201&view=rev
Log:
MPANNOUNCEMENT-18: Support new format of action element in changes.xml

Modified:
    maven/maven-1/plugins/trunk/announcement/src/plugin-resources/announcement.jsl
    maven/maven-1/plugins/trunk/announcement/xdocs/changes.xml

Modified: maven/maven-1/plugins/trunk/announcement/src/plugin-resources/announcement.jsl
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/announcement/src/plugin-resources/announcement.jsl?rev=291201&r1=291200&r2=291201&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/announcement/src/plugin-resources/announcement.jsl (original)
+++ maven/maven-1/plugins/trunk/announcement/src/plugin-resources/announcement.jsl Fri Sep 23 13:30:31 2005
@@ -56,6 +56,8 @@
 </j:whitespace>
       </j:forEach>
       <j:whitespace trim="false">
+===============================================================================
+
 Changes in this version include:</j:whitespace>
 
       <x:set var="actions" select="action[@type='add']" sort="@type" />
@@ -103,6 +105,9 @@
       <u:available file="${basedir}/plugin.jelly">
         <j:whitespace trim="false"> 
 
+===============================================================================
+
+
 To automatically install the plugin, type the following on a single line:
 
 maven plugin:download
@@ -113,28 +118,78 @@
 
 For a manual installation, you can download the plugin here:
 ${maven.announcement.distributionUrl}/${pom.artifactId}-${versionVariable}.jar
-        </j:whitespace>
+</j:whitespace>
       </u:available>
       <j:whitespace trim="false"> 
 
 Have fun!
 -The ${pom.name} development team
-      </j:whitespace>
+</j:whitespace>
     </j:if>
 
   </jsl:template>
   
   <jsl:template match="action" trim="true">
-    <x:set var="body" select="string(.)"/>
     <j:set var="counter" value=""/>
-        
-    <j:set var="issue"><x:expr select="@issue"/></j:set>
-    <j:set var="dueto"><x:expr select="@due-to"/></j:set>
-        
+    <x:set var="currentAction" select="."/>
     <j:set var="text" trim="true">
-      ${body}
-      <j:if test="${issue != ''}"><j:whitespace> Issue: ${issue}.</j:whitespace></j:if>
-      <j:if test="${dueto != ''}"><j:whitespace> Thanks to ${dueto}.</j:whitespace></j:if>
+
+      <x:if select="$currentAction/description">
+        <x:set var="text" select="string(./description)"/>
+      </x:if>
+      <x:if select="not(./description)">
+        <x:set var="text" select="string(.)"/>
+      </x:if>
+      <j:whitespace>${text}</j:whitespace>
+
+      <x:if select="$currentAction/fixes">
+        <j:set var="fixesTotal"><x:expr select="count(./fixes)"/></j:set>
+        <j:set var="fixesCount" value="1"/>
+        <j:whitespace>Fixes </j:whitespace>
+        <x:forEach var="item" select="./fixes">
+          <j:set var="issue"><x:expr select="@issue"/></j:set>
+          <j:set var="separator">
+            <j:choose>
+              <j:when test="${fixesCount == fixesTotal}"><j:whitespace>. </j:whitespace></j:when>
+              <j:when test="${fixesCount == fixesTotal-1}"><j:whitespace> and </j:whitespace></j:when>
+              <j:otherwise><j:whitespace>, </j:whitespace></j:otherwise>
+            </j:choose>
+          </j:set>
+          <j:whitespace>${issue}${separator}</j:whitespace>
+          <j:set var="fixesCount" value="${1+fixesCount}"/>
+        </x:forEach>
+      </x:if>
+      <x:if select="not(./fixes)">
+        <j:set var="issue"><x:expr select="@issue"/></j:set>
+        <j:if test="${!empty(issue)}">
+          <j:whitespace> Fixes ${issue}.</j:whitespace>
+        </j:if>
+      </x:if>
+
+      <x:if select="$currentAction/dueto">
+        <j:set var="duetoTotal"><x:expr select="count(./dueto)"/></j:set>
+        <j:set var="duetoCount" value="1"/>
+        <j:whitespace>Thanks to </j:whitespace>
+        <x:forEach var="item" select="./dueto">
+          <j:set var="name"><x:expr select="@name"/></j:set>
+          <j:set var="separator">
+            <j:choose>
+              <j:when test="${duetoCount == duetoTotal}"><j:whitespace>. </j:whitespace></j:when>
+              <j:when test="${duetoCount == duetoTotal-1}"><j:whitespace> and </j:whitespace></j:when>
+              <j:otherwise><j:whitespace>, </j:whitespace></j:otherwise>
+            </j:choose>
+          </j:set>
+          <j:whitespace>${name}${separator}</j:whitespace>
+          <j:set var="duetoCount" value="${1+duetoCount}"/>
+        </x:forEach>
+      </x:if>
+      <x:if select="not(./dueto)">
+        <j:set var="dueto"><x:expr select="@due-to"/></j:set>
+        <j:if test="${!empty(dueto)}">
+          <j:whitespace> Thanks to ${dueto}.</j:whitespace>
+        </j:if>
+      </x:if>
+
     </j:set>
         
     <j:forEach var="line" items="${formatter.format(text,75)}">

Modified: maven/maven-1/plugins/trunk/announcement/xdocs/changes.xml
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/announcement/xdocs/changes.xml?rev=291201&r1=291200&r2=291201&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/announcement/xdocs/changes.xml (original)
+++ maven/maven-1/plugins/trunk/announcement/xdocs/changes.xml Fri Sep 23 13:30:31 2005
@@ -25,6 +25,7 @@
   </properties>
   <body>
     <release version="1.4-SNAPSHOT" date="in CVS">
+      <action dev="ltheussl" type="add" issue="MPANNOUNCEMENT-18">Support new format of <code>&lt;action&gt;</code> element in <code>changes.xml</code>.</action>
       <action dev="ltheussl" type="fix" issue="MPANNOUNCEMENT-3">CR-LF generated do not match the platform.</action>
       <action dev="ltheussl" type="fix" issue="MPANNOUNCEMENT-10">Xml entities transformed in wrong direction.</action>
       <action dev="vmassol" type="add" issue="MPANNOUNCEMENT-15">



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org