lucene/solr/test-framework/build.xml

99 lines
3.8 KiB
XML
Raw Normal View History

<?xml version="1.0"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You 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 name="solr-test-framework" default="default">
<description>Solr Test Framework</description>
<import file="../common-build.xml"/>
<path id="solr.test.framework.lucene.libs">
<pathelement location="${test-framework.jar}"/>
</path>
<path id="classpath">
<fileset dir="lib" excludes="${common.classpath.excludes}"/>
<path refid="solr.test.framework.lucene.libs" />
<path refid="solr.base.classpath"/>
</path>
<!-- Redefine Lucene test-framework compilation here to avoid circular dependency on compile-core -->
<target name="compile-test-framework">
<ant dir="${common.dir}" target="compile-test-framework" inheritall="false">
<propertyset refid="uptodate.and.compiled.properties"/>
</ant>
</target>
<target name="compile-core" depends="compile-solr-core, compile-test-framework">
<compile srcdir="${src.dir}" destdir="${build.dir}/classes/java">
<classpath refid="test.base.classpath"/>
</compile>
</target>
<!-- Override common-solr.javadocs to include JUnit links -->
<!-- and to copy the built javadocs to ${dest}/docs/api/test-framework -->
<target name="javadocs"
depends="compile-core,jar-test-framework,lucene-javadocs,javadocs-test-framework,define-lucene-javadoc-url">
<sequential>
<mkdir dir="${javadoc.dir}"/>
<!-- NOTE: explicitly not using solr-invoke-javadoc, or attempting to
link to lucene-test-framework because if we did javadoc would
attempt to link class refs in in org.apache.lucene, causing
broken links. (either broken links to things like "Directory" if
lucene-test-framework was first, or broken links to things like
LuceneTestCase if lucene-core was first)
-->
<invoke-javadoc destdir="${javadoc.dir}"
title="${Name} ${version} Test Framework API">
<sources>
<link offline="true" href="${javadoc.link.junit}"
packagelistLoc="${javadoc.packagelist.dir}/junit"/>
<packageset dir="${src.dir}"/>
</sources>
</invoke-javadoc>
<solr-jarify basedir="${javadoc.dir}" destfile="${build.dir}/${final.name}-javadoc.jar"/>
<mkdir dir="${dest}/docs/api/test-framework"/>
<copy todir="${dest}/docs/api/test-framework">
<fileset dir="${javadoc.dir}"/>
</copy>
</sequential>
</target>
<target name="module-jars-to-solr"
depends="jar-test-framework">
<mkdir dir="${build.dir}/lucene-libs"/>
<copy todir="${build.dir}/lucene-libs" preservelastmodified="true" flatten="true" failonerror="true" overwrite="true">
<path refid="solr.test.framework.lucene.libs" />
</copy>
</target>
<target name="dist" depends="module-jars-to-solr, common-solr.dist">
<!-- we're not a contrib, our lucene-libs and go in a special place -->
<mkdir dir="${dist}/test-framework" />
<copy todir="${dist}/test-framework">
<fileset dir="${build.dir}">
<include name="lucene-libs/*.jar" />
</fileset>
<fileset dir=".">
<include name="lib/*" />
<include name="README.txt" />
</fileset>
</copy>
</target>
</project>