mirror of https://github.com/apache/lucene.git
192 lines
6.9 KiB
XML
192 lines
6.9 KiB
XML
<?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-clustering" default="build">
|
|
|
|
<property name="solr-path" value="../.."/>
|
|
|
|
<import file="../../common-build.xml"/>
|
|
|
|
<description>
|
|
Clustering Integraton
|
|
</description>
|
|
|
|
<property name="download.dir" value="lib/downloads"/>
|
|
<property name="example.local" value="example"/>
|
|
|
|
<path id="common.classpath">
|
|
<fileset dir="lib"/>
|
|
<fileset dir="${download.dir}"/>
|
|
<pathelement location="${solr-path}/build/solr"/>
|
|
<pathelement location="${solr-path}/build/solrj"/>
|
|
<path refid="lucene.classpath"/>
|
|
<fileset dir="${solr-path}/lib" includes="*.jar"/>
|
|
</path>
|
|
|
|
<path id="test.classpath">
|
|
<pathelement path="${dest}/classes"/>
|
|
<pathelement path="${dest}/test-classes"/>
|
|
<pathelement path="${java.class.path}"/>
|
|
<pathelement location="${common-solr.dir}/build/tests"/> <!-- include solr test code -->
|
|
<pathelement location="${common-solr.dir}/../lucene/build/classes/test" /> <!-- include some lucene test code -->
|
|
<path refid="common.classpath"/>
|
|
</path>
|
|
|
|
<target name="clean">
|
|
<delete failonerror="false" dir="${dest}"/>
|
|
|
|
<!-- example doesn't create this anymore, but clean it up
|
|
if it's still there from an old build
|
|
-->
|
|
<delete dir="example/lib" />
|
|
</target>
|
|
<target name="clean-downloads">
|
|
<delete>
|
|
<fileset dir="${download.dir}"/>
|
|
</delete>
|
|
</target>
|
|
|
|
<target name="init">
|
|
<mkdir dir="${dest}/classes"/>
|
|
<mkdir dir="${download.dir}" />
|
|
<mkdir dir="${build.javadoc}"/>
|
|
<ant dir="../../" inheritall="false" target="compileTests"/> <!-- compiles src and tests -->
|
|
<ant dir="../../" inheritall="false" target="make-manifest"/>
|
|
</target>
|
|
|
|
<target name="check-files" depends="proxy.setup">
|
|
<available file="${download.dir}/colt-1.2.0.jar" property="colt.exists"/>
|
|
<available file="${download.dir}/pcj-1.2.jar" property="pcj.exists"/>
|
|
<available file="${download.dir}/nni-1.0.0.jar" property="nni.exists"/>
|
|
<available file="${download.dir}/simple-xml-1.7.3.jar" property="simplexml.exists"/>
|
|
</target>
|
|
<!-- http://mirrors.ibiblio.org/pub/mirrors/maven2/org/simpleframework/simple-xml/1.7.3/simple-xml-1.7.3.jar -->
|
|
<target name="get-colt" depends="check-files" unless="colt.exists">
|
|
<!-- Get the LGPL deps and put them in a separate dir -->
|
|
<get src="http://repo1.maven.org/maven2/colt/colt/1.2.0/colt-1.2.0.jar" dest="${download.dir}/colt-1.2.0.jar"/>
|
|
</target>
|
|
<target name="get-nni" depends="check-files" unless="nni.exists">
|
|
<!-- Get the LGPL deps and put them in a separate dir -->
|
|
<get src="http://download.carrot2.org/maven2/org/carrot2/nni/1.0.0/nni-1.0.0.jar"
|
|
dest="${download.dir}/nni-1.0.0.jar"/>
|
|
</target>
|
|
|
|
<!-- Compile time dep. only -->
|
|
<target name="get-simple-xml" depends="check-files" unless="simplexml.exists">
|
|
<!-- Get the LGPL deps and put them in a separate dir -->
|
|
<get src="http://mirrors.ibiblio.org/pub/mirrors/maven2/org/simpleframework/simple-xml/1.7.3/simple-xml-1.7.3.jar"
|
|
dest="${download.dir}/simple-xml-1.7.3.jar"/>
|
|
|
|
</target>
|
|
<target name="get-pcj" depends="check-files" unless="pcj.exists">
|
|
<!-- Get the LGPL deps and put them in a separate dir -->
|
|
<get src="http://repo1.maven.org/maven2/pcj/pcj/1.2/pcj-1.2.jar" dest="${download.dir}/pcj-1.2.jar"/>
|
|
</target>
|
|
<target name="get-libraries" depends="init, get-colt, get-pcj, get-nni, get-simple-xml"/>
|
|
|
|
<target name="compile" depends="init, get-libraries">
|
|
<solr-javac destdir="${dest}/classes"
|
|
classpathref="common.classpath">
|
|
<src path="src/main/java"/>
|
|
</solr-javac>
|
|
</target>
|
|
|
|
<target name="build" depends="compile">
|
|
<solr-jar destfile="${dest}/${fullnamever}.jar" basedir="${dest}/classes"
|
|
manifest="../../${dest}/META-INF/MANIFEST.MF"/>
|
|
</target>
|
|
|
|
<target name="compileTests" depends="compile">
|
|
<solr-javac destdir="${dest}/test-classes"
|
|
classpathref="test.classpath">
|
|
<src path="src/test/java"/>
|
|
</solr-javac>
|
|
</target>
|
|
|
|
<target name="example" depends="build,dist">
|
|
<!-- this task use to copy lib's but that's no longer needed because
|
|
../lib and ../lib/downloads are now included explicitly by
|
|
example/conf/solrconfig.xml
|
|
-->
|
|
</target>
|
|
|
|
|
|
<target name="test" depends="compileTests">
|
|
<mkdir dir="${junit.output.dir}"/>
|
|
|
|
<junit printsummary="on"
|
|
haltonfailure="no"
|
|
maxmemory="512M"
|
|
errorProperty="tests.failed"
|
|
failureProperty="tests.failed"
|
|
dir="src/test/resources/"
|
|
tempdir="${junit.output.dir}"
|
|
>
|
|
<formatter type="brief" usefile="false" if="junit.details"/>
|
|
<classpath refid="test.classpath"/>
|
|
<assertions>
|
|
<enable package="org.apache.lucene"/>
|
|
<enable package="org.apache.solr"/>
|
|
</assertions>
|
|
<formatter type="xml"/>
|
|
<batchtest fork="yes" todir="${junit.output.dir}" unless="testcase">
|
|
<fileset dir="src/test/java" includes="${junit.includes}">
|
|
<exclude name="**/AbstractClusteringTest*"/>
|
|
</fileset>
|
|
</batchtest>
|
|
<batchtest fork="yes" todir="${junit.output.dir}" if="testcase">
|
|
<fileset dir="src/test/java" includes="**/${testcase}.java"/>
|
|
</batchtest>
|
|
</junit>
|
|
|
|
<fail if="tests.failed">Tests failed!</fail>
|
|
</target>
|
|
|
|
<target name="dist" depends="build">
|
|
<!--
|
|
<copy file="${dest}/${fullnamever}.jar" todir="${solr-path}/build/web/WEB-INF/lib"/>
|
|
<copy todir="${solr-path}/build/web/WEB-INF/lib" flatten="true">
|
|
<fileset dir="lib">
|
|
<include name="**/*.jar"/>
|
|
</fileset>
|
|
</copy>
|
|
-->
|
|
<copy file="${dest}/${fullnamever}.jar" todir="${solr-path}/dist"/>
|
|
</target>
|
|
|
|
<target name="javadoc">
|
|
<sequential>
|
|
<mkdir dir="${build.javadoc}/contrib-${name}"/>
|
|
|
|
<path id="javadoc.classpath">
|
|
<path refid="common.classpath"/>
|
|
</path>
|
|
|
|
<invoke-javadoc
|
|
destdir="${build.javadoc}/contrib-${name}"
|
|
title="${Name} ${version} contrib-${fullnamever} API">
|
|
<sources>
|
|
<packageset dir="src/main/java"/>
|
|
</sources>
|
|
</invoke-javadoc>
|
|
</sequential>
|
|
</target>
|
|
|
|
</project>
|