/[Apache-SVN]/maven/maven-1/plugins/trunk/clover/plugin.jelly
ViewVC logotype

Diff of /maven/maven-1/plugins/trunk/clover/plugin.jelly

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- maven/maven-1/plugins/trunk/clover/plugin.jelly	2005/02/24 10:23:34	155181
+++ maven/maven-1/plugins/trunk/clover/plugin.jelly	2005/02/24 12:39:06	155182
@@ -64,13 +64,10 @@
       </j:otherwise>
     </j:choose>
 
-    <j:set var="cloverReportDirectory" value="${maven.docs.dest}/clover"/>
-
     <!-- Allow users to override the version of the Clover jar to use  -->
     <maven:addPath id="maven.dependency.classpath" refid="clover.classpath"/>
 
     <ant:mkdir dir="${maven.clover.build.classes}"/>
-    <ant:mkdir dir="${cloverReportDirectory}"/>
     <ant:mkdir dir="${maven.clover.database.dir}"/>
 
     <!-- Add the Clover license to the classpath. -->
@@ -81,6 +78,8 @@
       </j:invokeStatic>
     </j:if>
 
+    <u:file var="historyDirAsFile" name="${maven.clover.history.dir}"/>
+
   </goal>
 
   <!--
@@ -317,7 +316,12 @@
      ========================================================================
   -->
   <goal name="clover:html-report-internal">
+
+    <j:set var="cloverReportDirectory" value="${maven.docs.dest}/clover"/>
+    <ant:mkdir dir="${cloverReportDirectory}"/>
+
     <ant:clover-report>
+
       <ant:current 
       	outfile="${cloverReportDirectory}" 
       	title="${pom.name} - ${pom.currentVersion}">
@@ -331,7 +335,23 @@
 
         </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"/>
+        <ant:mkdir dir="${cloverHistoryReportDirectory}"/>
+      
+        <ant:historical outfile="${cloverHistoryReportDirectory}" 
+          historyDir="${maven.clover.history.dir}"
+        	title="${pom.name} - ${pom.currentVersion} - History">
+          <ant:format type="html"/>
+        </ant:historical>
+
+      </j:if>
+
     </ant:clover-report>
+
   </goal>
   <goal 
     name="clover:html-report" 
@@ -357,6 +377,7 @@
      ========================================================================
   -->
   <goal name="maven-clover-plugin:register">
+
     <j:if test="${unitTestSourcesPresent == 'true'}">
       <doc:registerReport 
         name="Clover" 
@@ -364,7 +385,19 @@
         link="clover/index"
         target="_blank"
         description="Clover test coverage report."/>
+
+      <!-- Only generate history report if there is at least one history point -->
+      <j:if test="${historyDirAsFile.exists() and !empty(historyDirAsFile.listFiles())}">
+        <doc:registerReport 
+          name="Clover History" 
+          pluginName="maven-clover-plugin" 
+          link="clover/history/historical"
+          target="_blank"
+          description="Clover test coverage history report."/>
+      </j:if>
+      
     </j:if>
+
   </goal>
   
   <!--
@@ -373,9 +406,18 @@
      ========================================================================
   -->
   <goal name="maven-clover-plugin:deregister">
+
     <j:if test="${unitTestSourcesPresent == 'true'}">
+
       <doc:deregisterReport name="Clover"/>
+
+      <!-- Only deregister the history report if there is at least one history point -->
+      <j:if test="${historyDirAsFile.exists() and !empty(historyDirAsFile.listFiles())}">
+        <doc:deregisterReport name="Clover History"/>
+      </j:if>
+
     </j:if>
+
   </goal>
   
   <!--
@@ -428,4 +470,16 @@
     
   </goal>
 
+  <!--
+     ========================================================================
+       Record a history point
+     ========================================================================
+  -->
+  <goal name="clover:save-history" prereqs="clover:init" 
+      description="Record a history point">
+
+    <ant:clover-historypoint historyDir="${maven.clover.history.dir}"/>
+
+  </goal>
+
 </project>

 

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26