| Index: common-build.xml |
| =================================================================== |
| --- common-build.xml (revision 799025) |
| +++ common-build.xml Fri Jul 31 09:50:58 EST 2009 |
| @@ -47,10 +47,19 @@ |
| <property name="year" value="2000-${current.year}"/> |
| <property name="final.name" value="lucene-${name}-${version}"/> |
| |
| + |
| + <property name="clover.db.dir" location="${common.dir}/build/test/clover/db"/> |
| + <property name="clover.report.dir" location="${common.dir}/build/test/clover/reports"/> |
| + <property name="clover.jar" location="${common.dir}/lib/clover.jar"/> |
| + <taskdef resource="cloverlib.xml" classpath="${clover.jar}"/> |
| + |
| + |
| - <property name="junit.jar" value="junit-3.8.2.jar"/> |
| + <property name="junit.jar" value="junit-3.8.2.jar"/> |
| <property name="junit-location.jar" value="${common.dir}/lib/${junit.jar}"/> |
| <path id="junit-path"> |
| <pathelement location="${junit-location.jar}"/> |
| + <pathelement location="${clover.jar}"/> |
| + |
| </path> |
| |
| <property name="javac.deprecation" value="off"/> |
| @@ -104,23 +113,8 @@ |
| <condition property="build-1-5-contrib"> |
| <equals arg1="1.5" arg2="${ant.java.version}" /> |
| </condition> |
| - |
| + |
| - <property name="clover.db.dir" location="${common.dir}/build/test/clover/db"/> |
| - <property name="clover.report.dir" location="${common.dir}/build/test/clover/reports"/> |
| - |
| - <available |
| + <available |
| - property="clover.present" |
| - classname="com.cenqua.clover.tasks.CloverReportTask" |
| - /> |
| - <condition property="clover.enabled"> |
| - <and> |
| - <isset property="run.clover"/> |
| - <isset property="clover.present"/> |
| - </and> |
| - </condition> |
| - |
| - |
| - <available |
| property="javacc.present" |
| classname="org.javacc.parser.Main" |
| classpath="${javacc.home}/bin/lib/javacc.jar" |
| @@ -449,50 +443,42 @@ |
| |
| See http://issues.apache.org/jira/browse/LUCENE-721 |
| --> |
| - <target name="clover" depends="clover.setup, clover.info" description="Instrument the Unit tests using Clover. Requires a Clover 1.3.2 license and clover.jar in the ANT classpath. To use, specify -Drun.clover=true on the command line."/> |
| + <target name="clover" depends="clover.setup" description="Instrument the Unit tests using Clover. Requires a Clover 1.3.2 license and clover.jar in the ANT classpath. To use, specify -Drun.clover=true on the command line."/> |
| |
| - <target name="clover.setup" if="clover.enabled"> |
| - <taskdef resource="clovertasks"/> |
| + <target name="clover.setup" if="run.clover"> |
| + |
| <mkdir dir="${clover.db.dir}"/> |
| - <clover-setup initString="${clover.db.dir}/lucene_coverage.db"> |
| - <fileset dir="src/java"> |
| - <!-- see https://svn.apache.org/repos/private/committers/donated-licenses/clover/1.3.2/README.txt --> |
| - <include name="org/apache/**" /> |
| - <include name="javax/**" /> |
| - <include name="org/xml/**" /> |
| - <include name="org/w3c/**" /> |
| - <include name="com/example/**" /> |
| - <exclude name="org/apache/lucene/analysis/ASCIIFoldingFilter.java" /> <!-- Class too large for clover --> |
| + <clover-setup initString="${clover.db.dir}/lucene_coverage.db" encoding="utf-8"> |
| + <fileset dir="src"> |
| + <!-- see https://issues.apache.org/jira/browse/LUCENE-1772 --> |
| + <include name="**/org/apache/**"/> |
| + <include name="**/lucli/**"/> |
| + <include name="**/com/example/**"/> |
| + <exclude name="**/org/apache/lucene/analysis/TestASCIIFoldingFilter.java"/> <!-- Illegal char on line 190--> |
| - </fileset> |
| + </fileset> |
| </clover-setup> |
| </target> |
| |
| - <target name="clover.info" unless="clover.present"> |
| - <echo> |
| - Clover not found. Code coverage reports disabled. |
| - </echo> |
| - </target> |
| - |
| - <target name="clover.check"> |
| - <fail unless="clover.present"> |
| - ################################################################## |
| - Clover not found. |
| - Please make sure clover.jar is in ANT_HOME/lib, or made available |
| - to Ant using other mechanisms like -lib or CLASSPATH. |
| - ################################################################## |
| - </fail> |
| - </target> |
| <!-- |
| Run after Junit tests. |
| --> |
| - <target name="generate-clover-reports" depends="clover.check, clover"> |
| + <target name="generate-clover-reports" depends="clover"> |
| <mkdir dir="${clover.report.dir}"/> |
| + <fileset dir="src/test" id="test.src.files"/> |
| + <fileset dir="contrib" id="contrib.test.src.files"> |
| + <include name="**/test/**"/> |
| + </fileset> |
| + |
| <clover-report> |
| <current outfile="${clover.report.dir}" title="${final.name}"> |
| <format type="html"/> |
| + <testsources refid="test.src.files"/> |
| + <testsources refid="contrib.test.src.files"/> |
| </current> |
| <current outfile="${clover.report.dir}/clover.xml" title="${final.name}"> |
| <format type="xml"/> |
| + <testsources refid="test.src.files"/> |
| + <testsources refid="contrib.test.src.files"/> |
| </current> |
| </clover-report> |
| </target> |
| Index: build.xml |
| =================================================================== |
| --- build.xml (revision 797213) |
| +++ build.xml Thu Jul 30 10:40:30 EST 2009 |
| @@ -88,12 +88,14 @@ |
| |
| <path id="tag.test.classpath"> |
| <path refid="junit-path"/> |
| + <pathelement location="${clover.jar}"/> |
| <pathelement location="${build.dir}/classes/demo"/> |
| <pathelement location="${build.dir}/${tag}/${tag}.jar"/> |
| </path> |
| |
| <path id="tag.junit.classpath"> |
| <path refid="junit-path"/> |
| + <pathelement location="${clover.jar}"/> |
| <pathelement location="${build.dir}/${tag}/classes/test"/> |
| <pathelement location="${build.dir}/${final.name}.jar"/> |
| <pathelement location="${build.dir}/classes/demo"/> |