MPCLOVER-31: Added PDF report generation
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@160064 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ae97aec17b
commit
5386f83f07
@ -19,13 +19,13 @@
|
||||
-->
|
||||
|
||||
<project
|
||||
xmlns:j="jelly:core"
|
||||
xmlns:ant="jelly:ant"
|
||||
xmlns:maven="jelly:maven"
|
||||
xmlns:java="java"
|
||||
xmlns:test="test"
|
||||
xmlns:doc="doc"
|
||||
xmlns:u="jelly:util">
|
||||
xmlns:j="jelly:core"
|
||||
xmlns:ant="jelly:ant"
|
||||
xmlns:maven="jelly:maven"
|
||||
xmlns:java="java"
|
||||
xmlns:test="test"
|
||||
xmlns:doc="doc"
|
||||
xmlns:u="jelly:util">
|
||||
|
||||
<!--
|
||||
========================================================================
|
||||
@ -275,7 +275,10 @@
|
||||
<j:if test="${context.getVariable('maven.clover.report.swing') == 'true'}">
|
||||
<attainGoal name="clover:swing-report-internal"/>
|
||||
</j:if>
|
||||
|
||||
<j:if test="${context.getVariable('maven.clover.report.pdf') == 'true'}">
|
||||
<attainGoal name="clover:pdf-report-internal"/>
|
||||
</j:if>
|
||||
|
||||
</j:when>
|
||||
<j:otherwise>
|
||||
<ant:echo>No Clover database found, skipping report generation</ant:echo>
|
||||
@ -292,7 +295,7 @@
|
||||
<goal name="clover:xml-report-internal">
|
||||
<ant:clover-report>
|
||||
<ant:current outfile="${maven.build.dir}/clover.xml"
|
||||
title="${pom.name} - ${pom.currentVersion}">
|
||||
title="${pom.name} - ${pom.currentVersion}">
|
||||
<ant:format type="xml" orderBy="${maven.clover.orderBy}">
|
||||
|
||||
<!-- Add context filtering -->
|
||||
@ -305,10 +308,9 @@
|
||||
</ant:current>
|
||||
</ant:clover-report>
|
||||
</goal>
|
||||
<goal
|
||||
name="clover:xml-report"
|
||||
description="Generate XML test coverage reports with Clover"
|
||||
prereqs="clover:test,clover:xml-report-internal"/>
|
||||
<goal name="clover:xml-report"
|
||||
description="Generate XML test coverage reports with Clover"
|
||||
prereqs="clover:test,clover:xml-report-internal"/>
|
||||
|
||||
<!--
|
||||
========================================================================
|
||||
@ -323,8 +325,8 @@
|
||||
<ant:clover-report>
|
||||
|
||||
<ant:current
|
||||
outfile="${cloverReportDirectory}"
|
||||
title="${pom.name} - ${pom.currentVersion}">
|
||||
outfile="${cloverReportDirectory}"
|
||||
title="${pom.name} - ${pom.currentVersion}">
|
||||
<ant:format type="html" orderBy="${maven.clover.orderBy}">
|
||||
|
||||
<!-- Add context filtering -->
|
||||
@ -343,8 +345,8 @@
|
||||
<ant:mkdir dir="${cloverHistoryReportDirectory}"/>
|
||||
|
||||
<ant:historical outfile="${cloverHistoryReportDirectory}"
|
||||
historyDir="${maven.clover.history.dir}"
|
||||
title="${pom.name} - ${pom.currentVersion} - History">
|
||||
historyDir="${maven.clover.history.dir}"
|
||||
title="${pom.name} - ${pom.currentVersion} - History">
|
||||
<ant:format type="html"/>
|
||||
</ant:historical>
|
||||
|
||||
@ -353,10 +355,9 @@
|
||||
</ant:clover-report>
|
||||
|
||||
</goal>
|
||||
<goal
|
||||
name="clover:html-report"
|
||||
description="Generate HTML test coverage reports with Clover"
|
||||
prereqs="clover:test,clover:html-report-internal"/>
|
||||
<goal name="clover:html-report"
|
||||
description="Generate HTML test coverage reports with Clover"
|
||||
prereqs="clover:test,clover:html-report-internal"/>
|
||||
|
||||
<!--
|
||||
========================================================================
|
||||
@ -366,10 +367,56 @@
|
||||
<goal name="clover:swing-report-internal">
|
||||
<ant:clover-view initString="${clover.initstring}"/>
|
||||
</goal>
|
||||
<goal
|
||||
name="clover:swing-report"
|
||||
description="Generate Swing test coverage reports with Clover"
|
||||
prereqs="clover:test,clover:swing-report-internal"/>
|
||||
<goal name="clover:swing-report"
|
||||
description="Generate Swing test coverage reports with Clover"
|
||||
prereqs="clover:test,clover:swing-report-internal"/>
|
||||
|
||||
<!--
|
||||
========================================================================
|
||||
Generate PDF test coverage report.
|
||||
========================================================================
|
||||
-->
|
||||
<goal name="clover:pdf-report-internal">
|
||||
|
||||
<j:set var="cloverReportDirectory" value="${maven.docs.dest}/clover"/>
|
||||
<j:set var="cloverPDFReportFile" value="${cloverReportDirectory}/clover.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="cloverPDFHistoryReportFile" value="${cloverHistoryReportDirectory}/clover-history.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"/>
|
||||
|
||||
<!--
|
||||
========================================================================
|
||||
|
||||
@ -50,6 +50,7 @@ maven.clover.license.path = ${plugin.resources}/clover.license
|
||||
maven.clover.report.html = true
|
||||
maven.clover.report.xml = false
|
||||
maven.clover.report.swing = false
|
||||
maven.clover.report.pdf = false
|
||||
|
||||
# Decide whether to execute generate Clover data during the site report
|
||||
# generation or not. If false, the plugin will only generate Clover reports
|
||||
|
||||
@ -34,6 +34,7 @@
|
||||
|
||||
<!-- Verifications -->
|
||||
<assert:assertFileExists file="${maven.docs.dest}/clover/history/historical.html"/>
|
||||
<assert:assertFileExists file="${maven.docs.dest}/clover/history/clover-history.pdf"/>
|
||||
|
||||
</goal>
|
||||
|
||||
|
||||
@ -13,3 +13,6 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
# -------------------------------------------------------------------
|
||||
|
||||
# Also generate PDF history reports
|
||||
maven.clover.report.pdf = true
|
||||
|
||||
@ -43,11 +43,12 @@
|
||||
<!-- Verifications -->
|
||||
<assert:assertFileExists file="${maven.docs.dest}/clover/index.html"/>
|
||||
|
||||
<!-- Call report which will generate both the HTML and XML reports -->
|
||||
<!-- Call report which will generate the HTML, XML and PDF reports -->
|
||||
<attainGoal name="clover"/>
|
||||
|
||||
<!-- Verifications -->
|
||||
<assert:assertFileExists file="${maven.build.dir}/clover.xml"/>
|
||||
<assert:assertFileExists file="${maven.docs.dest}/clover/clover.pdf"/>
|
||||
|
||||
</goal>
|
||||
|
||||
@ -15,4 +15,6 @@
|
||||
# -------------------------------------------------------------------
|
||||
|
||||
maven.clover.report.xml = true
|
||||
maven.clover.report.pdf = true
|
||||
|
||||
maven.clover.instrument.tests = true
|
||||
@ -20,8 +20,8 @@
|
||||
|
||||
<project>
|
||||
<extend>${basedir}/../project.xml</extend>
|
||||
<id>testSiteReportAndXmlReportGeneration</id>
|
||||
<name>testSiteReportAndXmlReportGeneration</name>
|
||||
<id>testSiteReportAndGenerationOfDifferentFormats</id>
|
||||
<name>testSiteReportAndGenerationOfDifferentFormats</name>
|
||||
<build>
|
||||
<sourceDirectory>src/main</sourceDirectory>
|
||||
<unitTestSourceDirectory>src/test</unitTestSourceDirectory>
|
||||
@ -26,6 +26,9 @@
|
||||
</properties>
|
||||
<body>
|
||||
<release version="1.9-SNAPSHOT" date="in SVN">
|
||||
<action dev="vmassol" type="add" issue="MPCLOVER-31" due-to="Olivier Jacob">
|
||||
Added PDF report generation.
|
||||
</action>
|
||||
</release>
|
||||
<release version="1.8" date="2005-03-04">
|
||||
<action dev="vmassol" type="add">Added support for historical reports by adding a new
|
||||
|
||||
@ -86,6 +86,16 @@
|
||||
<code>false</code>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>maven.clover.report.pdf</td>
|
||||
<td>Yes</td>
|
||||
<td>
|
||||
Decides whether a PDF report will be generated.
|
||||
</td>
|
||||
<td>
|
||||
<code>false</code>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>maven.clover.database</td>
|
||||
<td>Yes</td>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user