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 2005/05/11 18:28:30 UTC
svn commit: r169652 - in /maven/maven-1/plugins/trunk/clover: ./
src/plugin-test/testMultiproject/
src/plugin-test/testMultiproject/subproject1/
src/plugin-test/testMultiproject/subproject1/src/
src/plugin-test/testMultiproject/subproject1/src/main/
src/plugin-test/testMultiproject/subproject1/src/main/org/
src/plugin-test/testMultiproject/subproject1/src/main/org/apache/
src/plugin-test/testMultiproject/subproject1/src/main/org/apache/maven/
src/plugin-test/testMultiproject/subproject1/src/main/org/apache/maven/clover/
src/plugin-test/testMultiproject/subproject1/src/main/org/apache/maven/clover/test/
src/plugin-test/testMultiproject/subproject1/src/test/
src/plugin-test/testMultiproject/subproject1/src/test/org/
src/plugin-test/testMultiproject/subproject1/src/test/org/apache/
src/plugin-test/testMultiproject/subproject1/src/test/org/apache/maven/
src/plugin-test/testMultiproject/subproject1/src/test/org/apache/maven/clover/
src/plugin-test/testMultiproject/subproject1/src/test/org/apache/maven/clover/test/
src/plugin-test/testMultiproject/subproject2/
src/plugin-test/testMultiproject/subproject2/src/
src/plugin-test/testMultiproject/subproject2/src/main/
src/plugin-test/testMultiproject/subproject2/src/main/org/
src/plugin-test/testMultiproject/subproject2/src/main/org/apache/
src/plugin-test/testMultiproject/subproject2/src/main/org/apache/maven/
src/plugin-test/testMultiproject/subproject2/src/main/org/apache/maven/clover/
src/plugin-test/testMultiproject/subproject2/src/main/org/apache/maven/clover/test/
src/plugin-test/testMultiproject/subproject2/src/test/
src/plugin-test/testMultiproject/subproject2/src/test/org/
src/plugin-test/testMultiproject/subproject2/src/test/org/apache/
src/plugin-test/testMultiproject/subproject2/src/test/org/apache/maven/
src/plugin-test/testMultiproject/subproject2/src/test/org/apache/maven/clover/
src/plugin-test/testMultiproject/subproject2/src/test/org/apache/maven/clover/test/
xdocs/
Author: vmassol
Date: Wed May 11 09:28:26 2005
New Revision: 169652
URL: http://svn.apache.org/viewcvs?rev=169652&view=rev
Log:
- Added a quick usage guide in the documentation.
- Fixed issue where <code>clover:report</code> was not calling <code>clover:on</code> leading to an error when generating the reports.
- Ensure that <code>clover:init</code>, <code>clover:on</code> and <code>clover:off</code> can only be called once. For example calling <code>clover:on</code> twice in a row will execute it only once.
- The <code>clover:*-report</code> goals do not call <code>clover:test</code> anymore. They only generates Clover reports. This is now aligned with the <code>clover:report</code> behavior. To run the full thing, execute the <code>clover</code> goal or add the Clover report to your project's POM.
- Added a <code>maven.clover.multiproject</code> property that should be set to true in your master project (if you're using a multiproject setup). Setting it to true will make the <code>clover</code> goal and the <code>maven-clover-plugin</code> report in your POM execute on all subprojects (they'll call the new <code>clover:multiproject</code> goal).
- New <code>clover:multiproject</code> goal to run Clover on a multiproject setup.
- New <code>clover:merge</code> goal that creates a new Clover database by merging several other databases specified using the <code>maven.clover.merge.databases</code> property (which defaults to <code>**/clover_coverage.db</code>).
Added:
maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/
maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/maven.xml
maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/project.properties
maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/project.xml
maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject1/
maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject1/project.xml
maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject1/src/
maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject1/src/main/
maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject1/src/main/org/
maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject1/src/main/org/apache/
maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject1/src/main/org/apache/maven/
maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject1/src/main/org/apache/maven/clover/
maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject1/src/main/org/apache/maven/clover/test/
maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject1/src/main/org/apache/maven/clover/test/Simple1.java (with props)
maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject1/src/test/
maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject1/src/test/org/
maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject1/src/test/org/apache/
maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject1/src/test/org/apache/maven/
maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject1/src/test/org/apache/maven/clover/
maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject1/src/test/org/apache/maven/clover/test/
maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject1/src/test/org/apache/maven/clover/test/Simple1Test.java (with props)
maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject2/
maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject2/project.xml
maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject2/src/
maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject2/src/main/
maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject2/src/main/org/
maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject2/src/main/org/apache/
maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject2/src/main/org/apache/maven/
maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject2/src/main/org/apache/maven/clover/
maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject2/src/main/org/apache/maven/clover/test/
maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject2/src/main/org/apache/maven/clover/test/Simple2.java (with props)
maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject2/src/test/
maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject2/src/test/org/
maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject2/src/test/org/apache/
maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject2/src/test/org/apache/maven/
maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject2/src/test/org/apache/maven/clover/
maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject2/src/test/org/apache/maven/clover/test/
maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject2/src/test/org/apache/maven/clover/test/Simple2Test.java (with props)
Modified:
maven/maven-1/plugins/trunk/clover/plugin.jelly
maven/maven-1/plugins/trunk/clover/plugin.properties
maven/maven-1/plugins/trunk/clover/xdocs/changes.xml
maven/maven-1/plugins/trunk/clover/xdocs/goals.xml
maven/maven-1/plugins/trunk/clover/xdocs/index.xml
maven/maven-1/plugins/trunk/clover/xdocs/properties.xml
Modified: maven/maven-1/plugins/trunk/clover/plugin.jelly
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/clover/plugin.jelly?rev=169652&r1=169651&r2=169652&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/clover/plugin.jelly (original)
+++ maven/maven-1/plugins/trunk/clover/plugin.jelly Wed May 11 09:28:26 2005
@@ -19,6 +19,7 @@
-->
<project
+ xmlns:multiproject="multiproject"
xmlns:j="jelly:core"
xmlns:ant="jelly:ant"
xmlns:maven="jelly:maven"
@@ -32,7 +33,7 @@
Initialize the Clover plugin.
========================================================================
-->
- <goal name="clover:init">
+ <goal name="clover:init-internal">
<!-- Create an Ant <path> id that contains the Clover jar. If the user has
defined the maven.clover.jar property then this path will contain his
@@ -79,6 +80,15 @@
</j:if>
<u:file var="historyDirAsFile" name="${maven.clover.history.dir}"/>
+
+ </goal>
+ <goal name="clover:init">
+
+ <!-- Ensure intialization is called only once -->
+ <j:if test="${!cloverInitialized}">
+ <attainGoal name="clover:init-internal"/>
+ <j:set var="cloverInitialized" value="true"/>
+ </j:if>
</goal>
@@ -87,9 +97,21 @@
Generate test coverage reports with Clover.
========================================================================
-->
- <goal name="clover"
- description="Generate test coverage reports with Clover"
- prereqs="clover:test,clover:report"/>
+ <goal name="clover" description="Generate test coverage reports with Clover">
+
+ <!-- Is it a multiproject setup? -->
+ <!-- TODO: Find a way to call clover:init only once below -->
+ <j:choose>
+ <j:when test="${maven.clover.multiproject}">
+ <attainGoal name="clover:multiproject"/>
+ </j:when>
+ <j:otherwise>
+ <attainGoal name="clover:test"/>
+ </j:otherwise>
+ </j:choose>
+ <attainGoal name="clover:report"/>
+
+ </goal>
<!--
========================================================================
@@ -102,8 +124,7 @@
need to call clover:off to reset them as they were initially.
========================================================================
-->
- <goal name="clover:on" prereqs="clover:init"
- description="Activates Clover">
+ <goal name="clover:on-internal" prereqs="clover:init">
<!-- Save properties so that they can be reset afterwards -->
<maven:get var="ignoreTestFailureOld" plugin="maven-test-plugin"
@@ -184,6 +205,16 @@
<j:set var="maven.build.dest" value="${maven.clover.build.classes}" scope="parent" />
</goal>
+ <goal name="clover:on" prereqs="clover:init"
+ description="Activates Clover">
+
+ <!-- Ensure clover:on is only called once -->
+ <j:if test="${!isCloverOn}">
+ <attainGoal name="clover:on-internal"/>
+ <j:set var="isCloverOn" value="true"/>
+ </j:if>
+
+ </goal>
<!--
========================================================================
@@ -191,7 +222,7 @@
the call to clover:on.
========================================================================
-->
- <goal name="clover:off" description="Deactivates Clover">
+ <goal name="clover:off-internal">
<j:set var="maven.build.dest" value="${mavenBuildDestOld}" scope="parent" />
${context.removeVariable('build.compiler')}
@@ -204,6 +235,15 @@
value="${junitForkOld}"/>
</goal>
+ <goal name="clover:off" description="Deactivates Clover">
+
+ <!-- Ensure clover:off is only called once -->
+ <j:if test="${isCloverOn}">
+ <attainGoal name="clover:off-internal"/>
+ <j:set var="isCloverOn" value="false"/>
+ </j:if>
+
+ </goal>
<!--
========================================================================
@@ -273,18 +313,18 @@
<j:when test="${cloverDatabaseAsFile.exists()}">
<j:if test="${context.getVariable('maven.clover.report.xml') == 'true'}">
- <attainGoal name="clover:xml-report-internal"/>
+ <attainGoal name="clover:xml-report"/>
</j:if>
<j:if test="${context.getVariable('maven.clover.report.html') == 'true'}">
- <attainGoal name="clover:html-report-internal"/>
+ <attainGoal name="clover:html-report"/>
</j:if>
<j:if test="${context.getVariable('maven.clover.report.swing') == 'true'}">
- <attainGoal name="clover:swing-report-internal"/>
+ <attainGoal name="clover:swing-report"/>
</j:if>
<j:if test="${context.getVariable('maven.clover.report.pdf') == 'true'}">
- <attainGoal name="clover:pdf-report-internal"/>
+ <attainGoal name="clover:pdf-report"/>
</j:if>
-
+
</j:when>
<j:otherwise>
<ant:echo>No Clover database found, skipping report generation</ant:echo>
@@ -298,7 +338,11 @@
Generate XML test coverage report.
========================================================================
-->
- <goal name="clover:xml-report-internal">
+ <goal name="clover:xml-report"
+ description="Generate XML test coverage reports with Clover">
+
+ <attainGoal name="clover:on"/>
+
<ant:clover-report>
<ant:current outfile="${maven.build.dir}/clover.xml" alwaysReport="true"
title="${pom.name} - ${pom.currentVersion}">
@@ -313,17 +357,20 @@
</ant:format>
</ant:current>
</ant:clover-report>
+
+ <attainGoal name="clover:off"/>
+
</goal>
- <goal name="clover:xml-report"
- description="Generate XML test coverage reports with Clover"
- prereqs="clover:test,clover:xml-report-internal"/>
<!--
========================================================================
Generate HTML test coverage report.
========================================================================
-->
- <goal name="clover:html-report-internal">
+ <goal name="clover:html-report"
+ description="Generate HTML test coverage reports with Clover">
+
+ <attainGoal name="clover:on"/>
<j:set var="cloverReportDirectory" value="${maven.docs.dest}/clover"/>
<ant:mkdir dir="${cloverReportDirectory}"/>
@@ -359,29 +406,33 @@
</ant:clover-report>
+ <attainGoal name="clover:off"/>
+
</goal>
- <goal name="clover:html-report"
- description="Generate HTML test coverage reports with Clover"
- prereqs="clover:test,clover:html-report-internal"/>
<!--
========================================================================
Generate Swing test coverage report.
========================================================================
-->
- <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"/>
+ description="Generate Swing test coverage reports with Clover">
+
+ <attainGoal name="clover:on"/>
+ <ant:clover-view/>
+ <attainGoal name="clover:off"/>
+
+ </goal>
<!--
========================================================================
Generate PDF test coverage report.
========================================================================
-->
- <goal name="clover:pdf-report-internal">
+ <goal name="clover:pdf-report"
+ description="Generate PDF test coverage reports with Clover">
+
+ <attainGoal name="clover:on"/>
<j:set var="cloverReportDirectory" value="${maven.docs.dest}/clover"/>
<j:set var="cloverPDFReportFile" value="${cloverReportDirectory}/clover.pdf"/>
@@ -417,11 +468,10 @@
</j:if>
</ant:clover-report>
+
+ <attainGoal name="clover:off"/>
</goal>
- <goal name="clover:pdf-report"
- description="Generate PDF test coverage reports with Clover"
- prereqs="clover:test,clover:pdf-report-internal"/>
<!--
========================================================================
@@ -430,7 +480,9 @@
-->
<goal name="maven-clover-plugin:register">
- <j:if test="${unitTestSourcesPresent == 'true'}">
+ <j:if test="${unitTestSourcesPresent == 'true'
+ || context.getVariable('maven.clover.multiproject') == 'true'}">
+
<doc:registerReport
name="Clover"
pluginName="maven-clover-plugin"
@@ -459,7 +511,8 @@
-->
<goal name="maven-clover-plugin:deregister">
- <j:if test="${unitTestSourcesPresent == 'true'}">
+ <j:if test="${unitTestSourcesPresent == 'true'
+ || context.getVariable('maven.clover.multiproject') == 'true'}">
<doc:deregisterReport name="Clover"/>
@@ -532,6 +585,44 @@
<ant:clover-historypoint historyDir="${maven.clover.history.dir}"/>
+ </goal>
+
+ <!--
+ ========================================================================
+ Merge different Clover databases. This goal is meant to be used in
+ a top level master project.
+ ========================================================================
+ -->
+ <goal name="clover:merge" prereqs="clover:init"
+ description="Merge Clover databases">
+
+ <ant:clover-merge initString="${maven.clover.database}">
+ <ant:cloverDbSet dir=".">
+ <ant:include name="${maven.clover.merge.databases}"/>
+ </ant:cloverDbSet>
+ </ant:clover-merge>
+
+ </goal>
+
+ <!--
+ ========================================================================
+ Runs Clover on a multiproject and merge the Clover databases.This
+ goal does not generate a report; call clover:report for that or add
+ Clover as a report in your POM.
+ ========================================================================
+ -->
+ <goal name="clover:multiproject" description="Run Clover on a multiproject">
+
+ <!-- TODO: Shouldn't be required as we're using maven:set but it doesn't
+ work if it's not there! -->
+ <multiproject:dependency-handle />
+
+ <maven:set plugin="maven-multiproject-plugin" property="goal"
+ value="clover:test"/>
+
+ <attainGoal name="multiproject:goal"/>
+ <attainGoal name="clover:merge"/>
+
</goal>
</project>
Modified: maven/maven-1/plugins/trunk/clover/plugin.properties
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/clover/plugin.properties?rev=169652&r1=169651&r2=169652&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/clover/plugin.properties (original)
+++ maven/maven-1/plugins/trunk/clover/plugin.properties Wed May 11 09:28:26 2005
@@ -57,6 +57,12 @@
# based on an existing Clover database.
maven.clover.execute.during.report = true
+# Specify whether the current project is a master project in a multiproject
+# setup or not. Set it to true for your master project so that adding
+# the maven-clover-plugin report to your POM will call the clover:multiproject
+# goal (same for the clover goal).
+maven.clover.multiproject = false
+
# List of files to include/exclude from Cloverification
maven.clover.includes = **/*.java
maven.clover.excludes =
@@ -65,6 +71,9 @@
# history point data so that they are not erased, point this directory to
# a safe place that will not be deleted by a "maven clean".
maven.clover.history.dir = ${maven.clover.build}/history
+
+# List of databases to include in the merge when using the clover:merge goal
+maven.clover.merge.databases = **/clover_coverage.db
# Test coverage % under which the build will fail when clover:check is called.
# Set it to an empty value if you wish to only use the per-package definitions.
Added: maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/maven.xml
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/maven.xml?rev=169652&view=auto
==============================================================================
--- maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/maven.xml (added)
+++ maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/maven.xml Wed May 11 09:28:26 2005
@@ -0,0 +1,41 @@
+<!--
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+<project default="testPlugin"
+ xmlns:assert="assert">
+
+ <goal name="testPlugin" prereqs="testDirectCall,testCallByReport"/>
+
+ <goal name="testDirectCall" prereqs="clean,multiproject:clean">
+
+ <attainGoal name="clover:multiproject"/>
+ <attainGoal name="clover:xml-report"/>
+
+ <assert:assertFileContains file="${maven.build.dir}/clover.xml" match="Simple1.java"/>
+ <assert:assertFileContains file="${maven.build.dir}/clover.xml" match="Simple2.java"/>
+
+ </goal>
+
+ <goal name="testCallByReport" prereqs="clean,multiproject:clean">
+
+ <attainGoal name="site"/>
+
+ <assert:assertFileExists file="${maven.docs.dest}/clover/index.html"/>
+
+ </goal>
+
+</project>
\ No newline at end of file
Added: maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/project.properties
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/project.properties?rev=169652&view=auto
==============================================================================
--- maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/project.properties (added)
+++ maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/project.properties Wed May 11 09:28:26 2005
@@ -0,0 +1,17 @@
+# -------------------------------------------------------------------
+# Copyright 2005 The Apache Software Foundation.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# -------------------------------------------------------------------
+
+maven.clover.multiproject = true
Added: maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/project.xml
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/project.xml?rev=169652&view=auto
==============================================================================
--- maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/project.xml (added)
+++ maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/project.xml Wed May 11 09:28:26 2005
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<project>
+ <extend>${basedir}/../project.xml</extend>
+ <id>testMultiproject</id>
+ <name>testMultiproject</name>
+ <reports>
+ <report>maven-clover-plugin</report>
+ </reports>
+</project>
Added: maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject1/project.xml
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject1/project.xml?rev=169652&view=auto
==============================================================================
--- maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject1/project.xml (added)
+++ maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject1/project.xml Wed May 11 09:28:26 2005
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<project>
+ <extend>${basedir}/../project.xml</extend>
+ <id>testMultiproject-subproject1</id>
+ <name>testMultiproject-subproject1</name>
+ <build>
+ <sourceDirectory>src/main</sourceDirectory>
+ <unitTestSourceDirectory>src/test</unitTestSourceDirectory>
+ <unitTest>
+ <includes>
+ <include>**/*Test.java</include>
+ </includes>
+ </unitTest>
+ </build>
+</project>
Added: maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject1/src/main/org/apache/maven/clover/test/Simple1.java
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject1/src/main/org/apache/maven/clover/test/Simple1.java?rev=169652&view=auto
==============================================================================
--- maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject1/src/main/org/apache/maven/clover/test/Simple1.java (added)
+++ maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject1/src/main/org/apache/maven/clover/test/Simple1.java Wed May 11 09:28:26 2005
@@ -0,0 +1,25 @@
+package org.apache.maven.clover.test;
+
+/* ====================================================================
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ====================================================================
+ */
+
+public class Simple1
+{
+ public void someMethod1()
+ {
+ }
+}
\ No newline at end of file
Propchange: maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject1/src/main/org/apache/maven/clover/test/Simple1.java
------------------------------------------------------------------------------
svn:keywords = Id
Added: maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject1/src/test/org/apache/maven/clover/test/Simple1Test.java
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject1/src/test/org/apache/maven/clover/test/Simple1Test.java?rev=169652&view=auto
==============================================================================
--- maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject1/src/test/org/apache/maven/clover/test/Simple1Test.java (added)
+++ maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject1/src/test/org/apache/maven/clover/test/Simple1Test.java Wed May 11 09:28:26 2005
@@ -0,0 +1,29 @@
+package org.apache.maven.clover.test;
+
+/* ====================================================================
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ====================================================================
+ */
+
+import junit.framework.TestCase;
+
+public class Simple1Test extends TestCase
+{
+ public void testSomeMethod1()
+ {
+ Simple1 simple = new Simple1();
+ simple.someMethod1();
+ }
+}
\ No newline at end of file
Propchange: maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject1/src/test/org/apache/maven/clover/test/Simple1Test.java
------------------------------------------------------------------------------
svn:keywords = Id
Added: maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject2/project.xml
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject2/project.xml?rev=169652&view=auto
==============================================================================
--- maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject2/project.xml (added)
+++ maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject2/project.xml Wed May 11 09:28:26 2005
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<project>
+ <extend>${basedir}/../project.xml</extend>
+ <id>testMultiproject-subproject2</id>
+ <name>testMultiproject-subproject2</name>
+ <build>
+ <sourceDirectory>src/main</sourceDirectory>
+ <unitTestSourceDirectory>src/test</unitTestSourceDirectory>
+ <unitTest>
+ <includes>
+ <include>**/*Test.java</include>
+ </includes>
+ </unitTest>
+ </build>
+</project>
Added: maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject2/src/main/org/apache/maven/clover/test/Simple2.java
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject2/src/main/org/apache/maven/clover/test/Simple2.java?rev=169652&view=auto
==============================================================================
--- maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject2/src/main/org/apache/maven/clover/test/Simple2.java (added)
+++ maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject2/src/main/org/apache/maven/clover/test/Simple2.java Wed May 11 09:28:26 2005
@@ -0,0 +1,25 @@
+package org.apache.maven.clover.test;
+
+/* ====================================================================
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ====================================================================
+ */
+
+public class Simple2
+{
+ public void someMethod2()
+ {
+ }
+}
\ No newline at end of file
Propchange: maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject2/src/main/org/apache/maven/clover/test/Simple2.java
------------------------------------------------------------------------------
svn:keywords = Id
Added: maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject2/src/test/org/apache/maven/clover/test/Simple2Test.java
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject2/src/test/org/apache/maven/clover/test/Simple2Test.java?rev=169652&view=auto
==============================================================================
--- maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject2/src/test/org/apache/maven/clover/test/Simple2Test.java (added)
+++ maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject2/src/test/org/apache/maven/clover/test/Simple2Test.java Wed May 11 09:28:26 2005
@@ -0,0 +1,29 @@
+package org.apache.maven.clover.test;
+
+/* ====================================================================
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ====================================================================
+ */
+
+import junit.framework.TestCase;
+
+public class Simple2Test extends TestCase
+{
+ public void testSomeMethod2()
+ {
+ Simple2 simple = new Simple2();
+ simple.someMethod2();
+ }
+}
\ No newline at end of file
Propchange: maven/maven-1/plugins/trunk/clover/src/plugin-test/testMultiproject/subproject2/src/test/org/apache/maven/clover/test/Simple2Test.java
------------------------------------------------------------------------------
svn:keywords = Id
Modified: maven/maven-1/plugins/trunk/clover/xdocs/changes.xml
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/clover/xdocs/changes.xml?rev=169652&r1=169651&r2=169652&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/clover/xdocs/changes.xml (original)
+++ maven/maven-1/plugins/trunk/clover/xdocs/changes.xml Wed May 11 09:28:26 2005
@@ -26,6 +26,44 @@
</properties>
<body>
<release version="1.9-SNAPSHOT" date="in SVN">
+ <action dev="vmassol" type="add">
+ Added a quick usage guide in the documentation.
+ </action>
+ <action dev="vmassol" type="fix">
+ Fixed issue where <code>clover:report</code> was not calling
+ <code>clover:on</code> leading to an error when generating the
+ reports.
+ </action>
+ <action dev="vmassol" type="update">
+ Ensure that <code>clover:init</code>, <code>clover:on</code>
+ and <code>clover:off</code> can only be called once. For example
+ calling <code>clover:on</code> twice in a row will execute it only
+ once.
+ </action>
+ <action dev="vmassol" type="update">
+ The <code>clover:*-report</code> goals do not call
+ <code>clover:test</code> anymore. They only generates Clover reports.
+ This is now aligned with the <code>clover:report</code> behavior.
+ To run the full thing, execute the <code>clover</code> goal or
+ add the Clover report to your project's POM.
+ </action>
+ <action dev="vmassol" type="add">
+ Added a <code>maven.clover.multiproject</code> property that should be
+ set to true in your master project (if you're using a multiproject setup).
+ Setting it to true will make the <code>clover</code> goal and the
+ <code>maven-clover-plugin</code> report in your POM execute on all
+ subprojects (they'll call the new <code>clover:multiproject</code> goal).
+ </action>
+ <action dev="vmassol" type="add">
+ New <code>clover:multiproject</code> goal to run Clover on a
+ multiproject setup.
+ </action>
+ <action dev="vmassol" type="add">
+ New <code>clover:merge</code> goal that creates a new Clover
+ database by merging several other databases specified using
+ the <code>maven.clover.merge.databases</code> property (which
+ defaults to <code>**/clover_coverage.db</code>).
+ </action>
<action dev="vmassol" type="fix">
Fixed issue with Clover task and type definitions not using an
explicit classpath which apparently breaks under Maven 1.1.
Modified: maven/maven-1/plugins/trunk/clover/xdocs/goals.xml
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/clover/xdocs/goals.xml?rev=169652&r1=169651&r2=169652&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/clover/xdocs/goals.xml (original)
+++ maven/maven-1/plugins/trunk/clover/xdocs/goals.xml Wed May 11 09:28:26 2005
@@ -65,7 +65,7 @@
<description>
Generate Clover test coverage reports with Clover. There are 3
possible reports: HTML, XML or Swing. Whether a report is generated
- is controller by the <code>maven.clover.report.[report name]</code>
+ is controlled by the <code>maven.clover.report.[report name]</code>
<a href="properties.html">properties</a>. The generated reports show
exactly what lines of your code were exercised by your tests.
</description>
@@ -115,6 +115,22 @@
<description>
Saves a Clover history point that will then be used for generating
history reports when the <code>clover:report</code> goal is called.
+ </description>
+ </goal>
+ <goal>
+ <name>clover:merge</name>
+ <description>
+ Merges several Clover databases into one. This goal is meant to be
+ called in the top level master project (multiproject). It is called
+ automatically by the <code>clover:multiproject</code> goal.
+ </description>
+ </goal>
+ <goal>
+ <name>clover:multiproject</name>
+ <description>
+ Runs Clover on a multiproject and merge the Clover databases.This
+ goal does not generate a report; call clover:report for that or add
+ Clover as a report in your POM.
</description>
</goal>
</goals>
Modified: maven/maven-1/plugins/trunk/clover/xdocs/index.xml
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/clover/xdocs/index.xml?rev=169652&r1=169651&r2=169652&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/clover/xdocs/index.xml (original)
+++ maven/maven-1/plugins/trunk/clover/xdocs/index.xml Wed May 11 09:28:26 2005
@@ -2,7 +2,7 @@
<!--
/*
- * Copyright 2001-2004 The Apache Software Foundation.
+ * Copyright 2001-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -37,6 +37,38 @@
non-commercial use. If your project is a commercial project you will
need to get a license for the Clover jar before using this plugin.
</p>
+ </section>
+ <section name="Using the Clover plugin">
+ <p>
+ There are 3 possible ways of running the plugin:
+ </p>
+ <ul>
+ <li>
+ <b>All in one</b>: You'll either call the <code>clover</code> goal or
+ add the <code>maven-clover-plugin</code> report to the <code>reports</code>
+ section in your POM. This will instrument your source code, run your
+ project's tests on the cloverified code and generate Clover reports. Note that
+ if you're in a multiproject setup, you must set the
+ <code>maven.clover.multiproject</code> property to <code>true</code> in your master
+ project. Doing so will automatically gather Clover data from all your subprojects
+ and aggregate them in a master project report.
+ </li>
+ <li>
+ <b>In 2 steps</b>: You'll call <code>clover:test</code> which will
+ instrument your source code and run your project's tests on the cloverified code.
+ Alternatively you can call <code>clover:multiproject</code> to run the
+ <code>clover:test</code> goal on all your subprojects in you're in a multiproject
+ setup. You'll then need to call <code>clover:report</code> to generate the reports.
+ </li>
+ <li>
+ <b>In 3 steps</b>: You'll call <code>clover:on</code> followed by whatever other
+ goal you wish (for example <code>maven clover:on war</code>.) This will instrument
+ your source code. Then you'll run any goal that tests your artifacts. For example
+ in the case of a WAR you can use HttpUnit/HtmlUnit to run functional tests. The
+ test of your artifact will fill the Clover database with data. Finally you'll run
+ <code>clover:report</code> to generate the reports.
+ </li>
+ </ul>
</section>
</body>
</document>
Modified: maven/maven-1/plugins/trunk/clover/xdocs/properties.xml
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/clover/xdocs/properties.xml?rev=169652&r1=169651&r2=169652&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/clover/xdocs/properties.xml (original)
+++ maven/maven-1/plugins/trunk/clover/xdocs/properties.xml Wed May 11 09:28:26 2005
@@ -270,6 +270,17 @@
${maven.clover.build}/history
</td>
</tr>
+ <tr>
+ <td>maven.clover.merge.databases</td>
+ <td>Yes</td>
+ <td>
+ List of databases to include in the merge when using the
+ <code>clover:merge</code> goal.
+ </td>
+ <td>
+ **/clover_coverage.db
+ </td>
+ </tr>
</table>
</section>
</body>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org