MPCHANGES-14: Added sorting of <code><action></code> elements. It is controlled by 2 properties. The <code>maven.changes.sort</code> property decides whether sorting is enabled or not and the <code>maven.changes.sort.order</code> one decides the sort order. Defaults to <code>add,fix,update,remove</code>.
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@116227 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
1 parent
2bfbff3677
commit
24d79b2485
4 files changed
+74
-2
No files matched your search
@@ -26,6 +26,8 @@
|
||||
xmlns:jsl="jelly:jsl"
|
||||
xmlns:x="jelly:xml"
|
||||
xmlns:doc="doc"
|
||||
xmlns:u="jelly:util"
|
||||
xmlns:ant="jelly:ant"
|
||||
xmlns="dummy" trim="false">
|
||||
|
||||
<jsl:template match="document">
|
||||
@@ -66,8 +68,43 @@
|
||||
<j:set var="anchorName"><doc:escapeNameToken value="${version}"/></j:set>
|
||||
<a name="${anchorName}"/>
|
||||
<table>
|
||||
<tr><th style='width:50px'>Type</th><th>Changes</th><th style='width:70px'>By</th></tr>
|
||||
<jsl:applyTemplates select="*"/>
|
||||
<tr><th style='width:50px'>Type</th><th>Changes</th><th style='width:70px'>By</th></tr>
|
||||
<j:choose>
|
||||
<j:when test="${maven.changes.sort}">
|
||||
<u:tokenize var="actionTypes" delim=", ">${maven.changes.sort.order}</u:tokenize>
|
||||
|
||||
<!-- FIXME: Big hack here. Jelly looses the reference to the
|
||||
current node so we have to explicitely remember it for
|
||||
Jelly! -->
|
||||
<x:set var="current" select="."/>
|
||||
|
||||
<j:forEach var="actionType" items="${actionTypes}">
|
||||
<!-- FIXME: Find a way to pass the actionType value directly in the select
|
||||
clause. This would remove the need for this ugly choose tag -->
|
||||
<j:choose>
|
||||
<j:when test="${actionType.equals('add')}">
|
||||
<jsl:applyTemplates select="$current/action[@type='add']"/>
|
||||
</j:when>
|
||||
<j:when test="${actionType.equals('fix')}">
|
||||
<jsl:applyTemplates select="$current/action[@type='fix']"/>
|
||||
</j:when>
|
||||
<j:when test="${actionType.equals('update')}">
|
||||
<jsl:applyTemplates select="$current/action[@type='update']"/>
|
||||
</j:when>
|
||||
<j:when test="${actionType.equals('remove')}">
|
||||
<jsl:applyTemplates select="$current/action[@type='remove']"/>
|
||||
</j:when>
|
||||
<j:otherwise>
|
||||
<ant:fail>Invalid type '${actionType}'</ant:fail>
|
||||
</j:otherwise>
|
||||
</j:choose>
|
||||
</j:forEach>
|
||||
|
||||
</j:when>
|
||||
<j:otherwise>
|
||||
<jsl:applyTemplates select="*"/>
|
||||
</j:otherwise>
|
||||
</j:choose>
|
||||
</table>
|
||||
</section>
|
||||
</jsl:template>
|
||||
|
||||
Reference in new issue
Block a user