2001-09-18 12:31:24 -04:00
<?xml version="1.0"?>
2007-06-09 02:09:46 -04:00
<!--
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.
-->
2005-05-06 19:43:54 -04:00
<project name= "core" default= "default" basedir= "." >
2003-09-20 13:45:32 -04:00
2005-05-12 14:11:04 -04:00
<property name= "junit.includes" value= "**/Test*.java" />
2003-09-20 13:45:32 -04:00
2005-05-01 20:11:11 -04:00
<import file= "common-build.xml" />
2003-09-20 13:45:32 -04:00
2007-06-04 00:03:24 -04:00
<property name= "build.demo.template" value= "src/demo/demo-build.template" />
2003-09-10 21:51:33 -04:00
2005-05-06 19:43:54 -04:00
<property name= "demo.name" value= "lucene-demos-${version}" />
2005-05-01 20:11:11 -04:00
<property name= "demo.war.name" value= "luceneweb" />
2003-09-20 13:45:32 -04:00
2007-06-04 21:18:48 -04:00
<!-- Type of checksum to compute for distribution files -->
<property name= "checksum.algorithm" value= "md5" />
2002-09-19 22:17:14 -04:00
<!-- Build classpath -->
<path id= "classpath" >
2003-09-20 13:45:32 -04:00
<pathelement location= "${build.dir}/classes/java" />
2002-09-19 22:17:14 -04:00
</path>
2009-03-20 04:47:25 -04:00
<path id= "tag.classpath" >
<pathelement location= "${build.dir}/${tag}/classes/java" />
</path>
2002-11-07 12:31:27 -05:00
<path id= "demo.classpath" >
<path refid= "classpath" />
2003-09-20 13:45:32 -04:00
<pathelement location= "${build.dir}/classes/demo" />
2002-11-07 12:31:27 -05:00
</path>
2008-01-25 15:27:55 -05:00
2002-11-07 12:31:27 -05:00
<path id= "test.classpath" >
2009-10-06 01:57:20 -04:00
<path refid= "classpath" />
2008-01-25 15:27:55 -05:00
<path refid= "junit-path" />
2003-09-20 13:45:32 -04:00
<pathelement location= "${build.dir}/classes/test" />
2002-11-07 12:31:27 -05:00
</path>
2004-12-05 13:24:35 -05:00
2002-09-19 22:17:14 -04:00
<path id= "junit.classpath" >
2008-01-25 15:27:55 -05:00
<path refid= "junit-path" />
2003-09-20 13:45:32 -04:00
<pathelement location= "${build.dir}/classes/test" />
<pathelement location= "${build.dir}/classes/java" />
2003-09-18 12:56:18 -04:00
<pathelement path= "${java.class.path}" />
2002-09-19 22:17:14 -04:00
</path>
2005-05-01 21:06:14 -04:00
<patternset id= "src.dist.patterns"
2009-03-19 11:08:08 -04:00
includes="src/,build.xml,*build*.xml,docs/,*.txt,contrib/,*pom.xml*,lib/"
2008-10-01 15:22:24 -04:00
excludes="contrib/db/*/lib/,contrib/*/ext-libs/,src/site/build/,contrib/benchmark/temp/**,contrib/benchmark/work/**"
2005-05-01 21:06:14 -04:00
/>
<patternset id= "binary.build.dist.patterns"
2009-08-28 10:00:37 -04:00
includes="${final.name}.jar,${demo.war.name}.war,${demo.name}.jar,docs/,contrib/*/*.jar,contrib/*/*.war, contrib/*/*/*.jar"
2005-05-01 21:06:14 -04:00
/>
<patternset id= "binary.root.dist.patterns"
2009-03-19 11:08:08 -04:00
includes="src/demo/,src/jsp/,docs/,*.txt,contrib/*/README*,**/CHANGES.txt,lib/servlet-api-*.jar"
2007-06-04 00:03:24 -04:00
excludes="${build.demo.template}"
2005-05-01 21:06:14 -04:00
/>
2004-12-05 13:24:35 -05:00
2002-09-19 22:17:14 -04:00
<!-- ================================================================== -->
<!-- Prepares the build directory -->
<!-- ================================================================== -->
2007-05-30 03:18:29 -04:00
<target name= "test-core" depends= "common.test"
description="Runs unit tests for the core Lucene code"
/>
2009-04-02 10:14:42 -04:00
<target name= "test" depends= "test-core, test-contrib, test-tag"
description="Runs all unit tests (core, contrib and back-compat)"
2007-05-30 03:18:29 -04:00
/>
2008-11-08 13:30:37 -05:00
2008-11-10 21:31:50 -05:00
<property name= "tag" value= "${compatibility.tag}" />
2008-11-08 13:30:37 -05:00
<path id= "tag.test.classpath" >
<path refid= "junit-path" />
2009-04-14 17:19:45 -04:00
<pathelement location= "${build.dir}/${tag}/${tag}.jar" />
2008-11-08 13:30:37 -05:00
</path>
<path id= "tag.junit.classpath" >
<path refid= "junit-path" />
<pathelement location= "${build.dir}/${tag}/classes/test" />
2009-03-20 04:47:25 -04:00
<pathelement location= "${build.dir}/${final.name}.jar" />
2008-11-08 13:30:37 -05:00
<pathelement path= "${java.class.path}" />
</path>
<target name= "download-tag"
2009-03-01 05:52:48 -05:00
description="Downloads a previous Lucene version. Specify tag version like this: -Dtag=lucene_2_4_back_compat_tests_20090127">
2008-11-08 13:30:37 -05:00
<sequential >
<mkdir dir= "${tags.dir}/${tag}" />
2008-11-13 13:11:59 -05:00
<exec dir= "${tags.dir}/${tag}" executable= "${svn.exe}"
2008-11-10 21:31:50 -05:00
failifexecutionfails="false">
2009-03-20 04:47:25 -04:00
<arg line= "checkout http://svn.apache.org/repos/asf/lucene/java/tags/${tag}/src/" />
2008-11-08 13:30:37 -05:00
</exec>
</sequential>
</target>
2009-06-14 10:06:52 -04:00
2009-10-08 17:12:38 -04:00
<target name= "test-tag" depends= "download-tag, compile-core, jar-core"
2009-09-30 13:37:49 -04:00
description="Runs tests of a previous Lucene version. Specify tag version like this: -Dtag=branches/lucene_2_9_back_compat_tests">
2009-06-14 10:06:52 -04:00
<sequential >
2009-03-20 04:47:25 -04:00
<available property= "tag.available" file= "${tags.dir}/${tag}/src/test" />
2008-11-10 21:31:50 -05:00
<fail unless= "tag.available" >
Specified tag '${tag}' could not be found in directory '${tags.dir}/${tag}'.
</fail>
2009-03-20 04:47:25 -04:00
<mkdir dir= "${build.dir}/${tag}" />
2009-09-30 13:37:49 -04:00
2009-03-20 04:47:25 -04:00
<!-- first compile tag classes -->
<compile
srcdir="${tags.dir}/${tag}/src/java"
2009-09-30 13:37:49 -04:00
destdir="${build.dir}/${tag}/classes/java"
javac.source="${javac.source.tag}" javac.target="${javac.target.tag}">
2009-03-20 04:47:25 -04:00
<classpath refid= "tag.classpath" />
</compile>
2009-06-14 07:13:04 -04:00
2009-03-20 04:47:25 -04:00
<!-- compile jar for tag -->
<jarify basedir= "${build.dir}/${tag}/classes/java"
destfile="${build.dir}/${tag}/${tag}.jar" />
<!-- compile tag tests against tag jar -->
<compile-test-macro srcdir= "${tags.dir}/${tag}/src/test" destdir= "${build.dir}/${tag}/classes/test"
2009-09-30 13:37:49 -04:00
test.classpath="tag.test.classpath" javac.source="${javac.source.tag}" javac.target="${javac.target.tag}"/>
2009-06-14 10:06:52 -04:00
<!-- run tag tests against trunk jar -->
<test-macro dataDir= "${tags.dir}/${tag}/src/test"
tempDir="${build.dir}/${tag}"
junit.classpath="tag.junit.classpath"/>
</sequential>
2008-11-08 13:30:37 -05:00
</target>
2009-03-20 04:47:25 -04:00
2008-11-08 13:30:37 -05:00
<target name= "clean-tags"
description="Removes contents of the tags directory">
<delete dir= "${tags.dir}" />
</target>
2002-09-19 22:17:14 -04:00
<!-- ================================================================== -->
<!-- J A R -->
<!-- ================================================================== -->
<!-- -->
<!-- ================================================================== -->
2003-09-18 13:42:35 -04:00
<target name= "jar-demo" depends= "compile-demo" >
2007-08-22 19:16:48 -04:00
<sequential >
<build-manifest title= "Lucene Search Engine: demos" />
<jar
destfile="${build.dir}/${demo.name}.jar"
basedir="${build.dir}/classes/demo"
excludes="**/*.java"
manifest="${manifest.file}">
<metainf dir= "${common.dir}" >
<include name= "LICENSE.txt" />
<include name= "NOTICE.txt" />
</metainf>
</jar>
</sequential>
</target>
<target name= "jar-demo-src" depends= "compile-demo" >
<sequential >
<build-manifest title= "Lucene Search Engine: demos" />
<jar
destfile="${build.dir}/${demo.name}-src.jar"
basedir="src/demo"
manifest="${manifest.file}">
<metainf dir= "${common.dir}" >
<include name= "LICENSE.txt" />
<include name= "NOTICE.txt" />
</metainf>
</jar>
</sequential>
2002-09-19 22:17:14 -04:00
</target>
2003-09-18 13:42:35 -04:00
<target name= "war-demo" depends= "jar-core,jar-demo" >
2007-08-22 19:16:48 -04:00
<sequential >
<build-manifest title= "Lucene Search Engine: demos" />
<war destfile= "${build.dir}/${demo.war.name}.war"
webxml="src/jsp/WEB-INF/web.xml"
manifest="${manifest.file}">
<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" />
<metainf dir= "${common.dir}" >
<include name= "LICENSE.txt" />
<include name= "NOTICE.txt" />
</metainf>
</war>
</sequential>
2002-09-19 22:17:14 -04:00
</target>
2007-06-06 20:48:32 -04:00
2002-09-19 22:17:14 -04:00
<!-- ================================================================== -->
<!-- B U I L D D E M O -->
<!-- ================================================================== -->
<!-- -->
<!-- ================================================================== -->
2003-09-18 13:42:35 -04:00
<target name= "compile-demo" depends= "compile-core" >
2003-09-20 13:45:32 -04:00
<mkdir dir= "${build.dir}/classes/demo" />
2002-09-19 22:17:14 -04:00
2005-04-22 06:21:15 -04:00
<compile
2003-09-20 13:45:32 -04:00
srcdir="src/demo"
2005-04-22 06:21:15 -04:00
destdir="${build.dir}/classes/demo">
2002-11-07 12:31:27 -05:00
<classpath refid= "demo.classpath" />
2005-04-22 06:21:15 -04:00
</compile>
2002-09-19 22:17:14 -04:00
</target>
<!-- ================================================================== -->
<!-- D O C U M E N T A T I O N -->
<!-- ================================================================== -->
<!-- -->
<!-- ================================================================== -->
2005-10-08 07:01:09 -04:00
<target name= "docs" description= "Build the website" >
2007-03-09 17:29:00 -05:00
<echo > DEPRECATED - Doing Nothing. See http://wiki.apache.org/lucene-java/HowToUpdateTheWebsite</echo>
2002-09-19 22:17:14 -04:00
</target>
2007-11-14 14:16:19 -05:00
<target name= "javadocs" description= "Generate javadoc"
2009-06-24 10:34:09 -04:00
depends="javadocs-all, javadocs-core, javadocs-demo, javadocs-contrib">
<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>
<li > <a href= "demo/index.html" > Demo</a> </li>
</ul> </body> ]]></echo>
</target>
2007-11-14 14:16:19 -05:00
<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" />
2009-08-26 19:55:23 -04:00
<link href= "" />
2007-11-14 14:16:19 -05:00
</sources>
</invoke-javadoc>
<jarify basedir= "${javadoc.dir}/core" destfile= "${build.dir}/${final.name}-javadoc.jar" />
</sequential>
2002-09-19 22:17:14 -04:00
</target>
2007-11-14 14:16:19 -05:00
<target name= "javadocs-demo" description= "Generate javadoc for demo classes" >
<sequential >
<mkdir dir= "${javadoc.dir}/demo" />
<invoke-javadoc
destdir="${javadoc.dir}/demo"
title="${Name} ${version} demo API">
<sources >
<packageset dir= "src/demo" />
2009-08-26 19:55:23 -04:00
<link href= "" />
2007-11-14 14:16:19 -05:00
</sources>
</invoke-javadoc>
<jarify basedir= "${javadoc.dir}/demo" destfile= "${build.dir}/${demo.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, demo and contrib classes" depends= "build-contrib" >
<sequential >
2008-12-20 04:43:06 -05:00
<mkdir dir= "${javadoc.dir}/all" />
2007-11-14 14:16:19 -05:00
<invoke-javadoc
2008-12-20 04:43:06 -05:00
destdir="${javadoc.dir}/all">
2007-11-14 14:16:19 -05:00
<sources >
<!-- TODO: find a dynamic way to do include multiple source roots -->
<packageset dir= "src/java" />
<packageset dir= "src/demo" />
<!-- please keep this list up to date, and in alpha order... -->
2007-11-19 19:46:27 -05:00
<!-- ie: `find contrib/* - path \*src/java | sort` -->
2007-11-14 14:16:19 -05:00
<!-- 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. -->
2009-07-23 16:27:41 -04:00
<packageset dir= "contrib/analyzers/common/src/java" />
<packageset dir= "contrib/analyzers/smartcn/src/java" />
2007-11-14 14:16:19 -05:00
<packageset dir= "contrib/ant/src/java" />
<packageset dir= "contrib/benchmark/src/java" />
2009-03-19 06:51:55 -04:00
<packageset dir= "contrib/collation/src/java" />
2007-11-14 14:16:19 -05:00
<packageset dir= "contrib/db/bdb-je/src/java" />
<packageset dir= "contrib/db/bdb/src/java" />
2009-07-09 09:06:51 -04:00
<packageset dir= "contrib/fast-vector-highlighter/src/java" />
2007-11-14 14:16:19 -05:00
<packageset dir= "contrib/highlighter/src/java" />
2008-03-31 18:00:57 -04:00
<packageset dir= "contrib/instantiated/src/java" />
2007-11-14 14:16:19 -05:00
<packageset dir= "contrib/lucli/src/java" />
<packageset dir= "contrib/memory/src/java" />
2009-08-28 10:56:58 -04:00
<packageset dir= "contrib/misc/src/java" />
2007-11-14 14:16:19 -05:00
<packageset dir= "contrib/queries/src/java" />
<packageset dir= "contrib/regex/src/java" />
2009-06-15 08:45:05 -04:00
<packageset dir= "contrib/remote/src/java" />
2007-11-14 14:16:19 -05:00
<packageset dir= "contrib/snowball/src/java" />
2009-05-19 01:11:26 -04:00
<packageset dir= "contrib/spatial/src/java" />
2007-11-14 14:16:19 -05:00
<packageset dir= "contrib/spellchecker/src/java" />
<packageset dir= "contrib/surround/src/java" />
<packageset dir= "contrib/swing/src/java" />
2008-01-04 09:29:15 -05:00
<packageset dir= "contrib/wikipedia/src/java" />
2007-11-14 14:16:19 -05:00
<packageset dir= "contrib/wordnet/src/java" />
<packageset dir= "contrib/xml-query-parser/src/java" />
2009-08-02 23:38:44 -04:00
<packageset dir= "contrib/queryparser/src/java" />
2007-11-14 14:16:19 -05:00
<!-- 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 -->
2009-09-10 08:02:01 -04:00
<group title= "Core" packages= "org.apache.*:org.apache.lucene.analysis:org.apache.lucene.analysis.standard*:org.apache.lucene.analysis.tokenattributes*" />
2007-11-14 14:16:19 -05:00
<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*" />
2009-03-19 06:51:55 -04:00
<group title= "contrib: Collation" packages= "org.apache.lucene.collation*" />
2007-11-14 14:16:19 -05:00
<group title= "contrib: DB" packages= "org.apache.lucene.store.db*:org.apache.lucene.store.je*:com.sleepycat*" />
2009-07-09 09:06:51 -04:00
<group title= "contrib: Fast Vector Highlighter" packages= "org.apache.lucene.search.vectorhighlight*" />
2007-11-14 14:16:19 -05:00
<group title= "contrib: Highlighter" packages= "org.apache.lucene.search.highlight*" />
2008-03-31 18:00:57 -04:00
<group title= "contrib: Instantiated" packages= "org.apache.lucene.store.instantiated*" />
2007-11-14 14:16:19 -05:00
<group title= "contrib: Lucli" packages= "lucli*" />
<group title= "contrib: Memory" packages= "org.apache.lucene.index.memory*" />
2009-08-28 10:56:58 -04:00
<group title= "contrib: Misc " packages= "org.apache.lucene.misc*:org.apache.lucene.queryParser.analyzing*:org.apache.lucene.queryParser.precedence*" />
2009-06-19 08:16:52 -04:00
<group title= "contrib: Queries" packages= "org.apache.lucene.search.similar*" />
2009-09-10 03:10:29 -04:00
<group title= "contrib: Query Parser" packages= "org.apache.lucene.queryParser.*" />
2007-11-14 14:16:19 -05:00
<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*" />
2009-05-19 01:11:26 -04:00
<group title= "contrib: Spatial" packages= "org.apache.lucene.spatial*" />
2007-11-14 14:16:19 -05:00
<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*" />
2008-01-04 09:29:15 -05:00
<group title= "contrib: Wikipedia" packages= "org.apache.lucene.wikipedia*" />
2007-11-14 14:16:19 -05:00
<group title= "contrib: WordNet" packages= "org.apache.lucene.wordnet*" />
<group title= "contrib: XML Query Parser" packages= "org.apache.lucene.xmlparser*" />
2009-08-02 23:38:44 -04:00
2007-11-14 14:16:19 -05:00
</sources>
</invoke-javadoc>
</sequential>
2004-08-17 16:38:46 -04:00
</target>
2005-05-01 20:11:11 -04:00
2002-09-19 22:17:14 -04:00
<!-- ================================================================== -->
<!-- D I S T R I B U T I O N -->
<!-- ================================================================== -->
<!-- -->
<!-- ================================================================== -->
2009-09-08 20:00:17 -04:00
<target name= "package" depends= "jar-core, javadocs, war-demo, build-contrib, init-dist, changes-to-html" >
2007-06-04 00:03:24 -04:00
<copy file= "${build.demo.template}" tofile= "${build.dir}/build-demo.xml" >
<filterset begintoken= "@PLACEHOLDER_" endtoken= "@" >
<filter token= "version" value= "${version}" />
<filter token= "javac.source" value= "${javac.source}" />
<filter token= "javac.target" value= "${javac.target}" />
</filterset>
</copy>
2005-05-01 20:51:18 -04:00
</target>
2009-08-26 08:35:59 -04:00
2009-09-08 20:00:17 -04:00
<target name= "nightly" depends= "test, package-tgz" >
2006-01-25 16:45:56 -05:00
</target>
2002-09-19 22:17:14 -04:00
<!-- ================================================================== -->
<!-- Packages the distribution with zip -->
<!-- ================================================================== -->
<!-- -->
<!-- ================================================================== -->
<target name= "package-zip" depends= "package"
2003-09-18 12:56:18 -04:00
description="--> Generates the Lucene distribution as .zip">
2002-09-19 22:17:14 -04:00
2005-05-06 19:43:54 -04:00
<delete file= "${dist.dir}/lucene-${version}.zip" />
<zip destfile= "${dist.dir}/lucene-${version}.zip" >
<zipfileset prefix= "lucene-${version}" dir= "." >
2005-05-01 21:06:14 -04:00
<patternset refid= "binary.root.dist.patterns" />
</zipfileset>
2007-06-04 00:03:24 -04:00
<zipfileset dir= "${build.dir}" includes= "build-demo.xml" fullpath= "lucene-${version}/build.xml" />
2005-05-06 19:43:54 -04:00
<zipfileset prefix= "lucene-${version}" dir= "${build.dir}" >
2005-05-01 21:06:14 -04:00
<patternset refid= "binary.build.dist.patterns" />
</zipfileset>
2003-09-20 13:45:32 -04:00
</zip>
2007-06-04 21:18:48 -04:00
<lucene-checksum file= "${dist.dir}/lucene-${version}.zip" />
2002-09-19 22:17:14 -04:00
</target>
<!-- ================================================================== -->
<!-- packages the distribution with tar - gzip -->
<!-- ================================================================== -->
<!-- -->
<!-- ================================================================== -->
<target name= "package-tgz" depends= "package"
description="--> Generates the lucene distribution as .tar.gz">
2005-05-06 19:43:54 -04:00
<delete file= "${build.dir}/lucene-${version}.tar" />
<delete file= "${dist.dir}/lucene-${version}.tar.gz" />
2009-08-25 18:18:04 -04:00
<tar tarfile= "${build.dir}/lucene-${version}.tar" longfile= "gnu" >
2005-05-06 19:43:54 -04:00
<tarfileset prefix= "lucene-${version}" dir= "." >
2005-05-01 21:06:14 -04:00
<patternset refid= "binary.root.dist.patterns" />
</tarfileset>
2007-06-04 00:03:24 -04:00
<tarfileset dir= "${build.dir}" includes= "build-demo.xml" fullpath= "lucene-${version}/build.xml" />
2005-05-06 19:43:54 -04:00
<tarfileset prefix= "lucene-${version}" dir= "${build.dir}" >
2005-05-01 21:06:14 -04:00
<patternset refid= "binary.build.dist.patterns" />
</tarfileset>
2003-09-20 13:45:32 -04:00
</tar>
2005-05-06 19:43:54 -04:00
<gzip zipfile= "${dist.dir}/lucene-${version}.tar.gz"
src="${build.dir}/lucene-${version}.tar"
2003-09-18 12:56:18 -04:00
/>
2007-06-04 21:18:48 -04:00
<lucene-checksum file= "${dist.dir}/lucene-${version}.tar.gz" />
2002-09-19 22:17:14 -04:00
</target>
<!-- ================================================================== -->
<!-- packages the distribution with zip and tar - gzip -->
<!-- ================================================================== -->
<!-- -->
<!-- ================================================================== -->
2003-09-20 13:45:32 -04:00
<target name= "package-all-binary" depends= "package-zip, package-tgz"
description="--> Generates the .tar.gz and .zip distributions"/>
2002-09-19 22:17:14 -04:00
<!-- ================================================================== -->
<!-- same as package - all. it is just here for compatibility. -->
<!-- ================================================================== -->
<!-- -->
<!-- ================================================================== -->
2003-09-20 13:45:32 -04:00
<target name= "dist" depends= "package-all-binary" />
2002-09-19 22:17:14 -04:00
<!-- ================================================================== -->
<!-- S O U R C E D I S T R I B U T I O N -->
<!-- ================================================================== -->
2006-12-20 22:14:02 -05:00
<target name= "init-dist" >
2006-12-20 22:32:42 -05:00
2006-12-20 22:14:02 -05:00
<!-- Package is not called first if packaging src standalone, so the dist.dir may not exist -->
2006-12-20 22:32:42 -05:00
<mkdir dir= "${build.dir}" />
2006-12-20 22:14:02 -05:00
<mkdir dir= "${dist.dir}" />
2007-06-16 00:45:13 -04:00
<mkdir dir= "${maven.dist.dir}" />
2006-12-20 22:14:02 -05:00
</target>
2002-09-19 22:17:14 -04:00
<!-- ================================================================== -->
<!-- Packages the sources with zip -->
<!-- ================================================================== -->
<!-- -->
<!-- ================================================================== -->
2006-12-20 22:14:02 -05:00
<target name= "package-zip-src" depends= "init, init-dist"
2003-09-18 12:56:18 -04:00
description="--> Generates the Lucene sources as .zip">
2005-05-06 19:43:54 -04:00
<zip destfile= "${dist.dir}/lucene-${version}-src.zip" >
<zipfileset prefix= "lucene-${version}" dir= "." >
2005-05-01 21:06:14 -04:00
<patternset refid= "src.dist.patterns" />
</zipfileset>
2003-09-20 13:45:32 -04:00
</zip>
2007-06-04 21:18:48 -04:00
<lucene-checksum file= "${dist.dir}/lucene-${version}-src.zip" />
2002-09-19 22:17:14 -04:00
</target>
<!-- ================================================================== -->
<!-- Packages the sources with tar - gzip -->
<!-- ================================================================== -->
<!-- -->
<!-- ================================================================== -->
2006-12-20 22:14:02 -05:00
<target name= "package-tgz-src" depends= "init, init-dist"
2003-09-18 12:56:18 -04:00
description="--> Generates the Lucene distribution as .tar.gz">
2002-09-19 22:17:14 -04:00
2005-05-06 19:43:54 -04:00
<delete file= "${build.dir}/lucene-${version}-src.tar" />
<delete file= "${dist.dir}/lucene-${version}-src.tar.gz" />
2009-08-25 18:18:04 -04:00
<tar tarfile= "${build.dir}/lucene-${version}-src.tar" longfile= "gnu" >
2005-05-06 19:43:54 -04:00
<tarfileset prefix= "lucene-${version}" dir= "." >
2005-05-01 21:06:14 -04:00
<patternset refid= "src.dist.patterns" />
</tarfileset>
2003-09-20 13:45:32 -04:00
</tar>
2002-09-19 22:17:14 -04:00
2005-05-06 19:43:54 -04:00
<gzip zipfile= "${dist.dir}/lucene-${version}-src.tar.gz"
src="${build.dir}/lucene-${version}-src.tar"
2005-05-01 21:06:14 -04:00
/>
2007-06-04 21:18:48 -04:00
<lucene-checksum file= "${dist.dir}/lucene-${version}-src.tar.gz" />
2002-09-19 22:17:14 -04:00
</target>
<!-- ================================================================== -->
<!-- Packages the sources with zip and tar - gzip -->
<!-- ================================================================== -->
<!-- -->
<!-- ================================================================== -->
<target name= "package-all-src" depends= "package-zip-src, package-tgz-src"
2003-09-18 13:42:35 -04:00
description="--> Generates the .tar.gz and .zip source distributions"/>
2002-09-19 22:17:14 -04:00
<!-- ================================================================== -->
<!-- same as package - all - src. it is just here for compatibility. -->
<!-- ================================================================== -->
<!-- -->
<!-- ================================================================== -->
2003-09-18 13:42:35 -04:00
<target name= "dist-src" depends= "package-all-src" />
2002-09-19 22:17:14 -04:00
2003-09-20 13:45:32 -04:00
<target name= "dist-all" depends= "dist, dist-src" />
2007-11-14 14:16:19 -05:00
<target name= "generate-maven-artifacts" depends= "maven.ant.tasks-check, package, jar-src, jar-demo-src, javadocs" >
2007-06-16 00:45:13 -04:00
<sequential >
2007-08-22 19:16:48 -04:00
<m2-deploy pom.xml= "lucene-parent-pom.xml.template" />
<m2-deploy pom.xml= "lucene-core-pom.xml.template" >
<artifact-attachments >
<attach file= "${build.dir}/${final.name}-src.jar"
classifier="sources"/>
2007-11-14 14:16:19 -05:00
<attach file= "${build.dir}/${final.name}-javadoc.jar"
classifier="javadoc"/>
2007-08-22 19:16:48 -04:00
</artifact-attachments>
</m2-deploy>
<m2-deploy pom.xml= "lucene-demos-pom.xml.template" >
<artifact-attachments >
<attach file= "${build.dir}/${demo.name}-src.jar"
classifier="sources"/>
2007-11-14 14:16:19 -05:00
<attach file= "${build.dir}/${demo.name}-javadoc.jar"
classifier="javadoc"/>
2007-08-22 19:16:48 -04:00
</artifact-attachments>
</m2-deploy>
<m2-deploy pom.xml= "lucene-contrib-pom.xml.template" />
2007-06-16 00:45:13 -04:00
<contrib-crawl target= "dist-maven" />
</sequential>
</target>
2003-09-18 12:56:18 -04:00
<!-- ================================================================== -->
2003-10-13 10:15:14 -04:00
<!-- Build the JavaCC files into the source tree -->
2003-09-18 12:56:18 -04:00
<!-- ================================================================== -->
2005-03-07 11:08:02 -05:00
<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/demo/org/apache/lucene/demo/html/HTMLParser.jj"
outputfile="${build.dir}/docs/grammars/HTMLParser.html"
javacchome="${javacc.home}"
/>
2009-08-25 18:14:07 -04:00
<jjdoc target= "contrib/surround/src/java/org/apache/lucene/queryParser/surround/parser/QueryParser.jj"
outputfile="${build.dir}/docs/grammars/Surround_QueryParser.html"
javacchome="${javacc.home}"
/>
<jjdoc target= "contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/parser/StandardSyntaxParser.jj"
outputfile="${build.dir}/docs/grammars/StandardSyntaxParser.html"
javacchome="${javacc.home}"
/>
2005-03-07 11:08:02 -05:00
</target>
2005-03-07 15:28:25 -05:00
<target name= "clean-javacc" >
<delete >
2007-03-13 16:50:56 -04:00
<fileset dir= "src/java/org/apache/lucene/analysis/standard" includes= "*.java" >
<containsregexp expression= "Generated.*By.*JavaCC" />
<exclude name= "ParseException.java" />
</fileset>
<fileset dir= "src/java/org/apache/lucene/queryParser" includes= "*.java" >
<containsregexp expression= "Generated.*By.*JavaCC" />
</fileset>
2009-08-25 18:14:07 -04:00
<fileset dir= "contrib/surround/src/java/org/apache/lucene/queryParser/surround/parser" includes= "*.java" >
<containsregexp expression= "Generated.*By.*JavaCC" />
</fileset>
2009-08-21 19:19:26 -04:00
<fileset dir= "contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/parser" includes= "*.java" >
<containsregexp expression= "Generated.*By.*JavaCC" />
</fileset>
2007-03-13 16:50:56 -04:00
<fileset dir= "src/demo/org/apache/lucene/demo/html" includes= "*.java" >
<containsregexp expression= "Generated.*By.*JavaCC" />
2005-03-07 15:28:25 -05:00
</fileset>
</delete>
</target>
2009-10-11 13:35:09 -04:00
<target name= "javacc" depends= "clean-javacc,javacc-QueryParser,javacc-HTMLParser,javacc-contrib-queryparser, javacc-contrib-surround, javacc-contrib-precedence" />
2003-09-18 12:56:18 -04:00
<target name= "javacc-QueryParser" depends= "init,javacc-check" if= "javacc.present" >
2009-10-23 16:25:17 -04:00
<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>
2009-08-25 18:14:07 -04:00
</target>
2005-03-07 11:08:02 -05:00
<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"
/>
2003-09-18 12:56:18 -04:00
</target>
2009-08-21 19:19:26 -04:00
<target name= "javacc-contrib-queryparser" depends= "init,javacc-check" if= "javacc.present" >
<ant target= "javacc"
dir="contrib/queryparser"
antfile="build.xml"
/>
</target>
2009-08-25 18:14:07 -04:00
<target name= "javacc-contrib-surround" depends= "init,javacc-check" if= "javacc.present" >
<ant target= "javacc"
dir="contrib/surround"
antfile="build.xml"
/>
</target>
2005-04-26 00:41:54 -04:00
2009-10-11 13:35:09 -04:00
<target name= "javacc-contrib-precedence" depends= "init,javacc-check" if= "javacc.present" >
<ant target= "javacc"
dir="contrib/misc"
antfile="build.xml"
/>
</target>
2007-08-08 18:26:44 -04:00
<!-- ================================================================== -->
<!-- Build the JFlex files into the source tree -->
<!-- ================================================================== -->
<target name= "jflex" depends= "clean-jflex,jflex-StandardAnalyzer" />
<target name= "jflex-StandardAnalyzer" depends= "init,jflex-check" if= "jflex.present" >
<taskdef classname= "JFlex.anttask.JFlexTask" name= "jflex" >
<classpath location= "${jflex.home}/lib/JFlex.jar" />
</taskdef>
<jflex file= "src/java/org/apache/lucene/analysis/standard/StandardTokenizerImpl.jflex"
outdir="src/java/org/apache/lucene/analysis/standard"
nobak="on" />
</target>
<target name= "clean-jflex" >
<delete >
<fileset dir= "src/java/org/apache/lucene/analysis/standard" includes= "*.java" >
<containsregexp expression= "generated.*by.*JFlex" />
</fileset>
</delete>
</target>
2005-05-01 20:11:11 -04:00
<macrodef name= "contrib-crawl" >
<attribute name= "target" default= "" />
2007-05-30 03:18:29 -04:00
<attribute name= "failonerror" default= "true" />
2005-05-01 20:11:11 -04:00
<sequential >
2007-05-30 03:18:29 -04:00
<subant target= "@{target}" failonerror= "@{failonerror}" >
2005-05-01 20:11:11 -04:00
<fileset dir= "."
includes="contrib/*/build.xml"
/>
</subant>
</sequential>
</macrodef>
2007-06-11 15:29:41 -04:00
<target name= "build-contrib"
description="Builds all contrib modules and their tests">
<contrib-crawl target= "build-artifacts-and-tests" />
2005-04-26 00:41:54 -04:00
</target>
2003-09-10 21:51:33 -04:00
2009-06-14 10:06:52 -04:00
<target name= "test-contrib" depends= "build-contrib" >
2007-06-11 15:29:41 -04:00
<!-- Don't fail on error, instead check for flag file so we run
2007-05-30 03:18:29 -04:00
all the tests possible and can "ant generate-test-reports"
2007-06-11 15:29:41 -04:00
for all of them.
Because of this, we depend on "build-contrib" even though the
Individual contrib "test" targets probably have the
neccessary dependencies. If they fail to compile, we won't
know about it.
2007-05-30 03:18:29 -04:00
-->
<contrib-crawl target= "test" failonerror= "false" />
<available property= "contribs.failed" file= "junitfailed.flag" >
<filepath >
<dirset dir= "${build.dir}/contrib/" >
<include name= "**/test/" />
</dirset>
</filepath>
</available>
<fail if= "contribs.failed" > Contrib tests failed!</fail>
2005-05-12 14:11:04 -04:00
</target>
2007-06-04 21:18:48 -04:00
<!-- Macro for building checksum files
This is only needed until the "format" option is supported
by ant's built in checksum task
-->
<macrodef name= "lucene-checksum" >
<attribute name= "file" />
<!-- NOTE: we use the value of @{file} in the names any properties
set because macro's don't have variables, and otherwise we
wouldn't be able to checksum more then one file per build
-->
<sequential >
<checksum file= "@{file}"
property="@{file}.sum"
algorithm="${checksum.algorithm}" />
<basename file= "@{file}" property= "@{file}.base" />
<concat destfile= "@{file}.${checksum.algorithm}"
force="yes"
append="false"
fixlastline="yes">
<header trimleading= "yes" > ${@{file}.sum} </header>
<!-- empty fileset to trick concat -->
<fileset dir= "." excludes= "**" />
<footer trimleading= "yes" > ${@{file}.base}
</footer>
</concat>
</sequential>
</macrodef>
2007-08-23 09:17:49 -04:00
2008-02-05 08:02:12 -05:00
<!--
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>
2009-09-06 21:00:21 -04:00
<exec executable= "perl" input= "contrib/CHANGES.txt" output= "${changes.target.dir}/Contrib-Changes.html" failonerror= "true" >
<arg value= "${changes.src.dir}/changes2html.pl" />
</exec>
2008-02-05 08:02:12 -05:00
<copy todir= "${changes.target.dir}" >
<fileset dir= "${changes.src.dir}" includes= "*.css" />
</copy>
</target>
2007-08-23 09:17:49 -04:00
<!--
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>
2008-09-24 05:52:59 -04:00
<target name= "rat-sources-typedef" >
<typedef resource= "org/apache/rat/anttasks/antlib.xml" uri= "antlib:rat.anttasks" >
<classpath >
<fileset dir= "." includes= "rat*.jar" />
</classpath>
</typedef>
</target>
<target name= "rat-sources" depends= "rat-sources-typedef"
description="runs the tasks over src/java">
<rat:report xmlns:rat= "antlib:org.apache.rat.anttasks" >
<fileset dir= "src/java" >
</fileset>
</rat:report>
</target>
2001-09-11 17:44:36 -04:00
</project>