The following issue has been updated: Updater: Vincent Massol (mailto:[EMAIL PROTECTED]) Date: Fri, 11 Feb 2005 12:57 PM Comment: I'll apply this for Clover plugin 1.8. I'd like to release Clover plugin 1.7 now. Changes: assignee changed to Vincent Massol Version changed to 1.6 Version changed from 1.2 Fix Version changed from 1.7 --------------------------------------------------------------------- For a full history of the issue, see:
http://jira.codehaus.org/browse/MPCLOVER-6?page=history --------------------------------------------------------------------- View the issue: http://jira.codehaus.org/browse/MPCLOVER-6 Here is an overview of the issue: --------------------------------------------------------------------- Key: MPCLOVER-6 Summary: historical report for clover Type: Improvement Status: Open Priority: Minor Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: maven-clover-plugin Versions: 1.6 Assignee: Vincent Massol Reporter: Simon Matic Langford Created: Tue, 22 Jul 2003 3:34 AM Updated: Fri, 11 Feb 2005 12:57 PM Environment: clover required Description: Does a historical clover report if there are results spanning more than one day. Changes to "plugin.jelly": ======================== 37a38,42 > <doc:registerReport > name="Clover Historical" > pluginName="maven-clover-plugin" > link="clover-history/historical" > description="Clover test coverage historical report."/> 48a54 > <attainGoal name="clover:historic-report"/> 82a89,92 > > <j:set > var="cloverHistoryReportDirectory" > > value="${pom.getPluginContext('maven-xdoc-plugin').getVariable('maven.docs.dest')}/clover-history"/> 89a100 > <ant:mkdir dir="${cloverHistoryReportDirectory}"/> 126c137 < <current --- > <ant:current 130c141 < </current> --- > </ant:current> 150a162,192 > > <goal > name="clover:historic-report" > description="Generate HTML test coverage reports with Clover"> > <attainGoal name="clover:test"/> > <ant:clover-historypoint historyDir="${maven.clover.historic.dir}"/> > <attainGoal name="java:compile"/> > <ant:taskdef name="check-clover-history" > classname="org.apache.maven.clover.CheckCloverHistoryTask" > classpath="${maven.build.dest}" > /> > <ant:check-clover-history > historyDir="${maven.clover.historic.dir}" > property="cloverHistoryOk" > value="true" > /> > <j:if test="${cloverHistoryOk == 'true'}"> > <ant:clover-report> > <ant:historical > title="${pom.name} - ${pom.currentVersion}" > outfile="${cloverHistoryReportDirectory}" > historyDir="${maven.clover.historic.dir}"> > <ant:overview /> > <ant:coverage /> > <ant:metrics /> > <ant:movers range="10" interval="1w" /> > <ant:format type="html" orderBy="ElementsCoveredAsc"/> > </ant:historical> > </ant:clover-report> > </j:if> > </goal> New Ant task "org/apache/maven/clover/CheckCloverHistoryTask.java": =========================================== package org.apache.maven.clover; import java.io.IOException; import java.io.File; import java.util.Vector; import org.apache.tools.ant.Task; import org.apache.tools.ant.BuildException; /** * @author <a href="mailto:[EMAIL PROTECTED]">Simon Matic Langford</a> * @version 1.0 */ public class CheckCloverHistoryTask extends Task { /** * Location of the clover history files. */ private String historyDir = null; /** * Property to set if 2 or more days of data found. */ private String property = null; /** * Value of property to set if 2 or more days of data found. */ private String value = null; /** * @see #historyDir */ public String getHistoryDir() { return historyDir; } /** * @see #historyDir */ public void setHistoryDir(String historyDir) { this.historyDir = historyDir; } /** * @see #property */ public String getProperty() { return property; } /** * @see #property */ public void setProperty(String property) { this.property = property; } /** * @see #value */ public String getValue() { return value; } /** * @see #value */ public void setValue(String value) { this.value = value; } /** * Sets the property if at least 2 seperate days of clover * history data found. */ public void execute() throws BuildException { File dir = new File(historyDir); String[] filenames = dir.list(); Vector v = new Vector(); for (int i=0; i<filenames.length; i++) { String date = getDateBit(filenames[i]); if (v.contains(date)) { getProject().setProperty(property,value); log("Found 2 different days."); return; } else { v.addElement(date); } } log("Found only 1 day."); } /** * Gets the date part of a clover history file, in the form <code>clover-20030721151309.xml</code>. */ private String getDateBit(String filename) { // clover-20030721151309.xml int i = filename.indexOf("-")+1; return filename.substring(i,i+8); } } Changes to "plugin.properties": ============================= maven.clover.historic.dir = ${maven.build.clover}/historic --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]