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 committed 2003-11-24 20:31:38 +00:00
1 parent c7819a19fc
commit ad9c35364d
5 files changed
+85 -13

No files matched your search

@@ -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">
+18 -2
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>