From: Carlos S. <car...@us...> - 2005-07-14 05:12:35
|
carlossg 05/07/13 22:12:29 Modified: cobertura plugin.jelly Added: cobertura/src/plugin-resources check.jsl Log: Create check report from xml instead of text Revision Changes Path 1.10 +9 -7 maven-plugins/cobertura/plugin.jelly Index: plugin.jelly =================================================================== RCS file: /cvsroot/maven-plugins/maven-plugins/cobertura/plugin.jelly,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- plugin.jelly 12 Jul 2005 23:28:10 -0000 1.9 +++ plugin.jelly 14 Jul 2005 05:12:28 -0000 1.10 @@ -215,18 +215,20 @@ <!-- ======================================================================== - Make a xdoc report from the text report + Create a xdoc report with classes not meeting the test coverage requirements ======================================================================== --> - <goal name="cobertura:check-report" prereqs="cobertura:check-report-text" + <goal name="cobertura:check-report" description="Create a xdoc report with classes not meeting the test coverage requirements"> <mkdir dir="${maven.gen.docs}/cobertura"/> - <doc:text-xdoc - title="Cobertura Check Report" - section="Cobertura Report" - inputText="${checkFailedLines}" - output="${maven.gen.docs}/cobertura/cobertura-check.xml"/> + <doc:jsl + input="${coberturaDocs}/coverage.xml" + output="cobertura/cobertura-check.xml" + stylesheet="${plugin.resources}/check.jsl" + encoding="${maven.docs.outputencoding}" + outputMode="xml" + prettyPrint="true"/> </goal> 1.1 maven-plugins/cobertura/src/plugin-resources/check.jsl Index: check.jsl =================================================================== <?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:doc="doc" xmlns:u="jelly:util" xmlns:ant="jelly:ant" xmlns="dummy" trim="false"> <jsl:template match="coverage"> <document> <head> <title>Cobertura check results</title> <style type="text/css"> .normal { } .failed { color: red; } </style> </head> <body> <table> <tr> <th>Class</th> <th>Line rate</th> <th>Branch rate</th> </tr> <jsl:applyTemplates select="//class"/> </table> </body> </document> </jsl:template> <jsl:template match="class" trim="false"> <j:set var="lineRate"><x:expr select="@line-rate"/></j:set> <j:set var="branchRate"><x:expr select="@branch-rate"/></j:set> <j:set var="lineRateFails" value="${(lineRate*100) lt maven.cobertura.check.line}"/> <j:set var="branchRateFails" value="${(branchRate*100) lt maven.cobertura.check.branch}"/> <j:set var="lineClass" value="normal"/> <j:set var="branchClass" value="normal"/> <j:if test="${lineRateFails}"><j:set var="lineClass" value="failed"/></j:if> <j:if test="${branchRateFails}"><j:set var="branchClass" value="failed"/></j:if> <j:choose> <j:when test="${lineRateFails or branchRateFails}"> <tr> <j:set var="name"><x:expr select="@name"/></j:set> <td><a href="${name}.html"><x:expr select="@name"/></a></td> <td class="${lineClass}"> <doc:formatAsNumber string="${lineRate}" pattern="0.00%"/> </td> <td class="${branchClass}"> <doc:formatAsNumber string="${branchRate}" pattern="0.00%"/> </td> </tr> </j:when> <j:otherwise> </j:otherwise> </j:choose> </jsl:template> <jsl:template match="*"> <jsl:copy trim="false"> <jsl:applyTemplates trim="false"/> </jsl:copy> </jsl:template> <!-- element values don't pass through as text --> <jsl:template match="@*"/> <!-- CDATA and text nodes pass-thru --> <jsl:template match="text()"> <x:expr select="."/> </jsl:template> </jsl:stylesheet> |
From: Carlos S. <car...@us...> - 2005-07-14 20:43:17
|
carlossg 05/07/14 13:42:37 Modified: cobertura/src/plugin-resources check.jsl Log: Added section Revision Changes Path 1.2 +12 -11 maven-plugins/cobertura/src/plugin-resources/check.jsl Index: check.jsl =================================================================== RCS file: /cvsroot/maven-plugins/maven-plugins/cobertura/src/plugin-resources/check.jsl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- check.jsl 14 Jul 2005 05:12:29 -0000 1.1 +++ check.jsl 14 Jul 2005 20:42:37 -0000 1.2 @@ -32,22 +32,23 @@ <jsl:template match="coverage"> <document> - <head> + <properties> <title>Cobertura check results</title> + </properties> <style type="text/css"> .normal { } .failed { color: red; } </style> - </head> - <body> - <table> - <tr> - <th>Class</th> - <th>Line rate</th> - <th>Branch rate</th> - </tr> - <jsl:applyTemplates select="//class"/> - </table> + <section name="Classes that don't meet code coverage requirements"> + <table> + <tr> + <th>Class</th> + <th>Line rate</th> + <th>Branch rate</th> + </tr> + <jsl:applyTemplates select="//class"/> + </table> + </section> </body> </document> </jsl:template> |
From: Carlos S. <car...@us...> - 2005-07-21 00:09:54
|
carlossg 05/07/20 17:09:43 Modified: cobertura/src/plugin-resources check.jsl Log: Fixed typo in xml Revision Changes Path 1.3 +1 -0 maven-plugins/cobertura/src/plugin-resources/check.jsl Index: check.jsl =================================================================== RCS file: /cvsroot/maven-plugins/maven-plugins/cobertura/src/plugin-resources/check.jsl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- check.jsl 14 Jul 2005 20:42:37 -0000 1.2 +++ check.jsl 21 Jul 2005 00:09:41 -0000 1.3 @@ -35,6 +35,7 @@ <properties> <title>Cobertura check results</title> </properties> + <body> <style type="text/css"> .normal { } .failed { color: red; } |