vmassol 2003/11/24 12:31:38
Modified: dashboard/xdocs changes.xml properties.xml
dashboard/src/plugin-resources/templates dashboard.jsl
dashboard/src/plugin-test maven.xml
dashboard plugin.properties
Log:
Added new <code>maven.dashboard.report.showempty</code> property. If set to false,
the HTML report table will not contain entries for projects for which no aggregator
data was retrieved. Asked by dIon.
Revision Changes Path
1.8 +5 -0 maven-plugins/dashboard/xdocs/changes.xml
Index: changes.xml
===================================================================
RCS file: /home/cvs/maven-plugins/dashboard/xdocs/changes.xml,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- changes.xml 20 Nov 2003 10:25:56 -0000 1.7
+++ changes.xml 24 Nov 2003 20:31:38 -0000 1.8
@@ -8,6 +8,11 @@
<body>
<release version="1.2" date="in CVS">
+ <action dev="vmassol" type="add">
+ Added new <code>maven.dashboard.report.showempty</code> property. If
+ set to false, the HTML report table will not contain entries for
+ projects for which no aggregator data was retrieved.
+ </action>
</release>
<release version="1.1" date="2003-11-20">
1.3 +41 -7 maven-plugins/dashboard/xdocs/properties.xml
Index: properties.xml
===================================================================
RCS file: /home/cvs/maven-plugins/dashboard/xdocs/properties.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- properties.xml 5 Nov 2003 19:26:59 -0000 1.2
+++ properties.xml 24 Nov 2003 20:31:38 -0000 1.3
@@ -13,7 +13,7 @@
maven.dashboard.basedir=${basedir}
maven.dashboard.includes=*/project.xml
-maven.dashboard.excludes=**/target/**/project.xml,project.xml
+maven.dashboard.excludes=**/target/**/project.xml
maven.dashboard.ignoreFailures=false
# Generated dashboard xml data file
@@ -35,6 +35,10 @@
# (otherwise the reactor will be run again on your child projects).
maven.dashboard.runreactor = true
+# If true, do not show projects for which gathered data is empty for all
+# aggregators.
+maven.dashboard.report.showempty = true
+
# Properties for gathering dashboard data for a single project
# ------------------------------------------------------------
@@ -42,13 +46,43 @@
maven.dashboard.aggregators.dir = ${plugin.resources}/reports
# Comma-separated list of aggregators to use
-maven.dashboard.aggregators = checkstyle
+maven.dashboard.aggregators = cserrors,cswarnings,clovertpc,cloverloc,cloverncloc
-# Properties for the default checkstyle aggregator
-maven.dashboard.aggregator.checkstyle.script =
${maven.dashboard.aggregators.dir}/checkstyle.jelly
-maven.dashboard.aggregator.checkstyle.artifact =
${maven.build.dir}/checkstyle-raw-report.xml
-maven.dashboard.aggregator.checkstyle.label = Checkstyle errors
-maven.dashboard.aggregator.checkstyle.goal = checkstyle
+# Properties for the Checkstyle error/warning aggregator (all errors/warnings)
+maven.dashboard.aggregator.csall.script =
${maven.dashboard.aggregators.dir}/csall.jelly
+maven.dashboard.aggregator.csall.artifact =
${maven.build.dir}/checkstyle-raw-report.xml
+maven.dashboard.aggregator.csall.label = CS err/warn
+maven.dashboard.aggregator.csall.goal = checkstyle
+
+# Properties for the Checkstyle error aggregator (only errors)
+maven.dashboard.aggregator.cserrors.script =
${maven.dashboard.aggregators.dir}/cserrors.jelly
+maven.dashboard.aggregator.cserrors.artifact =
${maven.build.dir}/checkstyle-raw-report.xml
+maven.dashboard.aggregator.cserrors.label = CS errors
+maven.dashboard.aggregator.cserrors.goal = checkstyle
+
+# Properties for the Checkstyle warning aggregator (only warnings)
+maven.dashboard.aggregator.cswarnings.script =
${maven.dashboard.aggregators.dir}/cswarnings.jelly
+maven.dashboard.aggregator.cswarnings.artifact =
${maven.build.dir}/checkstyle-raw-report.xml
+maven.dashboard.aggregator.cswarnings.label = CS warnings
+maven.dashboard.aggregator.cswarnings.goal = checkstyle
+
+# Properties for the Clover TPC aggregator (TPC = Total Percent Coverage)
+maven.dashboard.aggregator.clovertpc.script =
${maven.dashboard.aggregators.dir}/clovertpc.jelly
+maven.dashboard.aggregator.clovertpc.artifact = ${maven.build.dir}/clover.xml
+maven.dashboard.aggregator.clovertpc.label = Clover TPC
+maven.dashboard.aggregator.clovertpc.goal = clover
+
+# Properties for the Clover LOC aggregator (LOC = Line Of Code)
+maven.dashboard.aggregator.cloverloc.script =
${maven.dashboard.aggregators.dir}/cloverloc.jelly
+maven.dashboard.aggregator.cloverloc.artifact = ${maven.build.dir}/clover.xml
+maven.dashboard.aggregator.cloverloc.label = Clover LOC
+maven.dashboard.aggregator.cloverloc.goal = clover
+
+# Properties for the Clover NCLOC aggregator (NCLOC = Non Comment Line Of Code)
+maven.dashboard.aggregator.cloverncloc.script =
${maven.dashboard.aggregators.dir}/cloverncloc.jelly
+maven.dashboard.aggregator.cloverncloc.artifact = ${maven.build.dir}/clover.xml
+maven.dashboard.aggregator.cloverncloc.label = Clover NCLOC
+maven.dashboard.aggregator.cloverncloc.goal = clover
# Generated dashboard data for a single project
maven.dashboard.report.single = ${maven.build.dir}/dashboard-single.xml
1.4 +17 -4
maven-plugins/dashboard/src/plugin-resources/templates/dashboard.jsl
Index: dashboard.jsl
===================================================================
RCS file:
/home/cvs/maven-plugins/dashboard/src/plugin-resources/templates/dashboard.jsl,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- dashboard.jsl 10 Nov 2003 15:55:48 -0000 1.3
+++ dashboard.jsl 24 Nov 2003 20:31:38 -0000 1.4
@@ -33,10 +33,23 @@
</jsl:template>
<jsl:template match="project">
- <tr>
- <td><x:expr select="@name"/></td>
- <jsl:applyTemplates select="aggregator"/>
- </tr>
+
+ <!-- Decide whether to display project data -->
+ <j:set var="shallDisplay" value="true"/>
+ <j:if test="${context.getVariable('maven.dashboard.report.showempty') ==
'false'}">
+ <x:set var="notEmptyElems" select="aggregator[not(text() = '-')]"/>
+ <j:if test="${notEmptyElems.isEmpty() == 'true'}">
+ <j:set var="shallDisplay" value="false"/>
+ </j:if>
+ </j:if>
+
+ <j:if test="${shallDisplay == 'true'}">
+ <tr>
+ <td><x:expr select="@name"/></td>
+ <jsl:applyTemplates select="aggregator"/>
+ </tr>
+ </j:if>
+
</jsl:template>
<jsl:template match="aggregator">
1.3 +18 -2 maven-plugins/dashboard/src/plugin-test/maven.xml
Index: maven.xml
===================================================================
RCS file: /home/cvs/maven-plugins/dashboard/src/plugin-test/maven.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- maven.xml 17 Nov 2003 22:02:49 -0000 1.2
+++ maven.xml 24 Nov 2003 20:31:38 -0000 1.3
@@ -4,19 +4,35 @@
xmlns:ant="jelly:ant"
xmlns:x="jelly:xml"
xmlns:assert="assert">
-
+
<goal name="testPlugin">
+ <attainGoal name="fixture"/>
+ <attainGoal name="testReportOk"/>
+ </goal>
+
+ <goal name="fixture">
- <!-- Fixture -->
+ <!-- Setup -->
<j:set var="goal" value="clean"/>
<attainGoal name="multiproject:goal"/>
<!-- Call goal to test -->
<attainGoal name="site"/>
+ </goal>
+
+ <goal name="testReportOk">
+
<!-- Verifications -->
<assert:assertFileExists file="${maven.docs.dest}/dashboard-report.html"/>
<assert:assertFileExists file="${maven.gen.docs}/dashboard-report.xml"/>
+
+ <util:file var="dashboardAsFile"
+ name="${maven.gen.docs}/dashboard-report.xml"/>
+ <x:parse var="doc" xml="${dashboardAsFile}"/>
+
+ <x:set var="count" select="count($doc//table//tr)"/>
+ <assert:assertEquals expected="4" value="${count.intValue().toString()}"/>
</goal>
1.4 +4 -0 maven-plugins/dashboard/plugin.properties
Index: plugin.properties
===================================================================
RCS file: /home/cvs/maven-plugins/dashboard/plugin.properties,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- plugin.properties 14 Nov 2003 22:34:09 -0000 1.3
+++ plugin.properties 24 Nov 2003 20:31:38 -0000 1.4
@@ -32,6 +32,10 @@
# (otherwise the reactor will be run again on your child projects).
maven.dashboard.runreactor = true
+# If true, do not show projects for which gathered data is empty for all
+# aggregators.
+maven.dashboard.report.showempty = true
+
# Properties for gathering dashboard data for a single project
# ------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]