mirror of https://github.com/apache/lucene.git
661 lines
28 KiB
XML
661 lines
28 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="core" default="default" basedir="."
|
|
xmlns:artifact="antlib:org.apache.maven.artifact.ant">
|
|
|
|
<property name="junit.includes" value="**/Test*.java"/>
|
|
|
|
<import file="common-build.xml"/>
|
|
|
|
<!-- Build classpath -->
|
|
<path id="classpath">
|
|
<pathelement location="${build.dir}/classes/java"/>
|
|
</path>
|
|
|
|
<path id="test.classpath">
|
|
<path refid="classpath"/>
|
|
<path refid="junit-path"/>
|
|
<path refid="ant-path"/>
|
|
<pathelement location="${build.dir}/classes/test-framework"/>
|
|
<pathelement location="${build.dir}/classes/test"/>
|
|
</path>
|
|
|
|
<path id="junit.classpath">
|
|
<path refid="junit-path"/>
|
|
<pathelement location="${build.dir}/classes/test-framework"/>
|
|
<pathelement location="${build.dir}/classes/test"/>
|
|
<pathelement location="${build.dir}/classes/java"/>
|
|
<pathelement path="${java.class.path}"/>
|
|
</path>
|
|
|
|
<patternset id="src.dist.patterns"
|
|
includes="src/,build.xml,*build*.xml,docs/,*.txt,contrib/,*pom.xml*,lib/,backwards/"
|
|
excludes="contrib/db/*/lib/,contrib/*/ext-libs/,src/site/build/"
|
|
/>
|
|
<patternset id="binary.build.dist.patterns"
|
|
includes="${final.name}*.jar,docs/,contrib/*/*.jar,contrib/*/*.war, contrib/*/*/*.jar"
|
|
/>
|
|
<patternset id="binary.root.dist.patterns"
|
|
includes="docs/,*.txt,contrib/*/README*,**/CHANGES.txt"
|
|
/>
|
|
|
|
|
|
<!-- ================================================================== -->
|
|
<!-- Prepares the build directory -->
|
|
<!-- ================================================================== -->
|
|
|
|
<target name="test-core" depends="common.test"
|
|
description="Runs unit tests for the core Lucene code"
|
|
/>
|
|
<target name="test" depends="test-core, test-contrib, test-backwards"
|
|
description="Runs all unit tests (core, contrib and back-compat)"
|
|
/>
|
|
|
|
<path id="backwards.test.compile.classpath">
|
|
<path refid="junit-path"/>
|
|
<path refid="ant-path"/>
|
|
<fileset dir="${backwards.dir}/lib">
|
|
<include name="lucene-core*.jar"/>
|
|
</fileset>
|
|
</path>
|
|
|
|
<path id="backwards.junit.classpath">
|
|
<path refid="junit-path"/>
|
|
<pathelement location="${build.dir.backwards}/classes/test"/>
|
|
<pathelement location="${build.dir}/${final.name}.jar"/>
|
|
<pathelement path="${java.class.path}"/>
|
|
</path>
|
|
|
|
<!-- remove this -->
|
|
<target name="test-tag" depends="test-backwards" description="deprecated"/>
|
|
|
|
<target name="compile-backwards" depends="compile-core, jar-core"
|
|
description="Runs tests of a previous Lucene version.">
|
|
<sequential>
|
|
<mkdir dir="${build.dir.backwards}"/>
|
|
|
|
<!-- compile branch tests against previous version JAR file -->
|
|
<compile-test-macro srcdir="${backwards.dir}/src/test" destdir="${build.dir.backwards}/classes/test"
|
|
test.classpath="backwards.test.compile.classpath" javac.source="${javac.source.backwards}" javac.target="${javac.target.backwards}"/>
|
|
|
|
|
|
</sequential>
|
|
</target>
|
|
|
|
<target name="test-backwards" /><!--add here after 4.0: depends="compile-backwards, junit-backwards-mkdir, junit-backwards-sequential, junit-backwards-parallel"-->
|
|
|
|
<target name="junit-backwards-mkdir">
|
|
<mkdir dir="${build.dir.backwards}/test"/>
|
|
</target>
|
|
|
|
<macrodef name="backwards-test-macro">
|
|
<attribute name="threadNum" default="1"/>
|
|
<attribute name="threadTotal" default="1"/>
|
|
<sequential>
|
|
<!-- run branch tests against trunk jar -->
|
|
<test-macro
|
|
dataDir="${backwards.dir}/src/test"
|
|
tempDir="${build.dir.backwards}/test"
|
|
junit.classpath="backwards.junit.classpath"
|
|
junit.output.dir="${junit.output.dir.backwards}"
|
|
threadNum="@{threadNum}"
|
|
threadTotal="@{threadTotal}"/>
|
|
</sequential>
|
|
</macrodef>
|
|
|
|
<target name="junit-backwards-sequential" if="tests.sequential">
|
|
<backwards-test-macro/>
|
|
</target>
|
|
|
|
<target name="junit-backwards-parallel" unless="tests.sequential">
|
|
<parallel threadsPerProcessor="${tests.threadspercpu}">
|
|
<backwards-test-macro threadNum="1" threadTotal="8"/>
|
|
<backwards-test-macro threadNum="2" threadTotal="8"/>
|
|
<backwards-test-macro threadNum="3" threadTotal="8"/>
|
|
<backwards-test-macro threadNum="4" threadTotal="8"/>
|
|
<backwards-test-macro threadNum="5" threadTotal="8"/>
|
|
<backwards-test-macro threadNum="6" threadTotal="8"/>
|
|
<backwards-test-macro threadNum="7" threadTotal="8"/>
|
|
<backwards-test-macro threadNum="8" threadTotal="8"/>
|
|
</parallel>
|
|
</target>
|
|
|
|
<!-- ================================================================== -->
|
|
<!-- J A R -->
|
|
<!-- ================================================================== -->
|
|
<!-- -->
|
|
<!-- ================================================================== -->
|
|
|
|
<target name="compile-core" depends="jflex-notice, javacc-notice, common.compile-core"/>
|
|
|
|
<!-- ================================================================== -->
|
|
<!-- 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"
|
|
depends="javadocs-all, javadocs-core, javadocs-contrib, javadocs-test-framework">
|
|
<echo file="${javadoc.dir}/index.html" append="false">
|
|
<![CDATA[<html><head><title>${Name} ${version} Javadoc Index</title></head>
|
|
<body>
|
|
<h1>${Name} ${version} Javadoc Index</h1>
|
|
<ul>
|
|
<li><a href="all/index.html">All</a></li>
|
|
<li><a href="core/index.html">Core</a></li>
|
|
<li>Contrib packages:</li>
|
|
<ul>
|
|
]]></echo>
|
|
<contrib-crawl target="javadocs-index.html" failonerror="false"/>
|
|
<echo file="${javadoc.dir}/index.html" append="true"><![CDATA[
|
|
</ul>
|
|
</ul></body>]]></echo>
|
|
</target>
|
|
|
|
<target name="javadocs-core" description="Generate javadoc for core classes">
|
|
<sequential>
|
|
<mkdir dir="${javadoc.dir}/core"/>
|
|
<invoke-javadoc
|
|
destdir="${javadoc.dir}/core"
|
|
title="${Name} ${version} core API">
|
|
<sources>
|
|
<packageset dir="src/java"/>
|
|
<link href=""/>
|
|
</sources>
|
|
</invoke-javadoc>
|
|
<jarify basedir="${javadoc.dir}/core" destfile="${build.dir}/${final.name}-javadoc.jar"/>
|
|
</sequential>
|
|
</target>
|
|
|
|
<target name="javadocs-contrib" description="Generate javadoc for contrib classes">
|
|
<contrib-crawl target="javadocs"
|
|
failonerror="false"/>
|
|
</target>
|
|
|
|
<target name="javadocs-all" description="Generate javadoc for core and contrib classes" depends="build-contrib">
|
|
<sequential>
|
|
<mkdir dir="${javadoc.dir}/all"/>
|
|
<invoke-javadoc
|
|
destdir="${javadoc.dir}/all">
|
|
<sources>
|
|
<!-- TODO: find a dynamic way to do include multiple source roots -->
|
|
<packageset dir="src/java"/>
|
|
|
|
<!-- please keep this list up to date, and in alpha order... -->
|
|
|
|
<!-- ie: `find contrib/* -path \*src/java | sort` -->
|
|
|
|
<!-- if you make changes to the list of package sets, also -->
|
|
<!-- make sure the group list below is updated. -->
|
|
<!-- Also remember to keep site.xml in sync. -->
|
|
|
|
<packageset dir="contrib/ant/src/java"/>
|
|
<packageset dir="contrib/db/bdb-je/src/java"/>
|
|
<packageset dir="contrib/db/bdb/src/java"/>
|
|
<packageset dir="contrib/demo/src/java"/>
|
|
<packageset dir="contrib/highlighter/src/java"/>
|
|
<packageset dir="contrib/instantiated/src/java"/>
|
|
<packageset dir="contrib/lucli/src/java"/>
|
|
<packageset dir="contrib/memory/src/java"/>
|
|
<packageset dir="contrib/misc/src/java"/>
|
|
<packageset dir="contrib/queries/src/java"/>
|
|
<packageset dir="contrib/spatial/src/java"/>
|
|
<packageset dir="contrib/spellchecker/src/java"/>
|
|
<packageset dir="contrib/swing/src/java"/>
|
|
<packageset dir="contrib/wordnet/src/java"/>
|
|
<packageset dir="contrib/xml-query-parser/src/java"/>
|
|
<packageset dir="contrib/queryparser/src/java"/>
|
|
<!-- end alpha sort -->
|
|
|
|
<!-- If the main javadoc Group listing includes an "Other -->
|
|
<!-- Packages" group after the ones listed here, then those -->
|
|
<!-- packages are not being matched by any of these rules -->
|
|
|
|
<group title="Core" packages="org.apache.*:org.apache.lucene.analysis:org.apache.lucene.analysis.standard*:org.apache.lucene.analysis.tokenattributes*"/>
|
|
|
|
<group title="contrib: Ant" packages="org.apache.lucene.ant*"/>
|
|
<group title="contrib: Demo" packages="org.apache.lucene.demo*"/>
|
|
<group title="contrib: ICU" packages="org.apache.lucene.collation*"/>
|
|
<group title="contrib: DB" packages="org.apache.lucene.store.db*:org.apache.lucene.store.je*:com.sleepycat*"/>
|
|
<group title="contrib: Highlighter" packages="org.apache.lucene.search.highlight*:org.apache.lucene.search.vectorhighlight*"/>
|
|
<group title="contrib: Instantiated" packages="org.apache.lucene.store.instantiated*"/>
|
|
<group title="contrib: Lucli" packages="lucli*"/>
|
|
<group title="contrib: Memory" packages="org.apache.lucene.index.memory*"/>
|
|
<group title="contrib: Misc " packages="org.apache.lucene.misc*"/>
|
|
<group title="contrib: Queries" packages="org.apache.lucene.search.similar*:org.apache.lucene.search.regex*:org.apache.regexp*"/>
|
|
<group title="contrib: Query Parser" packages="org.apache.lucene.queryParser.*"/>
|
|
<group title="contrib: Spatial" packages="org.apache.lucene.spatial*"/>
|
|
<group title="contrib: SpellChecker" packages="org.apache.lucene.search.spell*"/>
|
|
<group title="contrib: Swing" packages="org.apache.lucene.swing*"/>
|
|
<group title="contrib: WordNet" packages="org.apache.lucene.wordnet*"/>
|
|
<group title="contrib: XML Query Parser" packages="org.apache.lucene.xmlparser*"/>
|
|
|
|
</sources>
|
|
</invoke-javadoc>
|
|
</sequential>
|
|
</target>
|
|
|
|
|
|
<!-- ================================================================== -->
|
|
<!-- D I S T R I B U T I O N -->
|
|
<!-- ================================================================== -->
|
|
<!-- -->
|
|
<!-- ================================================================== -->
|
|
<target name="package" depends="jar-core, jar-test-framework, javadocs, build-contrib, init-dist, changes-to-html"/>
|
|
|
|
<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 dir="${build.dir}" includes="build-demo.xml" fullpath="lucene-${version}/build.xml"/>
|
|
<zipfileset prefix="lucene-${version}" dir="${build.dir}">
|
|
<patternset refid="binary.build.dist.patterns"/>
|
|
</zipfileset>
|
|
</zip>
|
|
<lucene-checksum file="${dist.dir}/lucene-${version}.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" longfile="gnu">
|
|
<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"
|
|
/>
|
|
<lucene-checksum file="${dist.dir}/lucene-${version}.tar.gz"/>
|
|
</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}"/>
|
|
<mkdir dir="${maven.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>
|
|
<lucene-checksum file="${dist.dir}/lucene-${version}-src.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" longfile="gnu">
|
|
<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"
|
|
/>
|
|
<lucene-checksum file="${dist.dir}/lucene-${version}-src.tar.gz"/>
|
|
</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"/>
|
|
|
|
<target name="generate-maven-artifacts"
|
|
depends="maven.ant.tasks-check, package, jar-src, jar-test-framework-src, javadocs">
|
|
<sequential>
|
|
<ant target="get-maven-poms" dir=".."/>
|
|
|
|
<m2-deploy pom.xml="../pom.xml"/> <!-- Lucene/Solr grandparent POM -->
|
|
<m2-deploy pom.xml="pom.xml"/> <!-- Lucene parent POM -->
|
|
<m2-deploy pom.xml="src/pom.xml"> <!-- Lucene core POM -->
|
|
<artifact-attachments>
|
|
<attach file="${build.dir}/${final.name}-src.jar"
|
|
classifier="sources"/>
|
|
<attach file="${build.dir}/${final.name}-javadoc.jar"
|
|
classifier="javadoc"/>
|
|
</artifact-attachments>
|
|
</m2-deploy>
|
|
|
|
<!--
|
|
For the purposes of the generated artifacts, change the <packaging>
|
|
in the test-framework POM from "jar" to "test-jar" - this allows
|
|
artifact:deploy to properly name the artifact. The Maven build doesn't
|
|
have a lifecycle mapping for the "test-jar" packaging, though, so the
|
|
POM in src/test-framework/ is left with the "jar" packaging.
|
|
-->
|
|
<property name="test-jar-packaging-test-framework-pom"
|
|
location="${build.dir}/test-jar-packaging-test-framework,pom"/>
|
|
<copy file="src/test-framework/pom.xml"
|
|
tofile="${test-jar-packaging-test-framework-pom}">
|
|
<filterset begintoken="<packaging>" endtoken="</packaging>">
|
|
<filter token="jar"
|
|
value="<packaging>test-jar</packaging>"/>
|
|
</filterset>
|
|
</copy>
|
|
<artifact:pom id="test-framework-pom"
|
|
file="${test-jar-packaging-test-framework-pom}"/>
|
|
<artifact:deploy file="${build.dir}/${final.name}-tests.jar">
|
|
<attach file="${build.dir}/${final.name}-tests-src.jar"
|
|
classifier="test-sources"/>
|
|
<attach file="${build.dir}/${final.name}-tests-javadoc.jar"
|
|
classifier="test-javadoc"/>
|
|
<remoteRepository url="${m2.repository.url}">
|
|
<authentication username="${m2.repository.username}"
|
|
privateKey="${m2.repository.private.key}"/>
|
|
</remoteRepository>
|
|
<pom refid="test-framework-pom"/>
|
|
</artifact:deploy>
|
|
|
|
<contrib-crawl target="dist-maven"/>
|
|
</sequential>
|
|
</target>
|
|
|
|
<!-- ================================================================== -->
|
|
<!-- support for signing the artifacts using gpg -->
|
|
<!-- ================================================================== -->
|
|
<target name="clean-dist-signatures">
|
|
<delete failonerror="false">
|
|
<fileset dir="${dist.dir}">
|
|
<include name="**/*.asc"/>
|
|
</fileset>
|
|
</delete>
|
|
</target>
|
|
|
|
<target name="sign-artifacts" depends="clean-dist-signatures">
|
|
<available property="gpg.input.handler" classname="org.apache.tools.ant.input.SecureInputHandler"
|
|
value="org.apache.tools.ant.input.SecureInputHandler"/>
|
|
<!--else:--><property name="gpg.input.handler" value="org.apache.tools.ant.input.DefaultInputHandler"/>
|
|
<input message="Enter GPG keystore password: >" addproperty="gpg.passphrase">
|
|
<handler classname="${gpg.input.handler}" />
|
|
</input>
|
|
|
|
<apply executable="${gpg.exe}" inputstring="${gpg.passphrase}"
|
|
dest="${dist.dir}" type="file" maxparallel="1" verbose="yes">
|
|
<arg value="--passphrase-fd"/>
|
|
<arg value="0"/>
|
|
<arg value="--batch"/>
|
|
<arg value="--armor"/>
|
|
<arg value="--default-key"/>
|
|
<arg value="${gpg.key}"/>
|
|
<arg value="--output"/>
|
|
<targetfile/>
|
|
<arg value="--detach-sig"/>
|
|
<srcfile/>
|
|
|
|
<fileset dir="${dist.dir}">
|
|
<include name="**/*.jar"/>
|
|
<include name="**/*.zip"/>
|
|
<include name="**/*.tar.gz"/>
|
|
<include name="**/*.pom"/>
|
|
</fileset>
|
|
<globmapper from="*" to="*.asc"/>
|
|
</apply>
|
|
</target>
|
|
|
|
<!-- ================================================================== -->
|
|
<!-- Build the JavaCC files into the source tree -->
|
|
<!-- ================================================================== -->
|
|
<target name="clean-javacc">
|
|
<delete>
|
|
<fileset dir="src/java/org/apache/lucene/queryParser" includes="*.java">
|
|
<containsregexp expression="Generated.*By.*JavaCC"/>
|
|
</fileset>
|
|
<fileset dir="contrib/queryparser/src/java/org/apache/lucene/queryParser/surround/parser" includes="*.java">
|
|
<containsregexp expression="Generated.*By.*JavaCC"/>
|
|
</fileset>
|
|
<fileset dir="contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/parser" includes="*.java">
|
|
<containsregexp expression="Generated.*By.*JavaCC"/>
|
|
</fileset>
|
|
</delete>
|
|
</target>
|
|
|
|
<target name="javacc" depends="init,javacc-check,clean-javacc,javacc-QueryParser,javacc-contrib-queryparser,javacc-contrib-demo"/>
|
|
|
|
<target name="javacc-QueryParser" depends="init,javacc-check" if="javacc.present">
|
|
<sequential>
|
|
<invoke-javacc target="src/java/org/apache/lucene/queryParser/QueryParser.jj"
|
|
outputDir="src/java/org/apache/lucene/queryParser"/>
|
|
|
|
<!-- Change the inccorrect public ctors for QueryParser to be protected instead -->
|
|
<replaceregexp file="src/java/org/apache/lucene/queryParser/QueryParser.java"
|
|
byline="true"
|
|
match="public QueryParser\(CharStream "
|
|
replace="protected QueryParser(CharStream "/>
|
|
<replaceregexp file="src/java/org/apache/lucene/queryParser/QueryParser.java"
|
|
byline="true"
|
|
match="public QueryParser\(QueryParserTokenManager "
|
|
replace="protected QueryParser(QueryParserTokenManager "/>
|
|
|
|
</sequential>
|
|
</target>
|
|
|
|
<target name="javacc-contrib-queryparser" depends="init,javacc-check" if="javacc.present">
|
|
<ant target="javacc"
|
|
dir="contrib/queryparser"
|
|
antfile="build.xml"
|
|
/>
|
|
</target>
|
|
|
|
<target name="javacc-contrib-demo" depends="init,javacc-check" if="javacc.present">
|
|
<ant target="javacc"
|
|
dir="contrib/demo"
|
|
antfile="build.xml"
|
|
/>
|
|
</target>
|
|
|
|
<macrodef name="createLevAutomaton">
|
|
<attribute name="n"/>
|
|
<sequential>
|
|
<exec dir="src/java/org/apache/lucene/util/automaton"
|
|
executable="${python.exe}" failonerror="true">
|
|
<arg line="createLevAutomata.py @{n}"/>
|
|
</exec>
|
|
</sequential>
|
|
</macrodef>
|
|
|
|
<target name="createLevAutomata" depends="check-moman,clone-moman,pull-moman">
|
|
<createLevAutomaton n="1"/>
|
|
<createLevAutomaton n="2"/>
|
|
</target>
|
|
|
|
<target name="check-moman">
|
|
<condition property="moman.cloned">
|
|
<available file="src/java/org/apache/lucene/util/automaton/moman"/>
|
|
</condition>
|
|
</target>
|
|
|
|
<target name="clone-moman" unless="moman.cloned">
|
|
<exec dir="src/java/org/apache/lucene/util/automaton"
|
|
executable="${hg.exe}" failonerror="true">
|
|
<arg line="clone -r ${moman.rev} ${moman.url} moman"/>
|
|
</exec>
|
|
</target>
|
|
|
|
<target name="pull-moman" if="moman.cloned">
|
|
<exec dir="src/java/org/apache/lucene/util/automaton/moman"
|
|
executable="${hg.exe}" failonerror="true">
|
|
<arg line="pull -f -r ${moman.rev}"/>
|
|
</exec>
|
|
</target>
|
|
|
|
<macrodef name="contrib-crawl">
|
|
<attribute name="target" default=""/>
|
|
<attribute name="failonerror" default="true"/>
|
|
<sequential>
|
|
<subant target="@{target}" failonerror="@{failonerror}">
|
|
<property name="core.compiled" value="true"/>
|
|
<fileset dir="."
|
|
includes="contrib/*/build.xml"
|
|
/>
|
|
</subant>
|
|
</sequential>
|
|
</macrodef>
|
|
|
|
<target name="build-contrib" depends="compile-test"
|
|
description="Builds all contrib modules and their tests">
|
|
<contrib-crawl target="build-artifacts-and-tests"/>
|
|
</target>
|
|
|
|
<target name="test-contrib" depends="build-contrib">
|
|
<contrib-crawl target="test" failonerror="true"/>
|
|
</target>
|
|
|
|
<!-- Macro for building checksum files -->
|
|
<macrodef name="lucene-checksum">
|
|
<attribute name="file"/>
|
|
<sequential>
|
|
<echo>Building checksums for '@{file}'</echo>
|
|
<checksum file="@{file}" algorithm="md5" format="MD5SUM" forceoverwrite="yes" readbuffersize="65536"/>
|
|
<checksum file="@{file}" algorithm="sha1" format="MD5SUM" forceoverwrite="yes" readbuffersize="65536"/>
|
|
</sequential>
|
|
</macrodef>
|
|
|
|
<!--
|
|
compile changes.txt into an html file
|
|
-->
|
|
|
|
<target name="changes-to-html">
|
|
<mkdir dir="${changes.target.dir}"/>
|
|
<exec executable="perl" input="CHANGES.txt" output="${changes.target.dir}/Changes.html" failonerror="true">
|
|
<arg value="${changes.src.dir}/changes2html.pl"/>
|
|
</exec>
|
|
<exec executable="perl" input="contrib/CHANGES.txt" output="${changes.target.dir}/Contrib-Changes.html" failonerror="true">
|
|
<arg value="${changes.src.dir}/changes2html.pl"/>
|
|
</exec>
|
|
<copy todir="${changes.target.dir}">
|
|
<fileset dir="${changes.src.dir}" includes="*.css"/>
|
|
</copy>
|
|
</target>
|
|
|
|
<!--
|
|
Committer helpers
|
|
-->
|
|
|
|
<property name="patch.file" value="${basedir}/../patches/${patch.name}"/>
|
|
<!-- Apply a patch. Assumes patch can be applied in the basedir.
|
|
-Dpatch.name assumes the patch is located in ${basedir}/../patches/${patch.name}
|
|
-Dpatch.file means the patch can be located anywhere on the file system
|
|
-->
|
|
<target name="apply-patch" depends="clean" description="Apply a patch file. Set -Dpatch.file, or -Dpatch.name when the patch is in the directory ../patches/">
|
|
<patch patchfile="${patch.file}" strip="0"/>
|
|
</target>
|
|
|
|
<target name="jar-test-framework" depends="compile-test-framework">
|
|
<jarify basedir="${build.dir}/classes/test-framework" destfile="${build.dir}/${final.name}-tests.jar"
|
|
title="Lucene Search Engine: Test Framework" />
|
|
</target>
|
|
|
|
<target name="javadocs-test-framework">
|
|
<sequential>
|
|
<mkdir dir="${javadoc.dir}/test-framework"/>
|
|
<invoke-javadoc
|
|
destdir="${javadoc.dir}/test-framework"
|
|
title="${Name} ${version} Test Framework API">
|
|
<sources>
|
|
<packageset dir="src/test-framework"/>
|
|
<link href=""/>
|
|
</sources>
|
|
</invoke-javadoc>
|
|
<jarify basedir="${javadoc.dir}/test-framework" destfile="${build.dir}/${final.name}-tests-javadoc.jar"
|
|
title="Lucene Search Engine: Test Framework" />
|
|
</sequential>
|
|
</target>
|
|
|
|
<target name="jar-test-framework-src" depends="init">
|
|
<jarify basedir="${tests-framework.src.dir}" destfile="${build.dir}/${final.name}-tests-src.jar"
|
|
title="Lucene Search Engine: Test Framework" />
|
|
</target>
|
|
|
|
</project>
|