MPCHANGES-15,16: Add multiple issue/due-to support

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@290896 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
ltheussl
2005-09-22 05:41:20 +00:00
parent b9332eb8e5
commit bd76dfbd26
3 changed files with 100 additions and 17 deletions

View File

@@ -112,7 +112,7 @@
</j:when>
<j:otherwise>
<jsl:applyTemplates select="*"/>
<jsl:applyTemplates select="*"/>
</j:otherwise>
</j:choose>
</table>
@@ -125,32 +125,84 @@
<j:set var="issue"><x:expr select="@issue"/></j:set>
<j:set var="dueto"><x:expr select="@due-to"/></j:set>
<j:set var="duetoemail"><x:expr select="@due-to-email"/></j:set>
<!-- FIXME: Same hack as above -->
<x:set var="currentAction" select="."/>
<tr>
<td><img src="images/${type}.gif" alt="${type}" title="${type}"/></td>
<td>
<jsl:applyTemplates trim="false"/>
<x:if select="$currentAction/description">
<jsl:applyTemplates select="description"/>
</x:if>
<x:if select="not($currentAction/description)">
<x:set var="text" select="string(.)"/>
${text}
</x:if>
<j:if test="${issue != ''}">
<j:useBean var="finder" class="org.apache.maven.changes.IssueFinder"/>
<j:set var="template" value="${maven.changes.issue.template}"/>
<j:set var="trackerURL" value="${pom.issueTrackingUrl}"/>
Fixes <a href="${finder.getIssueURL(trackerURL,issue,template)}">${issue}</a>.
</j:if>
<x:if select="$currentAction/fixes">
<j:set var="fixesTotal"><x:expr select="count(./fixes)"/></j:set>
<j:set var="fixesCount" value="1"/>
Fixes
<x:forEach var="item" select="./fixes">
<j:set var="issue"><x:expr select="@issue"/></j:set>
<a href="${finder.getIssueURL(trackerURL,issue,template)}">${issue}</a>
<j:choose>
<j:when test="${fixesCount == fixesTotal}">.</j:when>
<j:when test="${fixesCount == fixesTotal-1}"> and </j:when>
<j:otherwise>,</j:otherwise>
</j:choose>
<j:set var="fixesCount" value="${1+fixesCount}"/>
</x:forEach>
</x:if>
<x:if select="not($currentAction/fixes)">
<j:if test="${!empty(issue)}">
Fixes <a href="${finder.getIssueURL(trackerURL,issue,template)}">${issue}</a>.
</j:if>
</x:if>
<j:if test="${dueto != ''}">
<j:choose>
<j:when test="${duetoemail != ''}">
Thanks to <a href="mailto:${duetoemail}">${dueto}</a>.
</j:when>
<j:otherwise>
Thanks to ${dueto}.
</j:otherwise>
</j:choose>
</j:if>
<x:if select="$currentAction/dueto">
<j:set var="duetoTotal"><x:expr select="count(./dueto)"/></j:set>
<j:set var="duetoCount" value="1"/>
Thanks to
<x:forEach var="item" select="./dueto">
<j:set var="name"><x:expr select="@name"/></j:set>
<j:set var="email"><x:expr select="@email"/></j:set>
<j:if test="${!empty(email)}">
<a href="mailto:${email}">${name}</a>
</j:if>
<j:if test="${empty(email)}">
${name}
</j:if>
<j:choose>
<j:when test="${duetoCount == duetoTotal}">.</j:when>
<j:when test="${duetoCount == duetoTotal-1}"> and </j:when>
<j:otherwise>,</j:otherwise>
</j:choose>
<j:set var="duetoCount" value="${1+duetoCount}"/>
</x:forEach>
</x:if>
<x:if select="not($currentAction/dueto)">
<j:if test="${!empty(dueto)}">
<j:choose>
<j:when test="${duetoemail != ''}">
Thanks to <a href="mailto:${duetoemail}">${dueto}</a>.
</j:when>
<j:otherwise>
Thanks to ${dueto}.
</j:otherwise>
</j:choose>
</j:if>
</x:if>
</td>
<td><a href="team-list.html#${dev}">${dev}</a></td>
</tr>
</tr>
</jsl:template>
<jsl:template match="description">
<jsl:applyTemplates trim="false"/>
</jsl:template>
<jsl:template match="*">

View File

@@ -2,7 +2,7 @@
<!--
/*
* Copyright 2001-2004 The Apache Software Foundation.
* Copyright 2001-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,8 @@
</properties>
<body>
<release version="1.6-SNAPSHOT" date="in SVN">
<action dev="ltheussl" type="add" issue="MPCHANGES-15"> Add multiple due-to/due-to-email support.</action>
<action dev="ltheussl" type="add" issue="MPCHANGES-16"> Add multiple issue support.</action>
<action dev="ltheussl" type="fix" issue="MPCHANGES-24">The encoding of changes.xml is not preserved after <code>scm:prepare-release</code>.</action>
<action dev="aheritier" type="fix">Fix XTHML 1.0 compliance.</action>
<action dev="ltheussl" type="fix" issue="MPCHANGES-22" due-to="Mike Traum">Document description attribute of release element.</action>

View File

@@ -66,6 +66,35 @@
</document>
]]></source>
<p>
An alternative form of the <code>&lt;action&gt;</code> element
allows you to specify several issues and/or several due-to
elements:
</p>
<source><![CDATA[
<action dev="vmassol" type="fix">
<description>Corrected bug blah blah.</description>
<fixes issue="JIRA-XXX"/>
<fixes issue="JIRA-YYY"/>
.
.
.
<dueto name="John Doe" email="john@doe.com"/>
<dueto name="Jane Doe"/>
.
.
</action>
]]></source>
<p>
The <code>&lt;fixes&gt;</code> element takes one required <code>issue</code>
attribute, the <code>&lt;dueto&gt;</code> element requires only the <code>name</code>
attribute, the <code>email</code> is optional. Note that the <code>&lt;description&gt;</code>,
<code>&lt;fixes&gt;</code> and <code>&lt;dueto&gt;</code> elements take precedence over
any equivalent attributes defined in the <code>&lt;action&gt;</code> element.
</p>
<p>
A live Changes example report can be found
<a href="http://maven.apache.org/reference/plugins/changes/changes-report.html">here</a>.