Files
maven-plugins/file-activity/src/plugin-resources/maven-file-activity-plugin.jsl
T
2003-01-24 03:44:26 +00:00

70 lines
2.1 KiB
XML

<?xml version="1.0"?>
<jsl:stylesheet
select="$doc"
xmlns:j="jelly:core"
xmlns:jsl="jelly:jsl"
xmlns:x="jelly:xml"
xmlns="dummy" trim="false">
<!-- This needs to be instantiated here to be available in the template matches -->
<j:useBean var="mavenTool" class="org.apache.maven.MavenTool"/>
<jsl:template match="changelog">
<document>
<jsl:applyTemplates/>
<properties>
<title>File Activity Analysis</title>
</properties>
<body>
<section name="Activity by File">
<p>
Timeframe: ${maven.activitylog.range} days,
Total Commits:
<x:expr select="count(./changelog-entry)"/>
Total Number of Files Changed:
<x:expr select="count(./changelog-entry/file)"/>
</p>
<table>
<tr>
<th>File Name</th>
<th>Number of times changed</th>
</tr>
<j:set var="fileList" value="${mavenTool.countDescending}"/>
<j:forEach var="key" items="${fileList.keySet()}">
<j:forEach var="name" items="${fileList.get(key)}">
<tr>
<td>
<j:choose>
<j:when test="${pom.repository.url != ''})">
<a href="${pom.repository.url.toString().trim()}${name}">${name}</a>
</j:when>
<j:otherwise>
${name}
</j:otherwise>
</j:choose>
</td>
<td>${key}</td>
</tr>
</j:forEach>
</j:forEach>
</table>
</section>
</body>
</document>
</jsl:template>
<jsl:template match="file">
<j:set var="file">
<x:expr select="name"/>
</j:set>
<j:set var="dummy" value="${mavenTool.addToCount(file)}"/>
</jsl:template>
<!-- element values don't pass through as text -->
<jsl:template match="properties"/>
<jsl:template match="section"/>
<jsl:template match="date"/>
<jsl:template match="time"/>
</jsl:stylesheet>