You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by vm...@apache.org on 2003/12/05 15:17:22 UTC
cvs commit: maven-plugins/clover/src/plugin-test project.properties maven.xml
vmassol 2003/12/05 06:17:22
Modified: clover plugin.jelly
clover/src/plugin-test project.properties maven.xml
Log:
Now supports several compile and test directory sets.
Revision Changes Path
1.17 +23 -8 maven-plugins/clover/plugin.jelly
Index: plugin.jelly
===================================================================
RCS file: /home/cvs/maven-plugins/clover/plugin.jelly,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- plugin.jelly 4 Dec 2003 21:46:36 -0000 1.16
+++ plugin.jelly 5 Dec 2003 14:17:22 -0000 1.17
@@ -83,24 +83,39 @@
<j:set var="maven.junit.fork" scope="parent" value="true"/>
<echo>Setting Clover compiler</echo>
- <ant:property name="compileSrcSetString" refid="maven.compile.src.set"/>
- <ant:property name="compileTestSetString" refid="maven.test.compile.src.set"/>
+
+ <!-- Transforming Ant path structure into a list of dirs that can be used
+ to define an Ant fileset. We're using <pathconvert> to automatically
+ separate dirs with a known delimiter independently of any platform -->
+ <ant:pathconvert property="compileSrcSetString" pathSep="||||"
+ refid="maven.compile.src.set"/>
+ <u:tokenize var="srcDirs" delim="||||">${compileSrcSetString}</u:tokenize>
+ <ant:pathconvert property="testSrcSetString" pathSep="||||"
+ refid="maven.test.compile.src.set"/>
+ <u:tokenize var="testDirs" delim="||||">${testSrcSetString}</u:tokenize>
<ant:clover-setup
initstring="${cloverDatabase}"
flushpolicy="interval"
flushinterval="500">
- <!-- TODO: Support several paths in compileSrcSetString and compileTestSetString -->
- <ant:fileset dir="${compileSrcSetString}">
- <ant:include name="**/*.java"/>
- </ant:fileset>
- <j:if test="${context.getVariable('maven.clover.instrument.tests') == 'true'}">
- <ant:fileset dir="${compileTestSetString}">
+ <j:forEach var="srcDir" items="${srcDirs}">
+ <ant:fileset dir="${srcDir}">
<ant:include name="**/*.java"/>
</ant:fileset>
+ </j:forEach>
+
+ <!-- Conditionally instrument test code -->
+ <j:if test="${context.getVariable('maven.clover.instrument.tests') == 'true'}">
+ <j:forEach var="testDir" items="${testDirs}">
+ <ant:fileset dir="${testDir}">
+ <ant:include name="**/*.java"/>
+ </ant:fileset>
+ </j:forEach>
</j:if>
+
</ant:clover-setup>
+
<echo>Now using primary build.compiler : ${build.compiler}</echo>
<j:set var="tmp" value="${maven.build.clover.classes}"/>
1.2 +1 -0 maven-plugins/clover/src/plugin-test/project.properties
Index: project.properties
===================================================================
RCS file: /home/cvs/maven-plugins/clover/src/plugin-test/project.properties,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- project.properties 27 Nov 2003 20:19:45 -0000 1.1
+++ project.properties 5 Dec 2003 14:17:22 -0000 1.2
@@ -1 +1,2 @@
maven.clover.report.xml = true
+maven.clover.instrument.tests = true
1.2 +10 -0 maven-plugins/clover/src/plugin-test/maven.xml
Index: maven.xml
===================================================================
RCS file: /home/cvs/maven-plugins/clover/src/plugin-test/maven.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- maven.xml 27 Nov 2003 20:19:45 -0000 1.1
+++ maven.xml 5 Dec 2003 14:17:22 -0000 1.2
@@ -3,12 +3,22 @@
xmlns:j="jelly:core"
xmlns:ant="jelly:ant"
xmlns:x="jelly:xml"
+ xmlns:maven="jelly:maven"
xmlns:assert="assert">
<goal name="testPlugin">
<!-- Fixture -->
<attainGoal name="clean"/>
+
+ <!-- Make sure (to some extent) that we support multiple source and
+ test paths -->
+ <ant:mkdir dir="${maven.build.dir}/clovertestdir"/>
+ <ant:path id="test.classpath">
+ <ant:pathelement path="${maven.build.dir}/clovertestdir"/>
+ </ant:path>
+ <maven:addPath id="maven.compile.src.set" refid="test.classpath"/>
+ <maven:addPath id="maven.test.compile.src.set" refid="test.classpath"/>
<!-- Call goal to test -->
<attainGoal name="site"/>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org