Files
maven-plugins/changelog/src/plugin-resources/changelog.jsl
T
2004-04-21 00:55:44 +00:00

125 lines
4.6 KiB
XML

<?xml version="1.0"?>
<!--
* ========================================================================
*
* Copyright 2004 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.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ========================================================================
-->
<jsl:stylesheet
select="$doc"
xmlns:j="jelly:core"
xmlns:jsl="jelly:jsl"
xmlns:x="jelly:xml"
xmlns="dummy" trim="false">
<jsl:template match="changelog">
<document>
<properties>
<title>Changelog Report</title>
</properties>
<body>
<section name="Changelog Report">
<p>
<!-- The range needs to be fed in somehow. -->
Timeframe: ${maven.changelog.range} days,
Total Commits:
<x:expr select="count(./changelog-entry)"/>
Total Number of Files Changed:
<x:expr select="count(./changelog-entry/file)"/>
</p>
<table>
<thead>
<tr>
<th>Date</th>
<th>Author</th>
<th>File/Message</th>
</tr>
</thead>
<tbody>
<x:set var="changes" select="changelog-entry"/>
<j:forEach var="change" items="${changes}">
<tr>
<td>
<x:expr select="$change/date"/>
<x:expr select="$change/time"/>
</td>
<td>
<x:expr select="$change/author"/>
</td>
<td>
<x:forEach var="file" select="$change/file">
<p>
<j:set var="name"><x:expr select="$file/name"/></j:set>
<j:set var="revision"><x:expr select="$file/revision"/></j:set>
<j:set var="repositoryUrl" value="${pom.repository.url}"/>
<j:choose>
<j:when test="${repositoryUrl.indexOf('?')>0}">
<j:set var="repository" value="${repositoryUrl.substring(0, repositoryUrl.indexOf('?'))}"/>
<j:set var="tmpMultiRepoParam" value="${repositoryUrl.substring(repository.length())}"/>
<j:set var="oneRepoParam" value="?${tmpMultiRepoParam.substring(1)}"/>
<j:set var="multiRepoParam" value="&amp;${tmpMultiRepoParam.substring(1)}"/>
</j:when>
<j:otherwise>
<j:set var="repository" value="${repositoryUrl}"/>
<j:set var="oneRepoParam" value=""/>
<j:set var="multiRepoParam" value=""/>
</j:otherwise>
</j:choose>
<j:choose>
<j:when test="${pom.repository.connection.startsWith('scm:perforce')}">
<a href="${repository}${name}?ac=22">${name}</a>
<a href="${repository}${name}?ac=64&amp;rev1=${revision}">v${revision}</a>
</j:when>
<j:otherwise>
<a href="${repository}${name}${oneRepoParam}">${name}</a>
<a href="${repository}${name}?rev=${revision}&amp;content-type=text/vnd.viewcvs-markup${multiRepoParam}">v${revision}</a>
</j:otherwise>
</j:choose>
</p>
</x:forEach>
<!-- This works -->
<x:expr select="$change/msg"/>
<!-- But this does not work ?
<j:set var="msg"><x:expr select="$change/msg"/></j:set>
${msg}
${escape.getText(msg)}
Something to track down. Probably not going to be much
html in the changelog entries any way.
-->
</td>
</tr>
</j:forEach>
</tbody>
</table>
</section>
</body>
</document>
</jsl:template>
</jsl:stylesheet>