Apache Solr open-source search software
LUCENE-3753: Clover fixes: Added non-clover-invoking compile-core target specializations to the lucene/test-framework and lucene/tools modules, since these classes have no tests, and lucene/test-framework sources are already included in every other module's clover instrumentation; and moved generate-clover-reports from lucene/common-build.xml to lucene/build.xml, since it doesn't need to be shared elsewhere.
Steven Rowe534ecb309b23
diff --git a/lucene/build.xml b/lucene/build.xmlindex 539ba5c5c09..fc9d20a7931 100644--- a/lucene/build.xml+++ b/lucene/build.xml@@ -143,6 +143,44 @@<target name="compile-core" depends="compile-lucene-core"/>+ <!--+ Run after Junit tests.+ -->+ <target name="generate-clover-reports" depends="clover.check, clover">+ <mkdir dir="${clover.report.dir}"/>+ <!-- This extra path is needed, because from a top-level ant run, the contrib tests would be not visible (report generation is only done on top-level not via subants) -->+ <fileset dir="contrib" id="clover.contrib.test.src.files">+ <include name="**/test/**/*.java"/>+ </fileset>+ <fileset dir="${tests-framework.src.dir}" id="clover.test-framework.src.files">+ <include name="**/*.java" />+ </fileset>+ <fileset dir="${tests.src.dir}" id="clover.test.src.files">+ <include name="**/*.java" />+ </fileset>+ <fileset dir="${build.dir}" id="clover.test.result.files">+ <include name="**/test/TEST-*.xml" />+ <!-- do not include BW tests -->+ <exclude name="backwards/**"/>+ </fileset>+ <clover-report>+ <current outfile="${clover.report.dir}" title="${final.name}" numThreads="0">+ <format type="html" filter="assert"/>+ <testsources refid="clover.test.src.files"/>+ <testsources refid="clover.test-framework.src.files"/>+ <testsources refid="clover.contrib.test.src.files"/>+ <testresults refid="clover.test.result.files"/>+ </current>+ <current outfile="${clover.report.dir}/clover.xml" title="${final.name}">+ <format type="xml" filter="assert"/>+ <testsources refid="clover.test.src.files"/>+ <testsources refid="clover.test-framework.src.files"/>+ <testsources refid="clover.contrib.test.src.files"/>+ <testresults refid="clover.test.result.files"/>+ </current>+ </clover-report>+ </target>+<!-- ================================================================== --><!-- D O C U M E N T A T I O N --><!-- ================================================================== -->diff --git a/lucene/common-build.xml b/lucene/common-build.xmlindex 586b19dbd25..ce77fd87466 100644--- a/lucene/common-build.xml+++ b/lucene/common-build.xml@@ -737,43 +737,6 @@##################################################################</fail></target>- <!--- Run after Junit tests.- -->- <target name="generate-clover-reports" depends="clover.check, clover">- <mkdir dir="${clover.report.dir}"/>- <!-- This extra path is needed, because from a top-level ant run, the contrib tests would be not visible (report generation is only done on top-level not via subants) -->- <fileset dir="contrib" id="clover.contrib.test.src.files">- <include name="**/test/**/*.java"/>- </fileset>- <fileset dir="${tests-framework.src.dir}" id="clover.test-framework.src.files">- <include name="**/*.java" />- </fileset>- <fileset dir="${tests.src.dir}" id="clover.test.src.files">- <include name="**/*.java" />- </fileset>- <fileset dir="${build.dir}" id="clover.test.result.files">- <include name="**/test/TEST-*.xml" />- <!-- do not include BW tests -->- <exclude name="backwards/**"/>- </fileset>- <clover-report>- <current outfile="${clover.report.dir}" title="${final.name}" numThreads="0">- <format type="html" filter="assert"/>- <testsources refid="clover.test.src.files"/>- <testsources refid="clover.test-framework.src.files"/>- <testsources refid="clover.contrib.test.src.files"/>- <testresults refid="clover.test.result.files"/>- </current>- <current outfile="${clover.report.dir}/clover.xml" title="${final.name}">- <format type="xml" filter="assert"/>- <testsources refid="clover.test.src.files"/>- <testsources refid="clover.test-framework.src.files"/>- <testsources refid="clover.contrib.test.src.files"/>- <testresults refid="clover.test.result.files"/>- </current>- </clover-report>- </target><target name="generate-test-reports" description="Generates test reports"><mkdir dir="${junit.reports}"/>diff --git a/lucene/test-framework/build.xml b/lucene/test-framework/build.xmlindex 4c8018a9fc0..510ec14f263 100644--- a/lucene/test-framework/build.xml+++ b/lucene/test-framework/build.xml@@ -30,7 +30,20 @@<path refid="ant-path"/></path>- <target name="compile-core" depends="compile-lucene-core,common.compile-core" />+ <!--+ Specialize compile-core to depend on lucene-core compilation,+ and *not* to depend on clover; clover already includes the+ test-framework sources in each module's test instrumentation.+ -->+ <target name="compile-core" depends="init,compile-lucene-core"+ description="Compiles test-framework classes">+ <compile srcdir="${src.dir}" destdir="${build.dir}/classes/java">+ <classpath refid="classpath"/>+ </compile>+ <copy todir="${build.dir}/classes/java">+ <fileset dir="${src.dir}/../resources" erroronmissingdir="no"/>+ </copy>+ </target><target name="javadocs-core" depends="javadocs"/><target name="javadocs">diff --git a/lucene/tools/build.xml b/lucene/tools/build.xmlindex 731a33e86e3..2b3c2bf0a1e 100644--- a/lucene/tools/build.xml+++ b/lucene/tools/build.xml@@ -24,7 +24,16 @@<import file="../common-build.xml"/>- <target name="javadocs"/> <!-- to make common-build.xml happy -->-<path id="classpath"/>++ <!--+ Specialize compile-core to not depend on clover, to exclude a+ classpath reference when compiling, and to not attempt to copy+ non-existent resource files to the build output directory.+ -->+ <target name="compile-core" depends="init" description="Compiles tools classes">+ <compile srcdir="${src.dir}" destdir="${build.dir}/classes/java"/>+ </target>++ <target name="javadocs"/> <!-- to make common-build.xml happy --></project>