Create an intermediate summary xml file to ease summary report
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@293488 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
161d2ff233
commit
325bc7cdb3
@ -230,8 +230,14 @@
|
||||
<goal name="checkstyle:report-internal" description="Generate xdocs from checkstyle xml report">
|
||||
|
||||
<mkdir dir="${maven.gen.docs}/checkstyle"/>
|
||||
|
||||
<style
|
||||
in="${maven.checkstyle.output.xml}"
|
||||
out="${maven.checkstyle.output.summary.xml}"
|
||||
style="${plugin.resources}/checkstyle-summary.xsl"/>
|
||||
|
||||
<style
|
||||
in="${maven.checkstyle.output.summary.xml}"
|
||||
out="${maven.gen.docs}/checkstyle/index.xml"
|
||||
style="${plugin.resources}/checkstyle.xsl"/>
|
||||
|
||||
|
||||
@ -36,3 +36,4 @@ maven.checkstyle.usefile = true
|
||||
# Output files
|
||||
maven.checkstyle.output.xml = ${maven.checkstyle.dir}/checkstyle-raw-report.xml
|
||||
maven.checkstyle.output.txt = ${maven.checkstyle.dir}/checkstyle-raw-report.txt
|
||||
maven.checkstyle.output.summary.xml = ${maven.checkstyle.dir}/checkstyle-summary-report.xml
|
||||
|
||||
@ -19,8 +19,8 @@
|
||||
-->
|
||||
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
<xsl:output method="xml" />
|
||||
<xsl:key name="stvalkey" match="//error" use="@message" />
|
||||
<xsl:output method="xml" indent="yes"/>
|
||||
<xsl:key name="errors-by-message" match="//error" use="@message" />
|
||||
<xsl:template match="/">
|
||||
|
||||
<document>
|
||||
@ -54,7 +54,7 @@
|
||||
<table summary="Report summary">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Files</th>
|
||||
<th style="width:75px">Total</th>
|
||||
<th style="width:75px">Infos</th>
|
||||
<th style="width:75px">Warnings</th>
|
||||
<th style="width:75px">Errors</th>
|
||||
@ -62,22 +62,22 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><xsl:value-of select="count(//file)" /></td>
|
||||
<td><xsl:value-of select="count(//file/error[@severity='info'])" /></td>
|
||||
<td><xsl:value-of select="count(//file/error[@severity='warning'])" /></td>
|
||||
<td><xsl:value-of select="count(//file/error[@severity='error'])" /></td>
|
||||
<td><xsl:value-of select="count(//error)" /></td>
|
||||
<td><xsl:value-of select="count(//error[@severity='info'])" /></td>
|
||||
<td><xsl:value-of select="count(//error[@severity='warning'])" /></td>
|
||||
<td><xsl:value-of select="count(//error[@severity='error'])" /></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
<xsl:apply-templates select="." mode="count">
|
||||
<xsl:apply-templates select="." mode="display">
|
||||
<xsl:with-param name="severity">error</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
<xsl:apply-templates select="." mode="count">
|
||||
<xsl:apply-templates select="." mode="display">
|
||||
<xsl:with-param name="severity">warning</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
<xsl:apply-templates select="." mode="count">
|
||||
<xsl:apply-templates select="." mode="display">
|
||||
<xsl:with-param name="severity">info</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
|
||||
@ -85,33 +85,33 @@
|
||||
</document>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="/" mode="count">
|
||||
<xsl:template match="/" mode="display">
|
||||
<xsl:param name="severity"/>
|
||||
|
||||
<xsl:element name="section">
|
||||
<xsl:attribute name="name">Checkstyle <xsl:value-of select="$severity"/> Summary</xsl:attribute>
|
||||
<xsl:attribute name="name">Checkstyle <xsl:value-of select="$severity"/> summary</xsl:attribute>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Error</th>
|
||||
<th>Count</th>
|
||||
</tr>
|
||||
<xsl:for-each select="//error[@severity=$severity]" >
|
||||
<xsl:variable name="tmp" >
|
||||
<xsl:value-of select="./@message" />
|
||||
</xsl:variable>
|
||||
<xsl:if test="generate-id(.) = generate-id(key('stvalkey',$tmp)[1])">
|
||||
<tr>
|
||||
<td><xsl:value-of select="$tmp" /></td>
|
||||
<td><xsl:value-of select="count(key('stvalkey',$tmp))" /></td>
|
||||
</tr>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:for-each select="//error[@severity=$severity]" >
|
||||
<xsl:sort select="@count" order="descending"/>
|
||||
<xsl:sort select="@message"/>
|
||||
<tr>
|
||||
<td><xsl:value-of select="@message" /></td>
|
||||
<td><xsl:value-of select="@count" /></td>
|
||||
</tr>
|
||||
</xsl:for-each>
|
||||
|
||||
</table>
|
||||
|
||||
</xsl:element>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="text()" />
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
||||
@ -161,6 +161,14 @@
|
||||
Defaults to <code>${maven.checkstyle.dir}/checkstyle-raw-report.txt</code>.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>maven.checkstyle.output.summary.xml</td>
|
||||
<td>Yes</td>
|
||||
<td>
|
||||
Output file where the xml summary report is written.
|
||||
Defaults to <code>${maven.checkstyle.dir}/checkstyle-summary-report.xml</code>.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user