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.

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@114400 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
vmassol 2003-11-24 20:31:38 +00:00
parent c7819a19fc
commit ad9c35364d
5 changed files with 85 additions and 13 deletions

View File

@ -32,6 +32,10 @@ maven.dashboard.template = ${plugin.resources}/templates/dashboard.jsl
# (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
# ------------------------------------------------------------

View File

@ -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">

View File

@ -4,20 +4,36 @@
xmlns:ant="jelly:ant"
xmlns:x="jelly:xml"
xmlns:assert="assert">
<goal name="testPlugin">
<attainGoal name="fixture"/>
<attainGoal name="testReportOk"/>
</goal>
<!-- Fixture -->
<goal name="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>
</project>

View File

@ -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">

View File

@ -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 @@ maven.dashboard.template = ${plugin.resources}/templates/dashboard.jsl
# (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.runreactor = true
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