commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1334440 - /commons/proper/net/trunk/src/changes/release-notes.vm
Date Sat, 05 May 2012 16:06:11 GMT
Author: sebb
Date: Sat May  5 16:06:11 2012
New Revision: 1334440

URL: http://svn.apache.org/viewvc?rev=1334440&view=rev
Log:
Generalise indent handling to any JIRA id; allow for 4 digit issue numbers

Modified:
    commons/proper/net/trunk/src/changes/release-notes.vm

Modified: commons/proper/net/trunk/src/changes/release-notes.vm
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/changes/release-notes.vm?rev=1334440&r1=1334439&r2=1334440&view=diff
==============================================================================
--- commons/proper/net/trunk/src/changes/release-notes.vm (original)
+++ commons/proper/net/trunk/src/changes/release-notes.vm Sat May  5 16:06:11 2012
@@ -14,119 +14,86 @@
 ## KIND, either express or implied.  See the License for the
 ## specific language governing permissions and limitations
 ## under the License.
-
               Apache ${project.name} ${version} RELEASE NOTES
 
 The ${developmentTeam} is pleased to announce the release of ${finalName}
 
 $introduction.replaceAll("(?<!\015)\012", "
-")
+").replaceAll("(?m)^ +","")
 
 ## N.B. the available variables are described here:
 ## http://maven.apache.org/plugins/maven-changes-plugin/examples/using-a-custom-announcement-template.html
-##
 ## Hack to improve layout: replace all pairs of spaces with a single new-line
 $release.description.replaceAll("  ", "
 ")
 
-#if ($release.getActions().size() == 0)
-No changes defined in this version.
-#else
-Changes in this version include:
-
-## indent to be used if there is no issue attribute.
-## should be the same as the indent in the changes.xml file
-## less 2 spaces for the 'o' and trailing space
-#set($indent='          ')
-#if ($release.getActions('add').size() !=0)
-New features:
-#foreach($actionItem in $release.getActions('add'))
+## set up indent sizes. Only change indent1
+#set($props=${project.properties})
+#set($jiralen=$props.get("commons.jira.id").length())
+## indent1 =   POOL-nnnn:
+#set($blanklen=$jiralen+6)## +6 for "-nnnn:"
+## must be at least as long as the longest JIRA id
+#set($blanks="                                  ")
+#set($indent1=$blanks.substring(0,$blanklen))
+## indent2 allows for issue wrapper
+#set($indent2="$indent1   ")
+##
+#macro ( processaction )
 ## Use replaceAll to fix up LF-only line ends on Windows.
 #set($action=$actionItem.getAction().replaceAll("\n","
 "))
+## Fix up indentation for multi-line action descriptions
+#set($action=$action.replaceAll("(?m)^  +",$indent2))
 #if ($actionItem.getIssue())
-#set($issue=$actionItem.getIssue())
+#set($issue="$actionItem.getIssue():")
+## Pad shorter issue numbers
+#if ($issue.length() < $indent1.length())#set ($issue="$issue ")#end
+#if ($issue.length() < $indent1.length())#set ($issue="$issue ")#end
+#if ($issue.length() < $indent1.length())#set ($issue="$issue ")#end
 #else
-#set($issue="")
+#set($issue=$indent1)
 #end
 #if ($actionItem.getDueTo())
-#set($dueto=$actionItem.getDueTo())
+#set($dueto=" Thanks to $actionItem.getDueTo().")
 #else
 #set($dueto="")
 #end
-o#if($!issue != "") $issue: #else$indent#end ${action} #if($!dueto != "")Thanks to $dueto.
#end
-
+o $issue ${action}$dueto
+#set($action="")
 #set($issue="")
 #set($dueto="")
+#end
+##
+#if ($release.getActions().size() == 0)
+No changes defined in this version.
+#else
+Changes in this version include:
+
+#if ($release.getActions('add').size() !=0)
+New features:
+#foreach($actionItem in $release.getActions('add'))
+#processaction()
 #end 
 #end
 
 #if ($release.getActions('fix').size() !=0)
 Fixed Bugs:
 #foreach($actionItem in $release.getActions('fix'))
-## Use replaceAll to fix up LF-only line ends on Windows.
-#set($action=$actionItem.getAction().replaceAll("\n","
-"))
-#if ($actionItem.getIssue())
-#set($issue=$actionItem.getIssue())
-#else
-#set($issue="")
-#end
-#if ($actionItem.getDueTo())
-#set($dueto=$actionItem.getDueTo())
-#else
-#set($dueto="")
-#end
-o#if($!issue != "") $issue: #else$indent#end ${action} #if($!dueto != "")Thanks to $dueto.
#end
-
-#set($issue="")
-#set($dueto="")
+#processaction()
 #end
 #end
 
 #if ($release.getActions('update').size() !=0)
 Changes:
 #foreach($actionItem in $release.getActions('update'))
-## Use replaceAll to fix up LF-only line ends on Windows.
-#set($action=$actionItem.getAction().replaceAll("\n","
-"))
-#if ($actionItem.getIssue())
-#set($issue=$actionItem.getIssue())
-#else
-#set($issue="")
-#end
-#if ($actionItem.getDueTo())
-#set($dueto=$actionItem.getDueTo())
-#else
-#set($dueto="")
-#end
-o#if($!issue != "") $issue: #else$indent#end ${action} #if($!dueto != "")Thanks to $dueto.
#end
-
-#set($issue="")
-#set($dueto="")
+#processaction()
 #end
 #end
 
 #if ($release.getActions('remove').size() !=0)
 Removed:
 #foreach($actionItem in $release.getActions('remove'))
-## Use replaceAll to fix up LF-only line ends on Windows.
-#set($action=$actionItem.getAction().replaceAll("\n","
-"))
-#if ($actionItem.getIssue())
-#set($issue=$actionItem.getIssue())
-#else
-#set($issue="")
-#end
-#if ($actionItem.getDueTo())
-#set($dueto=$actionItem.getDueTo())
-#else
-#set($dueto="")
-#end
-o#if($!issue != "") $issue: #else$indent#end ${action} #if($!dueto != "")Thanks to $dueto.
#end
-
-#set($issue="")
-#set($dueto="")
+#processaction()
 #end
 #end
 ## End of main loop
@@ -135,6 +102,4 @@ o#if($!issue != "") $issue: #else$indent
 For complete information on ${project.name}, including instructions on how to submit bug
reports,
 patches, or suggestions for improvement, see the Apache ${project.name} website:
 
-${project.url}
-
-
+${project.url}
\ No newline at end of file



Mime
View raw message