lucene/build.xml

435 lines
18 KiB
XML
Raw Normal View History

<?xml version="1.0"?>
<project name="core" default="default" basedir=".">
<property name="junit.includes" value="**/Test*.java"/>
<import file="common-build.xml"/>
<property name="demo.name" value="lucene-demos-${version}"/>
<property name="demo.war.name" value="luceneweb"/>
<property name="javadoc.link" value="http://java.sun.com/j2se/1.4/docs/api/"/>
<!-- Build classpath -->
<path id="classpath">
<pathelement location="${build.dir}/classes/java"/>
</path>
<path id="demo.classpath">
<path refid="classpath"/>
<pathelement location="${build.dir}/classes/demo"/>
</path>
<path id="test.classpath">
<path refid="demo.classpath"/>
<pathelement location="${build.dir}/classes/test"/>
</path>
<path id="junit.classpath">
<pathelement location="${build.dir}/classes/test"/>
<pathelement location="${build.dir}/classes/java"/>
<pathelement location="${build.dir}/classes/demo"/>
<pathelement path="${java.class.path}"/>
</path>
<patternset id="src.dist.patterns"
includes="src/,build.xml,*build*.xml,docs/,*.txt,contrib/,"
excludes="contrib/db/*/lib/,contrib/*/ext-libs/,src/site/build/"
/>
<patternset id="binary.build.dist.patterns"
includes="${final.name}.jar,${demo.war.name}.war,${demo.name}.jar,docs/,contrib/*/*.jar"
/>
<patternset id="binary.root.dist.patterns"
includes="src/demo/,src/jsp/,build.xml,docs/,*.txt"
/>
<!-- ================================================================== -->
<!-- Prepares the build directory -->
<!-- ================================================================== -->
<!-- Overrides common.compile-core to add rmic -->
<target name="compile-core" depends="common.compile-core"
description="Compiles core classes, including rmic">
<rmic classname="org.apache.lucene.search.RemoteSearchable"
base="${build.dir}/classes/java" stubversion="1.2">
<classpath refid="classpath"/>
</rmic>
</target>
<!-- ================================================================== -->
<!-- J A R -->
<!-- ================================================================== -->
<!-- -->
<!-- ================================================================== -->
<target name="jar-demo" depends="compile-demo">
<jar
destfile="${build.dir}/${demo.name}.jar"
basedir="${build.dir}/classes/demo"
excludes="**/*.java"
/>
</target>
<target name="war-demo" depends="jar-core,jar-demo">
<war destfile="${build.dir}/${demo.war.name}.war"
webxml="src/jsp/WEB-INF/web.xml">
<fileset dir="src/jsp" excludes="WEB-INF/web.xml"/>
<lib dir="${build.dir}" includes="${demo.name}.jar"/>
<lib dir="${build.dir}" includes="${final.name}.jar"/>
</war>
</target>
<!-- ================================================================== -->
<!-- B U I L D D E M O -->
<!-- ================================================================== -->
<!-- -->
<!-- ================================================================== -->
<target name="compile-demo" depends="compile-core">
<mkdir dir="${build.dir}/classes/demo"/>
<compile
srcdir="src/demo"
destdir="${build.dir}/classes/demo">
<classpath refid="demo.classpath"/>
</compile>
</target>
<!-- GCJ -->
<target name="gcj" depends="jar,jar-demo">
<exec executable="make" dir="src/gcj" failonerror="true"/>
</target>
<!-- TODO: Remove dependency on demo from test -->
<target name="compile-test" depends="compile-demo,common.compile-test"/>
<!-- ================================================================== -->
<!-- D O C U M E N T A T I O N -->
<!-- ================================================================== -->
<!-- -->
<!-- ================================================================== -->
<target name="docs" description="Build the website">
<echo>DEPRECATED - Doing Nothing. See http://wiki.apache.org/lucene-java/HowToUpdateTheWebsite</echo>
</target>
<target name="javadocs" description="Generate javadoc">
<mkdir dir="${build.dir}/docs/api"/>
<invoke-javadoc
access="protected"
destdir="${build.dir}/docs/api"
/>
</target>
<target name="javadocs-internal">
<mkdir dir="${build.dir}/docs/api-internal"/>
<invoke-javadoc
access="package"
destdir="${build.dir}/docs/api-internal"
/>
</target>
<!-- ================================================================== -->
<!-- D I S T R I B U T I O N -->
<!-- ================================================================== -->
<!-- -->
<!-- ================================================================== -->
<target name="package" depends="jar-core, javadocs, war-demo, build-contrib, init-dist">
</target>
<target name="nightly" depends="test, package-tgz">
</target>
<!-- ================================================================== -->
<!-- Packages the distribution with zip -->
<!-- ================================================================== -->
<!-- -->
<!-- ================================================================== -->
<target name="package-zip" depends="package"
description="--> Generates the Lucene distribution as .zip">
<delete file="${dist.dir}/lucene-${version}.zip"/>
<zip destfile="${dist.dir}/lucene-${version}.zip">
<zipfileset prefix="lucene-${version}" dir=".">
<patternset refid="binary.root.dist.patterns"/>
</zipfileset>
<zipfileset prefix="lucene-${version}" dir="${build.dir}">
<patternset refid="binary.build.dist.patterns"/>
</zipfileset>
</zip>
</target>
<!-- ================================================================== -->
<!-- packages the distribution with tar-gzip -->
<!-- ================================================================== -->
<!-- -->
<!-- ================================================================== -->
<target name="package-tgz" depends="package"
description="--> Generates the lucene distribution as .tar.gz">
<delete file="${build.dir}/lucene-${version}.tar"/>
<delete file="${dist.dir}/lucene-${version}.tar.gz"/>
<tar tarfile="${build.dir}/lucene-${version}.tar">
<tarfileset prefix="lucene-${version}" dir=".">
<patternset refid="binary.root.dist.patterns"/>
</tarfileset>
<tarfileset prefix="lucene-${version}" dir="${build.dir}">
<patternset refid="binary.build.dist.patterns"/>
</tarfileset>
</tar>
<gzip zipfile="${dist.dir}/lucene-${version}.tar.gz"
src="${build.dir}/lucene-${version}.tar"
/>
</target>
<!-- ================================================================== -->
<!-- packages the distribution with zip and tar-gzip -->
<!-- ================================================================== -->
<!-- -->
<!-- ================================================================== -->
<target name="package-all-binary" depends="package-zip, package-tgz"
description="--> Generates the .tar.gz and .zip distributions"/>
<!-- ================================================================== -->
<!-- same as package-all. it is just here for compatibility. -->
<!-- ================================================================== -->
<!-- -->
<!-- ================================================================== -->
<target name="dist" depends="package-all-binary"/>
<!-- ================================================================== -->
<!-- S O U R C E D I S T R I B U T I O N -->
<!-- ================================================================== -->
<target name="init-dist" >
<!-- Package is not called first if packaging src standalone, so the dist.dir may not exist -->
<mkdir dir="${build.dir}"/>
<mkdir dir="${dist.dir}"/>
</target>
<!-- ================================================================== -->
<!-- Packages the sources with zip -->
<!-- ================================================================== -->
<!-- -->
<!-- ================================================================== -->
<target name="package-zip-src" depends="init, init-dist"
description="--> Generates the Lucene sources as .zip">
<zip destfile="${dist.dir}/lucene-${version}-src.zip">
<zipfileset prefix="lucene-${version}" dir=".">
<patternset refid="src.dist.patterns"/>
</zipfileset>
</zip>
</target>
<!-- ================================================================== -->
<!-- Packages the sources with tar-gzip -->
<!-- ================================================================== -->
<!-- -->
<!-- ================================================================== -->
<target name="package-tgz-src" depends="init, init-dist"
description="--> Generates the Lucene distribution as .tar.gz">
<delete file="${build.dir}/lucene-${version}-src.tar"/>
<delete file="${dist.dir}/lucene-${version}-src.tar.gz"/>
<tar tarfile="${build.dir}/lucene-${version}-src.tar">
<tarfileset prefix="lucene-${version}" dir=".">
<patternset refid="src.dist.patterns"/>
</tarfileset>
</tar>
<gzip zipfile="${dist.dir}/lucene-${version}-src.tar.gz"
src="${build.dir}/lucene-${version}-src.tar"
/>
</target>
<!-- ================================================================== -->
<!-- Packages the sources with zip and tar-gzip -->
<!-- ================================================================== -->
<!-- -->
<!-- ================================================================== -->
<target name="package-all-src" depends="package-zip-src, package-tgz-src"
description="--> Generates the .tar.gz and .zip source distributions"/>
<!-- ================================================================== -->
<!-- same as package-all-src. it is just here for compatibility. -->
<!-- ================================================================== -->
<!-- -->
<!-- ================================================================== -->
<target name="dist-src" depends="package-all-src"/>
<target name="dist-all" depends="dist, dist-src"/>
<!-- ================================================================== -->
<!-- Build the JavaCC files into the source tree -->
<!-- ================================================================== -->
<target name="jjdoc">
<mkdir dir="${build.dir}/docs/grammars"/>
<jjdoc target="src/java/org/apache/lucene/queryParser/QueryParser.jj"
outputfile="${build.dir}/docs/grammars/QueryParser.html"
javacchome="${javacc.home}"
/>
<jjdoc target="src/java/org/apache/lucene/analysis/standard/StandardTokenizer.jj"
outputfile="${build.dir}/docs/grammars/StandardTokenizer.html"
javacchome="${javacc.home}"
/>
<jjdoc target="src/demo/org/apache/lucene/demo/html/HTMLParser.jj"
outputfile="${build.dir}/docs/grammars/HTMLParser.html"
javacchome="${javacc.home}"
/>
</target>
<target name="clean-javacc">
<delete>
<fileset dir="src">
<include name="java/org/apache/lucene/analysis/standard/StandardTokenizer.java"/>
<include name="java/org/apache/lucene/queryParser/QueryParser.java"/>
<include name="java/org/apache/lucene/queryParser/CharStream.java"/>
<include name="demo/org/apache/lucene/demo/html/HTMLParser.java"/>
<include name="demo/org/apache/lucene/demo/html/SimpleCharStream.java"/>
</fileset>
</delete>
</target>
<target name="javacc" depends="clean-javacc,javacc-StandardAnalyzer,javacc-QueryParser,javacc-HTMLParser"/>
<target name="javacc-StandardAnalyzer" depends="init,javacc-check" if="javacc.present">
<!-- generate this in a build directory so we can exclude ParseException -->
<mkdir dir="${build.dir}/gen/org/apache/lucene/analysis/standard"/>
<invoke-javacc target="src/java/org/apache/lucene/analysis/standard/StandardTokenizer.jj"
outputDir="${build.dir}/gen/org/apache/lucene/analysis/standard"
/>
<copy todir="src/java/org/apache/lucene/analysis/standard">
<fileset dir="${build.dir}/gen/org/apache/lucene/analysis/standard">
<include name="*.java"/>
<exclude name="ParseException.java"/>
</fileset>
</copy>
</target>
<target name="javacc-QueryParser" depends="init,javacc-check" if="javacc.present">
<invoke-javacc target="src/java/org/apache/lucene/queryParser/QueryParser.jj"
outputDir="src/java/org/apache/lucene/queryParser"
/>
</target>
<target name="javacc-HTMLParser" depends="init,javacc-check" if="javacc.present">
<invoke-javacc target="src/demo/org/apache/lucene/demo/html/HTMLParser.jj"
outputDir="src/demo/org/apache/lucene/demo/html"
/>
</target>
<macrodef name="contrib-crawl">
<attribute name="target" default=""/>
<sequential>
<subant target="@{target}" failonerror="false">
<fileset dir="."
includes="contrib/*/build.xml"
/>
</subant>
</sequential>
</macrodef>
<target name="build-contrib" depends="compile-test">
<contrib-crawl/>
</target>
<target name="test-contrib" depends="compile-test">
<contrib-crawl target="test"/>
</target>
<macrodef name="invoke-javadoc">
<attribute name="access"/>
<attribute name="destdir"/>
<sequential>
<condition property="javadoc-1-5-contrib">
<equals arg1="1.5" arg2="${ant.java.version}" />
</condition>
<dirset dir="contrib/gdata-server/src/core/src/java" id="gdata-server-core">
<include name="**" if="javadoc-1-5-contrib" />
</dirset>
<dirset dir="contrib/gdata-server/src/gom/src/java" id="gdata-server-gom">
<include name="**" if="javadoc-1-5-contrib" />
</dirset>
<dirset dir="contrib/gdata-server/src/hivemind/src/java" id="gdata-server-hivemind">
<include name="**" if="javadoc-1-5-contrib" />
</dirset>
<javadoc
overview="src/java/overview.html"
packagenames="org.apache.lucene.*"
destdir="@{destdir}"
access="@{access}"
encoding="${build.encoding}"
author="true"
version="true"
use="true"
source="${ant.java.version}"
link="${javadoc.link}"
windowtitle="${Name} ${version} API"
doctitle="${Name} ${version} API"
bottom="Copyright &amp;copy; ${year} Apache Software Foundation. All Rights Reserved.">
<tag name="todo" description="To Do:"/>
<!-- TODO: find a dynamic way to do include multiple source roots -->
<packageset dir="src/java"/>
<packageset dir="src/demo"/>
<packageset dir="contrib/analyzers/src/java"/>
<packageset dir="contrib/ant/src/java"/>
<packageset dir="contrib/highlighter/src/java"/>
<packageset dir="contrib/lucli/src/java"/>
<packageset dir="contrib/memory/src/java"/>
<packageset dir="contrib/miscellaneous/src/java"/>
<packageset dir="contrib/similarity/src/java"/>
<packageset dir="contrib/regex/src/java"/>
<packageset dir="contrib/snowball/src/java"/>
<packageset dir="contrib/spellchecker/src/java"/>
<packageset dir="contrib/surround/src/java"/>
<packageset dir="contrib/swing/src/java"/>
<packageset dir="contrib/wordnet/src/java"/>
<packageset dir="contrib/benchmark/src/java"/>
<packageset refid="gdata-server-core" />
<packageset refid="gdata-server-gom" />
<packageset refid="gdata-server-hivemind" />
<group title="Core" packages="org.apache.*:org.apache.lucene.analysis:org.apache.lucene.analysis.standard*"/>
<group title="Demo" packages="org.apache.lucene.demo*"/>
<group title="contrib: Analysis" packages="org.apache.lucene.analysis.*"/>
<group title="contrib: Ant" packages="org.apache.lucene.ant*"/>
<group title="contrib: Benchmark" packages="org.apache.lucene.benchmark*"/>
<group title="contrib: Highlighter" packages="org.apache.lucene.search.highlight*"/>
<group title="contrib: GData Server (Java1.5)" packages="org.apache.lucene.gdata.*"/>
<group title="contrib: Lucli" packages="lucli*"/>
<group title="contrib: Memory" packages="org.apache.lucene.index.memory*"/>
<group title="contrib: Miscellaneous " packages="org.apache.lucene.misc*:org.apache.lucene.queryParser.analyzing*:org.apache.lucene.queryParser.precedence*"/>
<group title="contrib: MoreLikeThis" packages="org.apache.lucene.search.similar*"/>
<group title="contrib: RegEx" packages="org.apache.lucene.search.regex*:org.apache.regexp*"/>
<group title="contrib: Snowball" packages="org.apache.lucene.analysis.snowball*:net.sf.snowball*"/>
<group title="contrib: SpellChecker" packages="org.apache.lucene.search.spell*"/>
<group title="contrib: Surround Parser" packages="org.apache.lucene.queryParser.surround*"/>
<group title="contrib: Swing" packages="org.apache.lucene.swing*"/>
<group title="contrib: WordNet" packages="org.apache.lucene.wordnet*"/>
</javadoc>
</sequential>
</macrodef>
</project>