Added summary report as default

Moved reports to its own checkstyle folder

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@292600 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
carlos 2005-09-30 02:30:50 +00:00
parent 8dcde2b0bd
commit bacc4d1f15
8 changed files with 141 additions and 29 deletions

View File

@ -229,10 +229,16 @@
<goal name="checkstyle:report-internal" description="Generate xdocs from checkstyle xml report"> <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.gen.docs}/checkstyle/index.xml"
style="${plugin.resources}/checkstyle.xsl"/>
<doc:jsl <doc:jsl
input="${maven.checkstyle.output.xml}" input="${maven.checkstyle.output.xml}"
output="checkstyle-report.xml" output="checkstyle/all.xml"
stylesheet="${plugin.resources}/checkstyle.jsl" stylesheet="${plugin.resources}/checkstyle-all.jsl"
encoding="${maven.docs.outputencoding}" encoding="${maven.docs.outputencoding}"
outputMode="xml" outputMode="xml"
prettyPrint="true"/> prettyPrint="true"/>
@ -245,7 +251,7 @@
<!-- Generate a RSS feed of the checktyle errors --> <!-- Generate a RSS feed of the checktyle errors -->
<doc:jsl <doc:jsl
input="${maven.checkstyle.output.xml}" input="${maven.checkstyle.output.xml}"
output="checkstyle.rss" output="checkstyle/checkstyle.rss"
stylesheet="${plugin.resources}/checkstyle2rss.jsl" stylesheet="${plugin.resources}/checkstyle2rss.jsl"
encoding="${maven.docs.outputencoding}" encoding="${maven.docs.outputencoding}"
outputMode="xml" outputMode="xml"
@ -265,7 +271,7 @@
<doc:registerReport <doc:registerReport
name="Checkstyle" name="Checkstyle"
pluginName="checkstyle" pluginName="checkstyle"
link="checkstyle-report" link="checkstyle/index"
description="Report on coding style conventions."/> description="Report on coding style conventions."/>
</j:if> </j:if>
</goal> </goal>
@ -293,7 +299,7 @@
<doc:jsl <doc:jsl
input="${maven.checkstyle.output.xml}" input="${maven.checkstyle.output.xml}"
output="checkstyle-report-${severity}.xml" output="checkstyle/${severity}.xml"
stylesheet="${plugin.resources}/checkstyle_severity_filter.jsl" stylesheet="${plugin.resources}/checkstyle_severity_filter.jsl"
encoding="${maven.docs.outputencoding}" encoding="${maven.docs.outputencoding}"
outputMode="xml" outputMode="xml"

View File

@ -47,17 +47,7 @@
<p> <p>
The following document contains the results of The following document contains the results of
<a href="http://checkstyle.sourceforge.net/">Checkstyle</a> <a href="http://checkstyle.sourceforge.net/">Checkstyle</a>
<a href="checkstyle.rss"><img src="images/rss.png"/></a>. <a href="checkstyle.rss"><img src="../images/rss.png"/></a>.
</p>
</section>
<section name="Errors filtered by severity">
<p>
<ul>
<li><a href="checkstyle-report-error.html">Error</a></li>
<li><a href="checkstyle-report-warning.html">Warning</a></li>
<li><a href="checkstyle-report-info.html">Info</a></li>
</ul>
</p> </p>
</section> </section>
@ -149,13 +139,13 @@
<j:set var="severity" value="${error.attribute('severity').getValue()}"/> <j:set var="severity" value="${error.attribute('severity').getValue()}"/>
<j:choose> <j:choose>
<j:when test="${severity == 'error'}"> <j:when test="${severity == 'error'}">
<img src="images/icon_error_sml.gif" width="15" height="15" alt="Error" /> <img src="../images/icon_error_sml.gif" width="15" height="15" alt="Error" />
</j:when> </j:when>
<j:when test="${severity == 'warning'}"> <j:when test="${severity == 'warning'}">
<img src="images/icon_warning_sml.gif" width="15" height="15" alt="Warning" /> <img src="../images/icon_warning_sml.gif" width="15" height="15" alt="Warning" />
</j:when> </j:when>
<j:when test="${severity == 'info'}"> <j:when test="${severity == 'info'}">
<img src="images/icon_info_sml.gif" width="15" height="15" alt="Info" /> <img src="../images/icon_info_sml.gif" width="15" height="15" alt="Info" />
</j:when> </j:when>
</j:choose> </j:choose>
</td> </td>
@ -171,7 +161,7 @@
<j:set var="index" value="${mavenTool.toInteger(lastIndex.toString())}"/> <j:set var="index" value="${mavenTool.toInteger(lastIndex.toString())}"/>
<j:set var="nameWithoutJavaExtension" value="${name.substring(0, index)}"/> <j:set var="nameWithoutJavaExtension" value="${name.substring(0, index)}"/>
<util:replace var="nameWithoutJavaExtension" value="${nameWithoutJavaExtension}" oldChar="\\" newChar="/"/> <util:replace var="nameWithoutJavaExtension" value="${nameWithoutJavaExtension}" oldChar="\\" newChar="/"/>
<a href="xref/${nameWithoutJavaExtension}.html#${line}">${line}</a> <a href="../xref/${nameWithoutJavaExtension}.html#${line}">${line}</a>
</j:when> </j:when>
<j:otherwise> <j:otherwise>
${line} ${line}

View File

@ -0,0 +1,103 @@
<!--
* ========================================================================
*
* 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.
*
* ========================================================================
-->
<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:template match="/">
<document>
<properties>
<title>Checkstyle Results</title>
</properties>
<body>
<section name="Checkstyle Results">
<p>
The following document contains the results of
<a href="http://checkstyle.sourceforge.net/">Checkstyle</a>
<a href="checkstyle.rss"><img src="images/rss.png"/></a>.
</p>
</section>
<section name="Detailed reports">
<p>
<ul>
<li><a href="all.html">All problems</a></li>
<li><a href="error.html">Error level problems</a></li>
<li><a href="warning.html">Warning level problems</a></li>
<li><a href="info.html">Info level problems</a></li>
</ul>
</p>
</section>
<section name="Summary">
<table summary="Report summary">
<thead>
<tr>
<th>Files</th>
<th style="width:75px">Infos</th>
<th style="width:75px">Warnings</th>
<th style="width:75px">Errors</th>
</tr>
</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>
</tr>
</tbody>
</table>
</section>
<section name="Checkstyle Error Summary">
<table>
<tr>
<th>Error</th>
<th>Count</th>
</tr>
<xsl:for-each select="//error" >
<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>
</table>
</section>
</body>
</document>
</xsl:template>
<xsl:template match="text()" />
</xsl:stylesheet>

View File

@ -44,7 +44,7 @@
<channel rdf:about="${pom.url}"> <channel rdf:about="${pom.url}">
<title>Checkstyle report for ${pom.name}</title> <title>Checkstyle report for ${pom.name}</title>
<link>${pom.url}/checkstyle-report.html</link> <link>${pom.url}/checkstyle/index.html</link>
<description>Checkstyle report for ${pom.name}</description> <description>Checkstyle report for ${pom.name}</description>
<dc:language>en-us</dc:language> <dc:language>en-us</dc:language>
<dc:creator></dc:creator> <dc:creator></dc:creator>

View File

@ -54,12 +54,12 @@
<title>File: ${fileCount}, Errors: ${errorCount}, Warnings: ${warningCount}, Infos: ${infoCount}</title> <title>File: ${fileCount}, Errors: ${errorCount}, Warnings: ${warningCount}, Infos: ${infoCount}</title>
<!-- If we don't go through a tmp variable Jelly inserts a space between ${pom.url} <!-- If we don't go through a tmp variable Jelly inserts a space between ${pom.url}
and '/checkstyle-report.html'. Go figure... --> and '/checkstyle/index.html'. Go figure... -->
<j:set var="link" value="${pom.url}/checkstyle-report.html"/> <j:set var="link" value="${pom.url}/checkstyle/index.html"/>
<link>${link}</link> <link>${link}</link>
<description> <description>
<p>Click <a href="${pom.url}/checkstyle-report.html">here</a> for the full Checkstyle report.</p> <p>Click <a href="${pom.url}/checkstyle/index.html">here</a> for the full Checkstyle report.</p>
<table summary="Files" border="1"> <table summary="Files" border="1">
<thead> <thead>

View File

@ -64,7 +64,7 @@
<p> <p>
The following document contains the results of The following document contains the results of
<a href="http://checkstyle.sourceforge.net/">Checkstyle</a> <a href="http://checkstyle.sourceforge.net/">Checkstyle</a>
<a href="checkstyle.rss"><img src="images/rss.png"/></a> <a href="checkstyle.rss"><img src="../images/rss.png"/></a>
for severity ${severity}. for severity ${severity}.
</p> </p>
</section> </section>
@ -142,7 +142,7 @@
<tbody> <tbody>
<tr> <tr>
<td style="width:20px"> <td style="width:20px">
<img src="images/icon_${severity}_sml.gif" width="15" height="15" alt="Error" /> <img src="../images/icon_${severity}_sml.gif" width="15" height="15" alt="Error" />
</td> </td>
<td> <td>
<j:set var="errorMessage" value="${error.attribute('message').getValue()}"/> <j:set var="errorMessage" value="${error.attribute('message').getValue()}"/>
@ -156,7 +156,7 @@
<j:set var="index" value="${mavenTool.toInteger(lastIndex.toString())}"/> <j:set var="index" value="${mavenTool.toInteger(lastIndex.toString())}"/>
<j:set var="nameWithoutJavaExtension" value="${name.substring(0, index)}"/> <j:set var="nameWithoutJavaExtension" value="${name.substring(0, index)}"/>
<util:replace var="nameWithoutJavaExtension" value="${nameWithoutJavaExtension}" oldChar="\\" newChar="/"/> <util:replace var="nameWithoutJavaExtension" value="${nameWithoutJavaExtension}" oldChar="\\" newChar="/"/>
<a href="xref/${nameWithoutJavaExtension}.html#${line}">${line}</a> <a href="../xref/${nameWithoutJavaExtension}.html#${line}">${line}</a>
</j:when> </j:when>
<j:otherwise> <j:otherwise>
${line} ${line}

View File

@ -26,16 +26,27 @@
<goal name="test-checkstyle-report"> <goal name="test-checkstyle-report">
<attainGoal name="checkstyle:report"/> <attainGoal name="checkstyle:report"/>
<assert:assertFileExists file="${maven.gen.docs}/checkstyle-report.xml"/> <assert:assertFileExists file="${maven.gen.docs}/checkstyle/index.xml"/>
<assert:assertFileExists file="${maven.gen.docs}/checkstyle/all.xml"/>
<assert:assertFileExists file="${maven.gen.docs}/checkstyle/error.xml"/>
<assert:assertFileExists file="${maven.gen.docs}/checkstyle/warning.xml"/>
<assert:assertFileExists file="${maven.gen.docs}/checkstyle/info.xml"/>
<!-- Verify that there are no Boolean instantiation errors as we have <!-- Verify that there are no Boolean instantiation errors as we have
excluded the SuppressionFilterSample java file from the checks --> excluded the SuppressionFilterSample java file from the checks -->
<util:file var="rawFile" name="${maven.build.dir}/checkstyle-raw-report.xml"/> <util:file var="rawFile" name="${maven.checkstyle.output.xml}"/>
<x:parse var="doc" xml="${rawFile}"/> <x:parse var="doc" xml="${rawFile}"/>
<x:if select="$doc//file[contains(@name,'SuppressionFilterSample')]/error[contains(@source,'IllegalInstantiationCheck')]"> <x:if select="$doc//file[contains(@name,'SuppressionFilterSample')]/error[contains(@source,'IllegalInstantiationCheck')]">
<fail>Should not have generated an error as we have a suppression filter set on SuppressionFilterSample</fail> <fail>Should not have generated an error as we have a suppression filter set on SuppressionFilterSample</fail>
</x:if> </x:if>
<attainGoal name="xdoc"/>
<assert:assertFileExists file="${maven.docs.dest}/checkstyle/index.html"/>
<assert:assertFileExists file="${maven.docs.dest}/checkstyle/all.html"/>
<assert:assertFileExists file="${maven.docs.dest}/checkstyle/error.html"/>
<assert:assertFileExists file="${maven.docs.dest}/checkstyle/warning.html"/>
<assert:assertFileExists file="${maven.docs.dest}/checkstyle/info.html"/>
</goal> </goal>
</project> </project>

View File

@ -26,6 +26,8 @@
</properties> </properties>
<body> <body>
<release version="3.0-SNAPSHOT" date="in SVN"> <release version="3.0-SNAPSHOT" date="in SVN">
<action dev="carlos" type="add">Added new summary report as front page.</action>
<action dev="carlos" type="update">Moved reports under the checkstyle folder and renamed.</action>
<action dev="carlos" type="update">Added maven.checkstyle.dir and move output files there.</action> <action dev="carlos" type="update">Added maven.checkstyle.dir and move output files there.</action>
<action dev="carlos" type="add">Added properties maven.checkstyle.output.xml and maven.checkstyle.output.txt</action> <action dev="carlos" type="add">Added properties maven.checkstyle.output.xml and maven.checkstyle.output.txt</action>
<action dev="aheritier" type="update">It requires at least maven-plugin-plugin v1.7.</action> <action dev="aheritier" type="update">It requires at least maven-plugin-plugin v1.7.</action>