Issue Details (XML | Word | Printable)

Key: MPCLOVER-31
Type: New Feature New Feature
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Vincent Massol
Reporter: Vincent Massol
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Maven 1.x Clover Plugin

Add PDF report support

Created: 24/Feb/05 07:18 AM   Updated: 05/Apr/05 03:54 AM   Resolved: 04/Apr/05 01:33 PM
Return to search
Component/s: None
Affects Version/s: 1.7
Fix Version/s: 1.9

Time Tracking:
Not Specified


Olivier Jacob added a comment - 04/Apr/05 08:42 AM

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


Vincent Massol added a comment - 04/Apr/05 01:33 PM

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 ). I've also updated the properties.xml and changes.xml files.


Vincent Massol made changes - 04/Apr/05 01:33 PM
Field Original Value New Value
Fix Version/s 1.9 [ 11530 ]
Assignee Vincent Massol [ vmassol ]
Resolution Fixed [ 1 ]
Status Open [ 1 ] Closed [ 6 ]
Olivier Jacob added a comment - 05/Apr/05 03:54 AM

Yes I ran into a problem too, but could not find a fix immediatly :\