2008-07-30 15:35:58 -04:00
|
|
|
<?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-dataimporthandler" default="build">
|
|
|
|
|
|
|
|
<property name="solr-path" value="../.." />
|
2009-04-13 16:26:10 -04:00
|
|
|
<property name="tikalibs-path" value="../extraction/lib" />
|
|
|
|
|
2008-07-30 15:35:58 -04:00
|
|
|
<import file="../../common-build.xml"/>
|
2010-03-18 00:39:17 -04:00
|
|
|
|
2008-07-30 15:35:58 -04:00
|
|
|
<description>
|
|
|
|
Data Import Handler
|
|
|
|
</description>
|
2009-03-17 03:50:09 -04:00
|
|
|
<path id="classpath.jetty">
|
|
|
|
<!-- jetty -->
|
|
|
|
<fileset dir="${solr-path}/example/lib">
|
|
|
|
<include name="**/*.jar" />
|
|
|
|
</fileset>
|
|
|
|
</path>
|
2008-07-30 15:35:58 -04:00
|
|
|
<path id="common.classpath">
|
2008-12-07 14:07:11 -05:00
|
|
|
<pathelement location="${solr-path}/build/solr" />
|
|
|
|
<pathelement location="${solr-path}/build/solrj" />
|
2009-04-13 16:26:10 -04:00
|
|
|
<fileset dir="${solr-path}/lib" includes="*.jar"/>
|
2010-03-18 00:39:17 -04:00
|
|
|
<path refid="lucene.classpath"/>
|
2008-07-30 15:35:58 -04:00
|
|
|
</path>
|
2009-12-11 02:14:12 -05:00
|
|
|
|
2009-12-15 02:49:07 -05:00
|
|
|
<path id="extras.classpath">
|
|
|
|
<pathelement location="${solr-path}/build/solr" />
|
|
|
|
<pathelement location="${solr-path}/build/solrj" />
|
|
|
|
<pathelement location="target/classes" />
|
|
|
|
<fileset dir="${solr-path}/lib" includes="*.jar"/>
|
|
|
|
<fileset dir="lib/" includes="*.jar"/>
|
|
|
|
<fileset dir="${tikalibs-path}" includes="*.jar"/>
|
2010-03-18 01:30:51 -04:00
|
|
|
<path refid="lucene.classpath"/>
|
2009-12-15 02:49:07 -05:00
|
|
|
</path>
|
|
|
|
|
2008-07-30 15:35:58 -04:00
|
|
|
<path id="test.classpath">
|
|
|
|
<path refid="common.classpath" />
|
2009-03-17 03:50:09 -04:00
|
|
|
<path refid="classpath.jetty" />
|
2008-08-09 14:26:16 -04:00
|
|
|
<pathelement path="target/classes" />
|
2008-07-30 15:35:58 -04:00
|
|
|
<pathelement path="target/test-classes" />
|
2010-07-13 17:45:31 -04:00
|
|
|
<pathelement location="${solr-path}/build/tests"/> <!-- include solr test code -->
|
|
|
|
<pathelement location="${solr-path}/../lucene/build/classes/test" /> <!-- include some lucene test code -->
|
2008-08-09 14:26:16 -04:00
|
|
|
<pathelement path="${java.class.path}"/>
|
2008-07-30 15:35:58 -04:00
|
|
|
</path>
|
2009-04-13 16:26:10 -04:00
|
|
|
|
2009-12-15 02:49:07 -05:00
|
|
|
<path id="test.extras.classpath">
|
|
|
|
<path refid="extras.classpath" />
|
|
|
|
<path refid="classpath.jetty" />
|
|
|
|
<pathelement path="target/classes" />
|
|
|
|
<pathelement path="target/extras/classes" />
|
|
|
|
<pathelement path="target/test-classes" />
|
|
|
|
<pathelement path="target/extras/test-classes" />
|
2010-07-13 17:45:31 -04:00
|
|
|
<pathelement location="${solr-path}/build/tests"/> <!-- include solr test code -->
|
|
|
|
<pathelement location="${solr-path}/../lucene/build/classes/test" /> <!-- include some lucene test code -->
|
2009-12-15 02:49:07 -05:00
|
|
|
<pathelement path="${java.class.path}"/>
|
|
|
|
</path>
|
|
|
|
|
2008-07-30 15:35:58 -04:00
|
|
|
<target name="clean">
|
|
|
|
<delete failonerror="false" dir="target"/>
|
2008-08-07 01:47:01 -04:00
|
|
|
<delete failonerror="false">
|
|
|
|
<fileset dir="src/test/resources" includes="**/dataimport.properties" />
|
|
|
|
</delete>
|
2009-04-13 16:26:10 -04:00
|
|
|
<!-- Clean up examples -->
|
|
|
|
<delete failonerror="false">
|
2009-10-12 10:41:51 -04:00
|
|
|
<!-- we no longer copy things into this directory, but we still clean it up
|
|
|
|
the files are still there from a previous checkout
|
|
|
|
-->
|
2009-04-13 16:26:10 -04:00
|
|
|
<fileset dir="${example}/example-DIH/solr/mail/lib" includes="*.jar" />
|
|
|
|
</delete>
|
2008-07-30 15:35:58 -04:00
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="init">
|
|
|
|
<mkdir dir="target/classes"/>
|
2008-08-04 01:56:10 -04:00
|
|
|
<mkdir dir="${build.javadoc}" />
|
2008-08-01 02:26:35 -04:00
|
|
|
<ant dir="../../" inheritall="false" target="compile" />
|
2008-08-13 06:08:04 -04:00
|
|
|
<ant dir="../../" inheritall="false" target="make-manifest" />
|
2008-07-30 15:35:58 -04:00
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="compile" depends="init">
|
|
|
|
<solr-javac destdir="target/classes"
|
|
|
|
classpathref="common.classpath">
|
|
|
|
<src path="src/main/java" />
|
|
|
|
</solr-javac>
|
|
|
|
</target>
|
2009-04-13 16:26:10 -04:00
|
|
|
|
2009-12-15 02:49:07 -05:00
|
|
|
<target name="compileExtras" depends="compile">
|
|
|
|
<solr-javac destdir="target/extras/classes"
|
|
|
|
classpathref="extras.classpath">
|
|
|
|
<src path="src/extras/main/java" />
|
|
|
|
</solr-javac>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="build" depends="compile,compileExtras">
|
2008-08-12 10:24:57 -04:00
|
|
|
<solr-jar destfile="target/${fullnamever}.jar" basedir="target/classes"
|
2010-03-18 00:39:17 -04:00
|
|
|
manifest="../../${dest}/META-INF/MANIFEST.MF" />
|
2009-12-15 02:49:07 -05:00
|
|
|
<solr-jar destfile="target/apache-${ant.project.name}-extras-${version}.jar" basedir="target/extras/classes"
|
2010-03-18 00:39:17 -04:00
|
|
|
manifest="../../${dest}/META-INF/MANIFEST.MF" />
|
2008-07-30 15:35:58 -04:00
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="compileTests" depends="compile">
|
|
|
|
<solr-javac destdir="target/test-classes"
|
|
|
|
classpathref="test.classpath">
|
|
|
|
<src path="src/test/java" />
|
|
|
|
</solr-javac>
|
|
|
|
</target>
|
2009-04-13 16:26:10 -04:00
|
|
|
|
2009-12-15 02:49:07 -05:00
|
|
|
<target name="compileExtrasTests" depends="compileExtras">
|
|
|
|
<solr-javac destdir="target/extras/test-classes"
|
|
|
|
classpathref="test.classpath">
|
|
|
|
<src path="src/extras/test/java" />
|
|
|
|
</solr-javac>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="test" depends="testCore,testExtras"/>
|
|
|
|
|
|
|
|
<target name="testCore" depends="compileTests">
|
2008-08-07 01:47:01 -04:00
|
|
|
<mkdir dir="${junit.output.dir}"/>
|
2008-07-30 15:35:58 -04:00
|
|
|
|
2010-07-22 18:17:16 -04:00
|
|
|
<condition property="runall">
|
|
|
|
<not>
|
|
|
|
<or>
|
|
|
|
<isset property="testcase"/>
|
|
|
|
<isset property="testpackage"/>
|
|
|
|
<isset property="testpackageroot"/>
|
|
|
|
</or>
|
|
|
|
</not>
|
|
|
|
</condition>
|
|
|
|
|
2008-07-30 15:35:58 -04:00
|
|
|
<junit printsummary="on"
|
|
|
|
haltonfailure="no"
|
2010-03-22 14:28:57 -04:00
|
|
|
maxmemory="512M"
|
2008-07-30 15:35:58 -04:00
|
|
|
errorProperty="tests.failed"
|
|
|
|
failureProperty="tests.failed"
|
|
|
|
dir="src/test/resources/"
|
2010-04-13 07:01:46 -04:00
|
|
|
tempdir="${junit.output.dir}"
|
2008-07-30 15:35:58 -04:00
|
|
|
>
|
|
|
|
<formatter type="brief" usefile="false" if="junit.details"/>
|
|
|
|
<classpath refid="test.classpath"/>
|
|
|
|
<formatter type="xml"/>
|
2010-07-22 18:17:16 -04:00
|
|
|
<batchtest fork="yes" todir="${junit.output.dir}" if="runall">
|
2008-07-30 15:35:58 -04:00
|
|
|
<fileset dir="src/test/java" includes="${junit.includes}"/>
|
|
|
|
</batchtest>
|
2008-08-07 01:47:01 -04:00
|
|
|
<batchtest fork="yes" todir="${junit.output.dir}" if="testcase">
|
2008-07-30 15:35:58 -04:00
|
|
|
<fileset dir="src/test/java" includes="**/${testcase}.java"/>
|
|
|
|
</batchtest>
|
2010-07-22 18:17:16 -04:00
|
|
|
<batchtest fork="yes" todir="${junit.output.dir}" if="testpackage">
|
|
|
|
<fileset dir="src/test/java" includes="**/${testpackage}/**/Test*.java,**/${testpackage}/**/*Test.java"/>
|
|
|
|
</batchtest>
|
|
|
|
<batchtest fork="yes" todir="${junit.output.dir}" if="testpackageroot">
|
|
|
|
<fileset dir="src/test/java" includes="**/${testpackageroot}/Test*.java,**/${testpackageroot}/*Test.java"/>
|
|
|
|
</batchtest>
|
2008-07-30 15:35:58 -04:00
|
|
|
</junit>
|
|
|
|
|
|
|
|
<fail if="tests.failed">Tests failed!</fail>
|
|
|
|
</target>
|
2009-04-13 16:26:10 -04:00
|
|
|
|
2009-12-15 02:49:07 -05:00
|
|
|
<target name="testExtras" depends="compileExtrasTests">
|
|
|
|
<mkdir dir="${junit.output.dir}"/>
|
|
|
|
|
2010-07-22 18:17:16 -04:00
|
|
|
<condition property="runall">
|
|
|
|
<not>
|
|
|
|
<or>
|
|
|
|
<isset property="testcase"/>
|
|
|
|
<isset property="testpackage"/>
|
|
|
|
<isset property="testpackageroot"/>
|
|
|
|
</or>
|
|
|
|
</not>
|
|
|
|
</condition>
|
|
|
|
|
2009-12-15 02:49:07 -05:00
|
|
|
<junit printsummary="on"
|
|
|
|
haltonfailure="no"
|
2010-03-22 14:28:57 -04:00
|
|
|
maxmemory="512M"
|
2009-12-15 02:49:07 -05:00
|
|
|
errorProperty="tests.failed"
|
|
|
|
failureProperty="tests.failed"
|
|
|
|
dir="src/extras/test/resources/"
|
|
|
|
>
|
|
|
|
<formatter type="brief" usefile="false" if="junit.details"/>
|
|
|
|
<classpath refid="test.extras.classpath"/>
|
2010-04-11 06:31:34 -04:00
|
|
|
<assertions>
|
|
|
|
<enable package="org.apache.lucene"/>
|
|
|
|
<enable package="org.apache.solr"/>
|
|
|
|
</assertions>
|
2009-12-15 02:49:07 -05:00
|
|
|
<formatter type="xml"/>
|
2010-07-22 18:17:16 -04:00
|
|
|
|
|
|
|
<batchtest fork="yes" todir="${junit.output.dir}" if="runall">
|
2009-12-15 02:49:07 -05:00
|
|
|
<fileset dir="src/extras/test/java" includes="${junit.includes}"/>
|
|
|
|
</batchtest>
|
|
|
|
<batchtest fork="yes" todir="${junit.output.dir}" if="testcase">
|
|
|
|
<fileset dir="src/extras/test/java" includes="**/${testcase}.java"/>
|
|
|
|
</batchtest>
|
2010-07-22 18:17:16 -04:00
|
|
|
<batchtest fork="yes" todir="${junit.output.dir}" if="testpackage">
|
|
|
|
<fileset dir="src/extras/test/java" includes="**/${testpackage}/**/Test*.java,**/${testpackage}/**/*Test.java"/>
|
|
|
|
</batchtest>
|
|
|
|
<batchtest fork="yes" todir="${junit.output.dir}" if="testpackageroot">
|
|
|
|
<fileset dir="src/extras/test/java" includes="**/${testpackageroot}/Test*.java,**/${testpackageroot}/*Test.java"/>
|
|
|
|
</batchtest>
|
|
|
|
|
|
|
|
|
2009-12-15 02:49:07 -05:00
|
|
|
</junit>
|
|
|
|
|
|
|
|
<fail if="tests.failed">Tests failed!</fail>
|
|
|
|
</target>
|
|
|
|
|
2008-07-30 15:35:58 -04:00
|
|
|
<target name="dist" depends="build">
|
|
|
|
<copy todir="../../build/web">
|
|
|
|
<fileset dir="src/main/webapp" includes="**" />
|
|
|
|
</copy>
|
|
|
|
<mkdir dir="../../build/web/WEB-INF/lib"/>
|
|
|
|
<copy file="target/${fullnamever}.jar" todir="${solr-path}/build/web/WEB-INF/lib"></copy>
|
|
|
|
<copy file="target/${fullnamever}.jar" todir="${solr-path}/dist"></copy>
|
2009-12-15 02:49:07 -05:00
|
|
|
<copy file="target/apache-${ant.project.name}-extras-${version}.jar" todir="${solr-path}/dist"></copy>
|
2008-07-30 15:35:58 -04:00
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="javadoc">
|
|
|
|
<sequential>
|
2008-08-04 01:56:10 -04:00
|
|
|
<mkdir dir="${build.javadoc}/contrib-${name}"/>
|
|
|
|
|
|
|
|
<path id="javadoc.classpath">
|
|
|
|
<path refid="common.classpath"/>
|
2009-12-15 02:49:07 -05:00
|
|
|
<path refid="extras.classpath"/>
|
2008-08-04 01:56:10 -04:00
|
|
|
</path>
|
|
|
|
|
|
|
|
<invoke-javadoc
|
|
|
|
destdir="${build.javadoc}/contrib-${name}"
|
|
|
|
title="${Name} ${version} contrib-${fullnamever} API">
|
|
|
|
<sources>
|
|
|
|
<packageset dir="src/main/java"/>
|
2009-12-15 02:49:07 -05:00
|
|
|
<packageset dir="src/extras/main/java"/>
|
2008-08-04 01:56:10 -04:00
|
|
|
</sources>
|
|
|
|
</invoke-javadoc>
|
2008-07-30 15:35:58 -04:00
|
|
|
</sequential>
|
2008-12-06 08:04:26 -05:00
|
|
|
</target>
|
|
|
|
|
2009-10-12 10:41:51 -04:00
|
|
|
<target name="example" depends="build,dist">
|
|
|
|
<!--
|
|
|
|
this target use to copy libs, but that is no longer needed.
|
|
|
|
now we just depend on dist to ensure the extra's jar exists.
|
|
|
|
-->
|
2009-04-13 16:26:10 -04:00
|
|
|
</target>
|
2008-07-30 15:35:58 -04:00
|
|
|
|
|
|
|
</project>
|