|
|
|
|
@@ -4,35 +4,28 @@
|
|
|
|
|
xmlns:j="jelly:core"
|
|
|
|
|
xmlns:ant="jelly:ant"
|
|
|
|
|
xmlns:maven="jelly:maven"
|
|
|
|
|
xmlns:java="java"
|
|
|
|
|
xmlns:test="test"
|
|
|
|
|
xmlns:doc="doc">
|
|
|
|
|
|
|
|
|
|
<!--
|
|
|
|
|
|
|
|
|
|
|
| This last namespace entry is not obvious so here's a little
|
|
|
|
|
| explanation. For anything documentation related we don't want to have to
|
|
|
|
|
| duplicated documentation properties like ${maven.dest.docs} in every
|
|
|
|
|
| single plugin. So we use the following to access the properties of the
|
|
|
|
|
| xdoc plugin:
|
|
|
|
|
|
|
|
|
|
|
| ${pom.getPluginContext('maven-xdoc-plugin').getVariable('maven.docs.dest')}
|
|
|
|
|
|
|
|
|
|
|
| But this of course only works if the xdoc plugin is loaded ... So we
|
|
|
|
|
| trick the xdoc plugin into loading by declaring the xmlns:doc usage
|
|
|
|
|
| above. This forces the lookup and loading of the xdoc plugin which
|
|
|
|
|
| loads the properties. This is not entirely clear but works and I'll
|
|
|
|
|
| find a better way to declare this.
|
|
|
|
|
|
|
|
|
|
|
-->
|
|
|
|
|
|
|
|
|
|
<java:dependency-handle/>
|
|
|
|
|
<j:set var="javaPlugin" value="${pom.getPluginContext('maven-java-plugin')}"/>
|
|
|
|
|
|
|
|
|
|
<test:dependency-handle/>
|
|
|
|
|
<j:set var="testPlugin" value="${pom.getPluginContext('maven-test-plugin')}"/>
|
|
|
|
|
|
|
|
|
|
<!--ant:echo>Java Plugin: ${javaPlugin}</ant:echo>
|
|
|
|
|
<ant:echo>Test Plugin: ${testPlugin}</ant:echo-->
|
|
|
|
|
|
|
|
|
|
<ant:path id="clover.classpath">
|
|
|
|
|
<ant:pathelement path="${plugin.getDependencyPath('clover')}"/>
|
|
|
|
|
</ant:path>
|
|
|
|
|
|
|
|
|
|
<j:set var="tmp.clover.excludes">
|
|
|
|
|
<!--j:set var="tmp.clover.excludes">
|
|
|
|
|
<j:forEach var="pat" items="${pom.build.unitTest.includes}"> ${pat} </j:forEach>
|
|
|
|
|
</j:set>
|
|
|
|
|
|
|
|
|
|
<ant:property name="clover.excludes" value="${tmp.clover.excludes}"/>
|
|
|
|
|
<ant:property name="clover.excludes" value="${tmp.clover.excludes}"/-->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<goal name="maven-clover-plugin:register">
|
|
|
|
|
@@ -58,36 +51,44 @@
|
|
|
|
|
|
|
|
|
|
<goal
|
|
|
|
|
name="clover:on"
|
|
|
|
|
description="Create the needed directory structure"
|
|
|
|
|
trim="true">
|
|
|
|
|
|
|
|
|
|
description="Create the needed directory structure">
|
|
|
|
|
|
|
|
|
|
<ant:taskdef resource="clovertasks"/>
|
|
|
|
|
<ant:typedef resource="clovertypes"/>
|
|
|
|
|
|
|
|
|
|
<preGoal name="java:compile">
|
|
|
|
|
${pom.getContext().setVariable('build.compiler',"org.apache.tools.ant.taskdefs.CloverCompilerAdapter")}
|
|
|
|
|
<echo>Setting Clover compiler</echo>
|
|
|
|
|
<ant:clover-setup
|
|
|
|
|
initstring="${maven.clover.database.dir}/clover_coverage.db"
|
|
|
|
|
flushpolicy="interval"
|
|
|
|
|
flushinterval="500"
|
|
|
|
|
/>
|
|
|
|
|
<echo>Now using primary build.compiler : ${build.compiler}</echo>
|
|
|
|
|
<!--${pom.getContext().setVariable('build.compiler',"org.apache.tools.ant.taskdefs.CloverCompilerAdapter")}-->
|
|
|
|
|
</preGoal>
|
|
|
|
|
|
|
|
|
|
<postGoal name="java:compile">
|
|
|
|
|
${pom.getContext().removeVariable('build.compiler')}
|
|
|
|
|
</postGoal>
|
|
|
|
|
|
|
|
|
|
<ant:property
|
|
|
|
|
name="clover.initstring"
|
|
|
|
|
value="${maven.clover.database.dir}/clover_coverage.db"/>
|
|
|
|
|
|
|
|
|
|
<j:set
|
|
|
|
|
var="cloverReportDirectory"
|
|
|
|
|
value="${pom.getPluginContext('maven-xdoc-plugin').getVariable('maven.docs.dest')}/clover"/>
|
|
|
|
|
<clover-setup initstring="${maven.clover.database.dir}/clover_coverage.db"/>
|
|
|
|
|
|
|
|
|
|
<j:set
|
|
|
|
|
var="cloverReportDirectory"
|
|
|
|
|
value="${pom.getPluginContext('maven-xdoc-plugin').getVariable('maven.docs.dest')}/clover"/>
|
|
|
|
|
|
|
|
|
|
<maven:addPath id="maven.dependency.classpath" refid="clover.classpath"/>
|
|
|
|
|
|
|
|
|
|
<ant:mkdir dir="${maven.build.clover}"/>
|
|
|
|
|
<ant:mkdir dir="${maven.build.clover.classes}"/>
|
|
|
|
|
<ant:mkdir dir="${maven.clover.database.dir}"/>
|
|
|
|
|
|
|
|
|
|
<j:set var="tmp" value="${maven.build.clover.classes}"/>
|
|
|
|
|
|
|
|
|
|
${pom.getPluginContext('maven-java-plugin').setVariable('maven.build.dest',tmp)}
|
|
|
|
|
${pom.getPluginContext('maven-test-plugin').setVariable('maven.build.dest',tmp)}
|
|
|
|
|
<ant:mkdir dir="${cloverReportDirectory}"/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<j:set var="tmp" value="${maven.build.clover.classes}"/>
|
|
|
|
|
${pom.getPluginContext('maven-java-plugin').setVariable('maven.build.dest',tmp)}
|
|
|
|
|
<!--echo>Found maven-test-plugin: ${pom.getPluginContext('maven-test-plugin')}</echo-->
|
|
|
|
|
${pom.getPluginContext('maven-test-plugin').setVariable('maven.build.dest',tmp)}
|
|
|
|
|
</goal>
|
|
|
|
|
|
|
|
|
|
<!-- =================================================================== -->
|
|
|
|
|
@@ -98,43 +99,37 @@
|
|
|
|
|
description="Generate HTML test coverage reports with Clover"
|
|
|
|
|
prereqs="clover:html-report"/>
|
|
|
|
|
|
|
|
|
|
<goal
|
|
|
|
|
name="clover:html-report"
|
|
|
|
|
description="Generate HTML test coverage reports with Clover">
|
|
|
|
|
|
|
|
|
|
<!-- Make sure that the report is generated whether the tests pass or
|
|
|
|
|
not -->
|
|
|
|
|
<goal name="clover:test" prereqs="clover:on">
|
|
|
|
|
<!-- Make sure that the report is generated whether the tests pass or not -->
|
|
|
|
|
<j:set var="ignoreTestFailureOld" value="${maven.test.failure.ignore}"/>
|
|
|
|
|
<j:set var="junitForkOld" value="${maven.junit.fork}"/>
|
|
|
|
|
|
|
|
|
|
<j:set var="maven.test.failure.ignore" scope="parent" value="true"/>
|
|
|
|
|
<attainGoal name="clover:on"/>
|
|
|
|
|
<j:set var="maven.junit.fork" scope="parent" value="true"/>
|
|
|
|
|
|
|
|
|
|
<attainGoal name="test:test"/>
|
|
|
|
|
<j:set var="maven.test.failure.ignore" scope="parent"
|
|
|
|
|
value="${ignoreTestFailureOld}"/>
|
|
|
|
|
|
|
|
|
|
<j:set var="maven.test.failure.ignore" scope="parent" value="${ignoreTestFailureOld}"/>
|
|
|
|
|
<j:set var="maven.junit.fork" scope="parent" value="${junitForkOld}"/>
|
|
|
|
|
</goal>
|
|
|
|
|
|
|
|
|
|
<!--
|
|
|
|
|
|
|
|
|
|
|
| Grab the value maven.docs.dest from the xdoc plugin.
|
|
|
|
|
|
|
|
|
|
|
-->
|
|
|
|
|
<ant:mkdir dir="${cloverReportDirectory}"/>
|
|
|
|
|
|
|
|
|
|
<ant:java classname="com.cortexeb.tools.clover.reporters.html.HtmlReporter"
|
|
|
|
|
fork="true">
|
|
|
|
|
<ant:arg line="-o ${cloverReportDirectory}"/>
|
|
|
|
|
<ant:arg line="-i ${clover.initstring}"/>
|
|
|
|
|
<ant:arg line="-t '${pom.name} - ${pom.currentVersion}'"/>
|
|
|
|
|
<ant:classpath>
|
|
|
|
|
<ant:path refid="maven-classpath"/>
|
|
|
|
|
<ant:pathelement path="${plugin.getDependencyPath('velocity')}"/>
|
|
|
|
|
<ant:pathelement path="${plugin.getDependencyPath('clover')}"/>
|
|
|
|
|
</ant:classpath>
|
|
|
|
|
</ant:java>
|
|
|
|
|
|
|
|
|
|
<goal
|
|
|
|
|
name="clover:html-report"
|
|
|
|
|
description="Generate HTML test coverage reports with Clover">
|
|
|
|
|
<attainGoal name="clover:test"/>
|
|
|
|
|
<ant:clover-report>
|
|
|
|
|
<current
|
|
|
|
|
outfile="${cloverReportDirectory}"
|
|
|
|
|
title="${pom.name} - ${pom.currentVersion}">
|
|
|
|
|
<format type="html" orderBy="ElementsCoveredAsc"/>
|
|
|
|
|
</current>
|
|
|
|
|
</ant:clover-report>
|
|
|
|
|
</goal>
|
|
|
|
|
|
|
|
|
|
<goal
|
|
|
|
|
name="clover:swing-report"
|
|
|
|
|
prereqs="clover:on,test:test"
|
|
|
|
|
prereqs="clover:test"
|
|
|
|
|
description="Generate Swing test coverage reports with Clover">
|
|
|
|
|
|
|
|
|
|
<ant:mkdir dir="${cloverReportDirectory}"/>
|
|
|
|
|
@@ -144,7 +139,6 @@
|
|
|
|
|
<ant:arg line="${clover.initstring}"/>
|
|
|
|
|
<ant:classpath>
|
|
|
|
|
<ant:path refid="maven-classpath"/>
|
|
|
|
|
<ant:pathelement path="${plugin.getDependencyPath('velocity')}"/>
|
|
|
|
|
<ant:pathelement path="${plugin.getDependencyPath('clover')}"/>
|
|
|
|
|
</ant:classpath>
|
|
|
|
|
</ant:java>
|
|
|
|
|
|