|
Thanks Olivier! I've added the missing tests and fixed a few things (Good that I tested it as there were some errors in the historical PDF report
Vincent Massol made changes - 04/Apr/05 01:33 PM
Yes I ran into a problem too, but could not find a fix immediatly :\ |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
Here is a proposition for this feature :
<goal name="clover:report" prereqs="clover:init" description="Generates the Clover reports">
<!-- Skip reports if no coverage database has been created. -->
<u:file var="cloverDatabaseAsFile" name="${maven.clover.database}"/>
<j:choose>
<j:when test="${cloverDatabaseAsFile.exists()}">
[...]
<j:if test="${context.getVariable('maven.clover.report.pdf') == 'true'}">
<attainGoal name="clover:pdf-report-internal"/>
</j:if>
</j:when>
[...]
</j:choose>
</goal>
<!--
========================================================================
Generate PDF test coverage
========================================================================
-->
<goal name="clover:pdf-report-internal">
<j:set var="cloverReportDirectory" value="${maven.docs.dest}/clover"/>
<j:set var="cloverPDFReportFile" value="${cloverReportDirectory}/clover-report.pdf"/>
<ant:mkdir dir="${cloverReportDirectory}"/>
<ant:clover-report>
<ant:current outfile="${cloverPDFReportFile}" title="${pom.name} - ${pom.currentVersion}" summary="true">
<ant:format type="pdf" orderBy="${maven.clover.orderBy}">
<!-- Add context filtering -->
<j:set var="contextFilters" value="${maven.clover.context.method.names} ${maven.clover.context.statement.names} ${maven.clover.context.block.names}"/>
<j:if test="${!empty(contextFilters.trim())}">
<ant:setProperty name="filter" value="${contextFilters}"/>
</j:if>
</ant:format>
</ant:current>
<!-- Only generate history report if there is at least one history point -->
<j:if test="${historyDirAsFile.exists() and !empty(historyDirAsFile.listFiles())}">
<j:set var="cloverHistoryReportDirectory" value="${maven.docs.dest}/clover/history"/>
<j:set var="cloverPDFHistoricalReportFile" value="${cloverReportDirectory}/clover-history-report.pdf"/>
<ant:mkdir dir="${cloverHistoryReportDirectory}"/>
<ant:historical outfile="${cloverPDFHistoryReportFile}" historyDir="${maven.clover.history.dir}" title="${pom.name} - ${pom.currentVersion} - History">
<ant:format type="pdf"/>
</ant:historical>
</j:if>
</ant:clover-report>
</goal>
<goal name="clover:pdf-report" description="Generate PDF test coverage reports with Clover" prereqs="clover:test,clover:pdf-report-internal"/>
New property : maven.clover.report.pdf (true|false)
Does it fit the need ?
–
Olivier