4     Licensed to the Apache Software Foundation (ASF) under one or more
 
   5     contributor license agreements.  See the NOTICE file distributed with
 
   6     this work for additional information regarding copyright ownership.
 
   7     The ASF licenses this file to You under the Apache License, Version 2.0
 
   8     the "License"); you may not use this file except in compliance with
 
   9     the License.  You may obtain a copy of the License at
 
  11         http://www.apache.org/licenses/LICENSE-2.0
 
  13     Unless required by applicable law or agreed to in writing, software
 
  14     distributed under the License is distributed on an "AS IS" BASIS,
 
  15     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
  16     See the License for the specific language governing permissions and
 
  17     limitations under the License.
 
  20 <project name="core" default="default" basedir="."
 
  21          xmlns:artifact="antlib:org.apache.maven.artifact.ant">
 
  23   <property name="junit.includes" value="**/Test*.java"/>
 
  25   <import file="common-build.xml"/>
 
  27   <!-- Build classpath -->
 
  29     <pathelement location="${build.dir}/classes/java"/>
 
  32   <path id="demo.classpath">
 
  33     <path refid="classpath"/>
 
  34     <pathelement location="${build.dir}/classes/demo"/>
 
  37   <path id="test.classpath">
 
  38         <path refid="classpath"/>
 
  39     <path refid="junit-path"/>
 
  40     <pathelement location="${build.dir}/classes/test-framework"/>
 
  41     <pathelement location="${build.dir}/classes/test"/>
 
  44   <path id="junit.classpath">
 
  45     <path refid="junit-path"/>
 
  46     <pathelement location="${build.dir}/classes/test-framework"/>
 
  47     <pathelement location="${build.dir}/classes/test"/>
 
  48     <pathelement location="${build.dir}/classes/java"/>
 
  49     <pathelement path="${java.class.path}"/>
 
  52   <patternset id="binary.build.dist.patterns"
 
  53               includes="${final.name}*.jar,lucene-test-framework*.jar,docs/,contrib/*/*.jar,contrib/*/*.war, contrib/*/*/*.jar"
 
  56   <patternset id="binary.root.dist.patterns"
 
  57               includes="CHANGES.txt,LICENSE.txt,NOTICE.txt,README.txt,MIGRATE.txt,JRE_VERSION_MIGRATION.txt,contrib/**/README*,**/CHANGES.txt,contrib/**/*.sh contrib/**/docs/ contrib/xml-query-parser/*.dtd,lib/*.jar,lib/*LICENSE*.txt,lib/*NOTICE*.txt,contrib/*/lib/*.jar,contrib/*/lib/*LICENSE*.txt,contrib/*/lib/*NOTICE*.txt"
 
  61   <!-- ================================================================== -->
 
  62   <!-- Prepares the build directory                                       -->
 
  63   <!-- ================================================================== -->
 
  65   <target name="test-core" depends="common.test"
 
  66           description="Runs unit tests for the core Lucene code"
 
  68   <target name="test" depends="test-core, test-contrib, test-backwards"
 
  69           description="Runs all unit tests (core, contrib and back-compat)"
 
  72   <path id="backwards.test.compile.classpath">
 
  73     <path refid="junit-path"/>
 
  74     <path refid="ant-path"/>
 
  75     <fileset dir="${backwards.dir}/lib">
 
  76       <include name="lucene-core*.jar"/>
 
  80   <path id="backwards.junit.classpath">
 
  81     <path refid="junit-path"/>
 
  82     <path refid="classpath"/>
 
  83     <pathelement location="${build.dir.backwards}/classes/test"/>
 
  84     <pathelement path="${java.class.path}"/>
 
  88   <target name="test-tag" depends="test-backwards" description="deprecated"/>
 
  90   <target name="compile-backwards" depends="compile-core"
 
  91         description="Runs tests of a previous Lucene version.">
 
  93       <mkdir dir="${build.dir.backwards}"/>       
 
  95       <!-- compile branch tests against previous version JAR file -->   
 
  96       <compile-test-macro srcdir="${backwards.dir}/src/test-framework" destdir="${build.dir.backwards}/classes/test"
 
  97                   test.classpath="backwards.test.compile.classpath" javac.source="${javac.source.backwards}" javac.target="${javac.target.backwards}"/>
 
  98       <compile-test-macro srcdir="${backwards.dir}/src/test" destdir="${build.dir.backwards}/classes/test"
 
  99                   test.classpath="backwards.test.compile.classpath" javac.source="${javac.source.backwards}" javac.target="${javac.target.backwards}"/>
 
 105   <target name="test-backwards" depends="compile-backwards, backwards-test-warning, junit-backwards-mkdir, junit-backwards-sequential, junit-backwards-parallel"/>
 
 107   <target name="junit-backwards-mkdir">
 
 108     <mkdir dir="${build.dir.backwards}/test"/>
 
 111   <target name="check-backwards-params">
 
 112     <condition property="backwards.ignoring.params">
 
 114         <istrue value="${tests.nightly}"/>
 
 115         <not><equals arg1="${tests.multiplier}" arg2="1"/></not>
 
 120   <target name="backwards-test-warning" depends="check-backwards-params" if="backwards.ignoring.params">
 
 122        Warning: Ignoring your multiplier and nightly settings for backwards tests.
 
 123        These tests are for API compatibility only!
 
 127   <macrodef name="backwards-test-macro">
 
 128         <attribute name="threadNum" default="1"/>
 
 129         <attribute name="threadTotal" default="1"/>
 
 131           <!-- run branch tests against trunk jar:
 
 132           Note: we disable multiplier/nightly because the purpose is to find API breaks
 
 135         dataDir="${backwards.dir}/src/test" 
 
 136         tempDir="${build.dir.backwards}/test" 
 
 137         junit.classpath="backwards.junit.classpath" 
 
 138         junit.output.dir="${junit.output.dir.backwards}" 
 
 139         tests.nightly="false"
 
 141         threadNum="@{threadNum}" 
 
 142         threadTotal="@{threadTotal}"/>
 
 146   <target name="junit-backwards-sequential" if="tests.sequential">
 
 147     <backwards-test-macro/>
 
 150   <target name="junit-backwards-parallel" unless="tests.sequential">
 
 151     <parallel threadsPerProcessor="${tests.threadspercpu}">
 
 152      <backwards-test-macro threadNum="1" threadTotal="8"/>
 
 153      <backwards-test-macro threadNum="2" threadTotal="8"/>
 
 154      <backwards-test-macro threadNum="3" threadTotal="8"/>
 
 155      <backwards-test-macro threadNum="4" threadTotal="8"/>
 
 156      <backwards-test-macro threadNum="5" threadTotal="8"/>
 
 157      <backwards-test-macro threadNum="6" threadTotal="8"/>
 
 158      <backwards-test-macro threadNum="7" threadTotal="8"/>
 
 159      <backwards-test-macro threadNum="8" threadTotal="8"/>
 
 163   <!-- ================================================================== -->
 
 165   <!-- ================================================================== -->
 
 167   <!-- ================================================================== -->
 
 169   <target name="compile-core" depends="jflex-notice, javacc-notice, common.compile-core"/>
 
 171   <!-- ================================================================== -->
 
 172   <!-- D O C U M E N T A T I O N                                          -->
 
 173   <!-- ================================================================== -->
 
 175   <!-- ================================================================== -->
 
 177   <!-- copies the docs over to the docs folder -->
 
 178     <copy todir="build/docs">
 
 179       <fileset dir="src/site/build/site"/> 
 
 183   <target name="javadoc" depends="javadocs"/>
 
 184   <target name="javadocs" description="Generate javadoc" 
 
 185           depends="javadocs-all, javadocs-core, javadocs-contrib, javadocs-test-framework">
 
 186     <echo file="${javadoc.dir}/index.html" append="false">
 
 187 <![CDATA[<html><head><title>${Name} ${version} Javadoc Index</title></head>
 
 189 <h1>${Name} ${version} Javadoc Index</h1>
 
 191   <li><a href="all/index.html">All</a></li>
 
 192   <li><a href="core/index.html">Core</a></li>
 
 193   <li><a href="test-framework/index.html">Test Framework</a></li>
 
 194   <li>Contrib packages:</li>
 
 197     <contrib-crawl target="javadocs-index.html" failonerror="false"/>
 
 198     <echo file="${javadoc.dir}/index.html" append="true"><![CDATA[
 
 200 </ul></body>]]></echo>
 
 203   <target name="javadocs-core" description="Generate javadoc for core classes">
 
 205       <mkdir dir="${javadoc.dir}/core"/>
 
 207         destdir="${javadoc.dir}/core"
 
 208         title="${Name} ${version} core API">
 
 210           <packageset dir="src/java"/>
 
 214      <jarify basedir="${javadoc.dir}/core" destfile="${build.dir}/${final.name}-javadoc.jar"/>
 
 218   <target name="javadocs-contrib" description="Generate javadoc for contrib classes">
 
 219     <contrib-crawl target="javadocs"
 
 220                    failonerror="false"/>
 
 223   <target name="javadocs-all" description="Generate javadoc for core and contrib classes">
 
 225       <mkdir dir="${javadoc.dir}/all"/>
 
 227       <path id="javadoc.classpath">
 
 228         <path refid="classpath"/>
 
 229         <pathelement location="${ant.home}/lib/ant.jar"/>
 
 231           <exclude name="build/**/*.jar"/>
 
 232           <include name="**/lib/*.jar"/>
 
 237         destdir="${javadoc.dir}/all">
 
 239           <!-- TODO: find a dynamic way to do include multiple source roots -->
 
 240           <packageset dir="src/java"/>
 
 242           <!-- please keep this list up to date, and in alpha order...   -->
 
 244           <!-- ie: `find contrib/* -path \*src/java | sort` -->
 
 246           <!-- if you make changes to the list of package sets, also -->
 
 247           <!-- make sure the group list below is updated.            -->
 
 248           <!-- Also remember to keep site.xml in sync.            -->             
 
 250           <packageset dir="contrib/analyzers/common/src/java"/>
 
 251           <packageset dir="contrib/analyzers/smartcn/src/java"/>
 
 252           <packageset dir="contrib/analyzers/stempel/src/java"/>
 
 253           <packageset dir="contrib/benchmark/src/java"/>
 
 254           <packageset dir="contrib/demo/src/java"/>
 
 255           <packageset dir="contrib/grouping/src/java"/>
 
 256           <packageset dir="contrib/icu/src/java"/>
 
 257           <packageset dir="contrib/highlighter/src/java"/>
 
 258           <packageset dir="contrib/instantiated/src/java"/>
 
 259           <packageset dir="contrib/join/src/java"/>
 
 260           <packageset dir="contrib/memory/src/java"/>
 
 261           <packageset dir="contrib/misc/src/java"/>
 
 262           <packageset dir="contrib/queries/src/java"/>
 
 263           <packageset dir="contrib/remote/src/java"/>
 
 264           <packageset dir="contrib/spatial/src/java"/>
 
 265           <packageset dir="contrib/spellchecker/src/java"/>
 
 266           <packageset dir="contrib/xml-query-parser/src/java"/>
 
 267           <packageset dir="contrib/queryparser/src/java"/>
 
 268           <!-- end alpha sort -->
 
 270           <!-- If the main javadoc Group listing includes an "Other   -->
 
 271           <!-- Packages" group after the ones listed here, then those -->
 
 272           <!-- packages are not being matched by any of these rules   -->
 
 274           <group title="Core" packages="org.apache.*:org.apache.lucene.analysis:org.apache.lucene.analysis.standard*:org.apache.lucene.analysis.tokenattributes*"/>
 
 276           <group title="contrib: Analysis" packages="org.apache.lucene.analysis.*:org.tartarus.snowball*:org.egothor.stemmer*"/>
 
 277           <group title="contrib: Benchmark" packages="org.apache.lucene.benchmark*"/>
 
 278           <group title="contrib: ICU" packages="org.apache.lucene.collation*"/>
 
 279           <group title="contrib: Demo" packages="org.apache.lucene.demo*"/>
 
 280           <group title="contrib: Grouping" packages="org.apache.lucene.search.grouping*"/>
 
 281           <group title="contrib: Highlighter" packages="org.apache.lucene.search.highlight*:org.apache.lucene.search.vectorhighlight*"/>
 
 282           <group title="contrib: Instantiated" packages="org.apache.lucene.store.instantiated*"/>
 
 283           <group title="contrib: Join" packages="org.apache.lucene.search.join*"/>
 
 284           <group title="contrib: Memory" packages="org.apache.lucene.index.memory*"/>
 
 285           <group title="contrib: Misc " packages="org.apache.lucene.misc*"/>
 
 286           <group title="contrib: Queries" packages="org.apache.lucene.search.similar*:org.apache.lucene.search.regex*:org.apache.regexp*"/>
 
 287           <group title="contrib: Query Parser" packages="org.apache.lucene.queryParser.*"/>
 
 288           <group title="contrib: Spatial" packages="org.apache.lucene.spatial*"/>
 
 289           <group title="contrib: SpellChecker" packages="org.apache.lucene.search.spell*"/>
 
 290           <group title="contrib: XML Query Parser" packages="org.apache.lucene.xmlparser*"/>
 
 298   <!-- ================================================================== -->
 
 299   <!-- D I S T R I B U T I O N                                            -->
 
 300   <!-- ================================================================== -->
 
 302   <!-- ================================================================== -->
 
 303   <target name="package" depends="jar-core, jar-test-framework, docs, javadocs, build-contrib, init-dist, changes-to-html"/>
 
 305   <target name="nightly" depends="test, package-tgz">
 
 308   <!-- ================================================================== -->
 
 309   <!-- Packages the distribution with zip                                 -->
 
 310   <!-- ================================================================== -->
 
 312   <!-- ================================================================== -->
 
 313   <target name="package-zip" depends="package"
 
 314     description="--> Generates the Lucene distribution as .zip">
 
 316     <delete file="${dist.dir}/lucene-${version}.zip"/>
 
 317     <zip destfile="${dist.dir}/lucene-${version}.zip">
 
 318       <zipfileset prefix="lucene-${version}" dir=".">
 
 319         <patternset refid="binary.root.dist.patterns"/>
 
 321       <zipfileset dir="${build.dir}" includes="build-demo.xml" fullpath="lucene-${version}/build.xml"/>
 
 322       <zipfileset prefix="lucene-${version}" dir="${build.dir}">
 
 323         <patternset refid="binary.build.dist.patterns"/>
 
 326         <make-checksums file="${dist.dir}/lucene-${version}.zip"/>
 
 329   <!-- ================================================================== -->
 
 330   <!-- packages the distribution with tar-gzip                            -->
 
 331   <!-- ================================================================== -->
 
 333   <!-- ================================================================== -->
 
 334   <target name="package-tgz" depends="package"
 
 335     description="--> Generates the lucene distribution as .tgz">
 
 337     <delete file="${build.dir}/lucene-${version}.tar"/>
 
 338     <delete file="${dist.dir}/lucene-${version}.tgz"/>
 
 339     <tar tarfile="${build.dir}/lucene-${version}.tar" longfile="gnu">
 
 340       <tarfileset prefix="lucene-${version}" dir=".">
 
 341         <patternset refid="binary.root.dist.patterns"/>
 
 343       <tarfileset prefix="lucene-${version}" dir="${build.dir}">
 
 344         <patternset refid="binary.build.dist.patterns"/>
 
 348     <gzip zipfile="${dist.dir}/lucene-${version}.tgz"
 
 349       src="${build.dir}/lucene-${version}.tar"
 
 351           <make-checksums file="${dist.dir}/lucene-${version}.tgz"/>
 
 354   <!-- ================================================================== -->
 
 355   <!-- packages the distribution with zip and tar-gzip                    -->
 
 356   <!-- ================================================================== -->
 
 358   <!-- ================================================================== -->
 
 359   <target name="package-all-binary" depends="package-zip, package-tgz"
 
 360     description="--> Generates the .tgz and .zip distributions"/>
 
 362   <!-- ================================================================== -->
 
 363   <!-- same as package-all. it is just here for compatibility.            -->
 
 364   <!-- ================================================================== -->
 
 366   <!-- ================================================================== -->
 
 367   <target name="dist" depends="package-all-binary"/>
 
 369   <!-- ================================================================== -->
 
 370   <!-- S O U R C E  D I S T R I B U T I O N                               -->
 
 371   <!-- ================================================================== -->
 
 372     <target name="init-dist" >
 
 374         <!-- Package is not called first if packaging src standalone, so the dist.dir may not exist -->
 
 375         <mkdir dir="${build.dir}"/>
 
 376         <mkdir dir="${dist.dir}"/>
 
 377         <mkdir dir="${maven.dist.dir}"/>
 
 380   <!-- ================================================================== -->
 
 381   <!-- Packages the sources from "svn export" with tar-gzip               -->
 
 382   <!-- ================================================================== -->
 
 383   <target name="package-tgz-src" depends="init, init-dist"
 
 384           description="--> Generates the Lucene source distribution from 'svn export' as .tgz">
 
 385     <property name="source.package.file"
 
 386               value="${dist.dir}/lucene-${version}-src.tgz"/>
 
 387     <delete file="${source.package.file}"/>
 
 388     <svn-export-source source.dir="."/>
 
 389     <build-changes changes.src.dir="${svn.export.dir}/src/site/changes"
 
 390                    changes.target.dir="${svn.export.dir}/docs/changes"/>
 
 391     <tar tarfile="${source.package.file}" compression="gzip" longfile="gnu">
 
 392       <tarfileset prefix="lucene-${version}" dir="${svn.export.dir}"/>
 
 394     <make-checksums file="${source.package.file}"/>
 
 397   <!-- ================================================================== -->
 
 398   <!-- Packages the sources from local working copy with tar-gzip     -->
 
 399   <!-- ================================================================== -->
 
 400   <target name="package-local-src-tgz" depends="init"
 
 401     description="--> Packages the Lucene source from the local working copy">
 
 402     <mkdir dir="${common.dir}/build"/>
 
 403     <property name="source.package.file"
 
 404               value="${common.dir}/build/lucene-${version}-src.tgz"/>
 
 405     <delete file="${source.package.file}"/>
 
 406     <tar tarfile="${source.package.file}" compression="gzip" longfile="gnu">
 
 407       <tarfileset prefix="lucene-${version}" dir=".">
 
 408         <patternset refid="lucene.local.src.package.patterns"/>
 
 413   <!-- ================================================================== -->
 
 414   <!-- same as package-tgz-src. it is just here for compatibility.        -->
 
 415   <!-- ================================================================== -->
 
 416   <target name="dist-src" depends="package-tgz-src"/>
 
 418   <target name="dist-all" depends="dist, dist-src"/>
 
 420   <target name="copy-to-stage">
 
 421     <copy-to-stage-macro artifacts.dir="${dist.dir}"/>
 
 424   <target name="prepare-release" depends="clean, dist-all, generate-maven-artifacts, sign-artifacts"/>
 
 426   <target name="stage" depends="prepare-release, copy-to-stage"/>
 
 428   <target name="generate-maven-artifacts"
 
 429           depends="package, jar-src, jar-test-framework-src, javadocs">
 
 430     <taskdef resource="org/apache/maven/artifact/ant/antlib.xml" 
 
 431              uri="antlib:org.apache.maven.artifact.ant" 
 
 432              classpathref="maven-ant-tasks.classpath"/>
 
 434       <ant target="get-maven-poms" dir=".."/>
 
 436       <m2-deploy pom.xml="../pom.xml"/> <!-- Lucene/Solr grandparent POM -->
 
 437       <m2-deploy pom.xml="pom.xml"/>    <!-- Lucene parent POM -->
 
 438       <m2-deploy pom.xml="src/pom.xml"> <!-- Lucene core POM -->
 
 439         <artifact-attachments>
 
 440           <attach file="${build.dir}/${final.name}-src.jar"
 
 441                   classifier="sources"/>
 
 442           <attach file="${build.dir}/${final.name}-javadoc.jar"
 
 443                   classifier="javadoc"/>
 
 444         </artifact-attachments>
 
 446       <m2-deploy pom.xml="src/test-framework/pom.xml"
 
 447                  jar.file="${build.dir}/lucene-test-framework-${version}.jar">
 
 448         <artifact-attachments>
 
 449           <attach file="${build.dir}/lucene-test-framework-${version}-src.jar"
 
 450                   classifier="sources"/>
 
 451           <attach file="${build.dir}/lucene-test-framework-${version}-javadoc.jar"
 
 452                   classifier="javadoc"/>
 
 453         </artifact-attachments>
 
 456       <contrib-crawl target="dist-maven"/>
 
 460   <!-- ================================================================== -->
 
 461   <!-- support for signing the artifacts using gpg                        -->
 
 462   <!-- ================================================================== -->
 
 463   <target name="sign-artifacts">
 
 464     <sign-artifacts-macro artifacts.dir="${dist.dir}"/>
 
 467   <!-- ================================================================== -->
 
 468   <!-- Build the JavaCC files into the source tree                        -->
 
 469   <!-- ================================================================== -->
 
 470   <target name="clean-javacc">
 
 472       <fileset dir="src/java/org/apache/lucene/queryParser" includes="*.java">
 
 473         <containsregexp expression="Generated.*By.*JavaCC"/>
 
 475       <fileset dir="contrib/queryparser/src/java/org/apache/lucene/queryParser/surround/parser" includes="*.java">
 
 476         <containsregexp expression="Generated.*By.*JavaCC"/>
 
 478       <fileset dir="contrib/queryparser/src/java/org/apache/lucene/queryParser/standard/parser" includes="*.java">
 
 479         <containsregexp expression="Generated.*By.*JavaCC"/>
 
 484   <target name="javacc" depends="init,javacc-check,clean-javacc,javacc-QueryParser,javacc-contrib-queryparser,javacc-contrib-demo"/>
 
 486   <target name="javacc-QueryParser" depends="init,javacc-check" if="javacc.present">
 
 488       <invoke-javacc target="src/java/org/apache/lucene/queryParser/QueryParser.jj"
 
 489                      outputDir="src/java/org/apache/lucene/queryParser"/>
 
 491       <!-- Change the inccorrect public ctors for QueryParser to be protected instead -->
 
 492       <replaceregexp file="src/java/org/apache/lucene/queryParser/QueryParser.java"
 
 494                      match="public QueryParser\(CharStream "
 
 495                      replace="protected QueryParser(CharStream "/>
 
 496       <replaceregexp file="src/java/org/apache/lucene/queryParser/QueryParser.java"
 
 498                      match="public QueryParser\(QueryParserTokenManager "
 
 499                      replace="protected QueryParser(QueryParserTokenManager "/>
 
 504   <target name="javacc-contrib-queryparser" depends="init,javacc-check" if="javacc.present">
 
 506       dir="contrib/queryparser"
 
 511   <target name="javacc-contrib-demo" depends="init,javacc-check" if="javacc.present">
 
 518   <!-- ================================================================== -->
 
 519   <!-- Build the JFlex files into the source tree                         -->
 
 520   <!-- ================================================================== -->
 
 522   <target name="jflex" depends="jflex-check,clean-jflex,gen-uax29-supp-macros,
 
 523                                 jflex-StandardAnalyzer,jflex-UAX29URLEmailTokenizer"/>
 
 525   <target name="gen-uax29-supp-macros">
 
 526     <subant target="gen-uax29-supp-macros">
 
 527        <fileset dir="contrib/icu" includes="build.xml"/>
 
 531   <target name="jflex-StandardAnalyzer" depends="init,jflex-check" if="jflex.present">
 
 532     <taskdef classname="jflex.anttask.JFlexTask" name="jflex">
 
 533                         <classpath refid="jflex.classpath"/>
 
 536     <jflex file="src/java/org/apache/lucene/analysis/standard/StandardTokenizerImpl.jflex"
 
 537            outdir="src/java/org/apache/lucene/analysis/standard"
 
 539     <jflex file="src/java/org/apache/lucene/analysis/standard/ClassicTokenizerImpl.jflex"
 
 540            outdir="src/java/org/apache/lucene/analysis/standard"
 
 542     <jflex file="src/java/org/apache/lucene/analysis/standard/std31/StandardTokenizerImpl31.jflex"
 
 543            outdir="src/java/org/apache/lucene/analysis/standard/std31"
 
 547   <target name="jflex-UAX29URLEmailTokenizer" depends="jflex-check" if="jflex.present">
 
 548     <taskdef classname="jflex.anttask.JFlexTask" name="jflex">
 
 549                         <classpath refid="jflex.classpath"/>
 
 551     <jflex file="src/java/org/apache/lucene/analysis/standard/UAX29URLEmailTokenizerImpl.jflex"
 
 552            outdir="src/java/org/apache/lucene/analysis/standard"
 
 554     <jflex file="src/java/org/apache/lucene/analysis/standard/UAX29URLEmailTokenizerImpl31.jflex"
 
 555            outdir="src/java/org/apache/lucene/analysis/standard/std31"
 
 559   <property name="tld.zones" value="http://www.internic.net/zones/root.zone"/>
 
 560   <property name="tld.output" location="src/java/org/apache/lucene/analysis/standard/ASCIITLD.jflex-macro"/>
 
 562   <target name="gen-tlds" depends="compile-tools">
 
 564       classname="org.apache.lucene.analysis.standard.GenerateJflexTLDMacros"
 
 569         <pathelement location="${build.dir}/classes/tools"/>
 
 571       <arg value="${tld.zones}"/>
 
 572       <arg value="${tld.output}"/>
 
 576   <target name="clean-jflex">
 
 578       <fileset dir="src/java/org/apache/lucene/analysis/standard" includes="**/*.java">
 
 579         <containsregexp expression="generated.*by.*JFlex"/>
 
 584   <target name="build-contrib" depends="compile-test"
 
 585           description="Builds all contrib modules and their tests">
 
 586     <contrib-crawl target="build-artifacts-and-tests"/>
 
 589   <target name="test-contrib" depends="build-contrib">
 
 590     <contrib-crawl target="test" failonerror="true"/>
 
 594    compile changes.txt into an html file
 
 596   <macrodef name="build-changes">
 
 597     <attribute name="changes.src.dir" default="${changes.src.dir}"/>
 
 598     <attribute name="changes.target.dir" default="${changes.target.dir}"/>
 
 600       <mkdir dir="@{changes.target.dir}"/>
 
 601       <exec executable="perl" input="CHANGES.txt" output="@{changes.target.dir}/Changes.html"
 
 602             failonerror="true" logError="true">
 
 603         <arg value="@{changes.src.dir}/changes2html.pl"/>
 
 605       <exec executable="perl" input="contrib/CHANGES.txt" output="@{changes.target.dir}/Contrib-Changes.html"
 
 606             failonerror="true" logError="true">
 
 607         <arg value="@{changes.src.dir}/changes2html.pl"/>
 
 609       <copy todir="@{changes.target.dir}">
 
 610         <fileset dir="@{changes.src.dir}" includes="*.css"/>
 
 615   <target name="changes-to-html">
 
 616     <build-changes changes.src.dir="${changes.src.dir}" changes.target.dir="${changes.target.dir}" />
 
 623   <property name="patch.file" value="${basedir}/../patches/${patch.name}"/>
 
 624   <!-- Apply a patch.  Assumes  patch can be applied in the basedir.
 
 625   -Dpatch.name assumes the patch is located in ${basedir}/../patches/${patch.name}
 
 626   -Dpatch.file means the patch can be located anywhere on the file system
 
 628   <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/">
 
 629     <patch patchfile="${patch.file}" strip="0"/>
 
 632   <target name="jar-test-framework" depends="compile-test-framework">
 
 633     <jarify basedir="${build.dir}/classes/test-framework" destfile="${build.dir}/lucene-test-framework-${version}.jar"
 
 634             title="Lucene Search Engine: Test Framework" />
 
 637   <target name="javadocs-test-framework">
 
 639       <mkdir dir="${javadoc.dir}/test-framework"/>
 
 641           overview="src/test-framework/overview.html"
 
 642           destdir="${javadoc.dir}/test-framework"
 
 643           title="${Name} ${version} Test Framework API">
 
 645           <packageset dir="src/test-framework"/>
 
 649       <jarify basedir="${javadoc.dir}/test-framework" destfile="${build.dir}/lucene-test-framework-${version}-javadoc.jar"
 
 650                   title="Lucene Search Engine: Test Framework" />
 
 654   <target name="jar-test-framework-src" depends="init">
 
 655     <jarify basedir="${tests-framework.src.dir}" destfile="${build.dir}/lucene-test-framework-${version}-src.jar"
 
 656             title="Lucene Search Engine: Test Framework" />
 
 659   <!-- Override common-build.xml definition to check for the jar already being up-to-date -->
 
 660   <target name="jar-core" depends="check-lucene-core-uptodate,compile-core" unless="lucene-core.uptodate">