mirror of https://github.com/apache/lucene.git
593 lines
28 KiB
XML
593 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="lucene" default="default" basedir="."
|
|
xmlns:jacoco="antlib:org.jacoco.ant"
|
|
xmlns:artifact="antlib:org.apache.maven.artifact.ant">
|
|
|
|
<import file="common-build.xml"/>
|
|
|
|
<path id="classpath">
|
|
<pathelement location="${common.dir}/build/core/classes/java"/>
|
|
</path>
|
|
|
|
<patternset id="binary.build.dist.patterns"
|
|
includes="docs/,**/*.jar,**/*.war"
|
|
excludes="poms/**,**/*-src.jar,**/*-javadoc.jar"
|
|
/>
|
|
<patternset id="binary.root.dist.patterns"
|
|
includes="LICENSE.txt,NOTICE.txt,README.txt,
|
|
MIGRATE.txt,JRE_VERSION_MIGRATION.txt,
|
|
SYSTEM_REQUIREMENTS.txt,
|
|
CHANGES.txt,
|
|
**/lib/*.jar,
|
|
licenses/**,
|
|
*/docs/,**/README*"
|
|
excludes="build/**,site/**,tools/**,**/lib/*servlet-api*.jar"
|
|
/>
|
|
|
|
<!-- ================================================================== -->
|
|
<!-- Prepares the build directory -->
|
|
<!-- ================================================================== -->
|
|
|
|
<target name="test-core" description="Runs unit tests for the core Lucene code">
|
|
<ant dir="${common.dir}/core" target="test" inheritAll="false">
|
|
<propertyset refid="uptodate.and.compiled.properties"/>
|
|
</ant>
|
|
</target>
|
|
|
|
<!-- "-clover.load" is *not* a useless dependency. do not remove -->
|
|
<target name="test" depends="-clover.load, -init-totals, test-core, test-test-framework, test-modules, -check-totals"
|
|
description="Runs all unit tests (core, modules and back-compat)"
|
|
/>
|
|
<target name="test-nocompile">
|
|
<fail message="Target 'test-nocompile' will not run recursively. First change directory to the module you want to test."/>
|
|
</target>
|
|
|
|
|
|
<target name="pitest" depends="pitest-modules"
|
|
description="Runs pitests (core, modules and back-compat)"
|
|
/>
|
|
|
|
<target name="beast">
|
|
<fail message="The Beast only works inside of individual modules"/>
|
|
</target>
|
|
|
|
<target name="compile-core" depends="compile-lucene-core"/>
|
|
|
|
<!-- lucene/test-framework is excluded from compilation -->
|
|
<target name="compile" depends="init,compile-lucene-core,compile-codecs"
|
|
description="Compiles core, codecs, and all modules">
|
|
<modules-crawl target="compile-core"/>
|
|
</target>
|
|
|
|
<!-- Validation (license/notice/api checks). -->
|
|
<target name="validate" depends="check-licenses,rat-sources,check-forbidden-apis" description="Validate stuff." />
|
|
|
|
<!-- Validation here depends on compile-tools: but we want to compile modules' tools too -->
|
|
<target name="compile-tools" depends="common.compile-tools">
|
|
<modules-crawl target="compile-tools"/>
|
|
</target>
|
|
|
|
<target name="check-licenses" depends="compile-tools,resolve,load-custom-tasks" description="Validate license stuff.">
|
|
<property name="skipRegexChecksum" value=""/>
|
|
<license-check-macro dir="${basedir}" licensedir="${common.dir}/licenses">
|
|
<additional-filters>
|
|
<replaceregex pattern="jetty([^/]+)$" replace="jetty" flags="gi" />
|
|
<replaceregex pattern="slf4j-([^/]+)$" replace="slf4j" flags="gi" />
|
|
<replaceregex pattern="javax\.servlet([^/]+)$" replace="javax.servlet" flags="gi" />
|
|
<replaceregex pattern="(bcmail|bcprov)-([^/]+)$" replace="\1" flags="gi" />
|
|
</additional-filters>
|
|
</license-check-macro>
|
|
</target>
|
|
|
|
<target name="check-lib-versions" depends="compile-tools,resolve,load-custom-tasks"
|
|
description="Verify that the '/org/name' keys in ivy-versions.properties are sorted lexically and are neither duplicates nor orphans, and that all dependencies in all ivy.xml files use rev="$${/org/name}" format.">
|
|
<lib-versions-check-macro dir="${common.dir}/.."
|
|
centralized.versions.file="${common.dir}/ivy-versions.properties"
|
|
top.level.ivy.settings.file="${common.dir}/top-level-ivy-settings.xml"
|
|
ivy.resolution-cache.dir="${ivy.resolution-cache.dir}"
|
|
ivy.lock-strategy="${ivy.lock-strategy}"
|
|
common.build.dir="${common.build.dir}"
|
|
ignore.conflicts.file="${common.dir}/ivy-ignore-conflicts.properties"/>
|
|
</target>
|
|
|
|
<!-- -install-forbidden-apis is *not* a useless dependency. do not remove -->
|
|
<target name="check-forbidden-apis" depends="-install-forbidden-apis" description="Check forbidden API calls in compiled class files">
|
|
<subant target="check-forbidden-apis" failonerror="true" inheritall="false">
|
|
<propertyset refid="uptodate.and.compiled.properties"/>
|
|
<fileset dir="core" includes="build.xml"/>
|
|
<fileset dir="test-framework" includes="build.xml"/>
|
|
<fileset dir="tools" includes="build.xml"/>
|
|
</subant>
|
|
<modules-crawl target="check-forbidden-apis"/>
|
|
</target>
|
|
|
|
<target name="resolve">
|
|
<sequential>
|
|
<ant dir="test-framework" target="resolve" inheritall="false">
|
|
<propertyset refid="uptodate.and.compiled.properties"/>
|
|
</ant>
|
|
<ant dir="${common.dir}/tools" target="resolve" inheritAll="false">
|
|
<propertyset refid="uptodate.and.compiled.properties"/>
|
|
</ant>
|
|
<modules-crawl target="resolve"/>
|
|
</sequential>
|
|
</target>
|
|
|
|
<target name="documentation" description="Generate all documentation"
|
|
depends="javadocs,changes-to-html,process-webpages"/>
|
|
<target name="javadoc" depends="javadocs"/>
|
|
<target name="javadocs" description="Generate javadoc" depends="javadocs-lucene-core, javadocs-modules, javadocs-test-framework"/>
|
|
|
|
<target name="documentation-lint" depends="-ecj-javadoc-lint,-documentation-lint-unsupported" if="documentation-lint.supported"
|
|
description="Validates the generated documentation (HTML errors, broken links,...)">
|
|
<!-- we use antcall here, otherwise ANT will run all dependent targets: -->
|
|
<antcall target="-documentation-lint"/>
|
|
</target>
|
|
|
|
<!-- we check for broken links across all documentation -->
|
|
<target name="-documentation-lint" depends="documentation">
|
|
<echo message="checking for broken html..."/>
|
|
<jtidy-macro>
|
|
<!-- NOTE: must currently exclude deprecated-list due to a javadocs bug (as of 1.7.0_09)
|
|
javadocs generates invalid XML if you deprecate a method that takes a parameter
|
|
with a generic type -->
|
|
<fileset dir="build/docs" includes="**/*.html" excludes="**/deprecated-list.html"/>
|
|
</jtidy-macro>
|
|
<echo message="Checking for broken links..."/>
|
|
<check-broken-links dir="build/docs"/>
|
|
<echo message="Checking for missing docs..."/>
|
|
<!-- TODO: change this level=method -->
|
|
<check-missing-javadocs dir="build/docs" level="class"/>
|
|
<!-- too many classes to fix overall to just enable
|
|
the above to be level="method" right now, but we
|
|
can prevent the modules that don't have problems
|
|
from getting any worse -->
|
|
<!-- analyzers-common: problems -->
|
|
<check-missing-javadocs dir="build/docs/analyzers-icu" level="method"/>
|
|
<!-- analyzers-kuromoji: problems -->
|
|
<check-missing-javadocs dir="build/docs/analyzers-morfologik" level="method"/>
|
|
<check-missing-javadocs dir="build/docs/analyzers-phonetic" level="method"/>
|
|
<!-- analyzers-smartcn: problems -->
|
|
<check-missing-javadocs dir="build/docs/analyzers-stempel" level="method"/>
|
|
<!-- benchmark: problems -->
|
|
<check-missing-javadocs dir="build/docs/classification" level="method"/>
|
|
<!-- codecs: problems -->
|
|
<!-- core: problems -->
|
|
<check-missing-javadocs dir="build/docs/demo" level="method"/>
|
|
<check-missing-javadocs dir="build/docs/expressions" level="method"/>
|
|
<check-missing-javadocs dir="build/docs/facet" level="method"/>
|
|
<!-- grouping: problems -->
|
|
<!-- highlighter: problems -->
|
|
<check-missing-javadocs dir="build/docs/join" level="method"/>
|
|
<check-missing-javadocs dir="build/docs/memory" level="method"/>
|
|
<!-- misc: problems -->
|
|
<!-- queries: problems -->
|
|
<!-- queryparser: problems -->
|
|
<!-- sandbox: problems -->
|
|
<check-missing-javadocs dir="build/docs/spatial" level="method"/>
|
|
<!-- spatial-extras: problems -->
|
|
<check-missing-javadocs dir="build/docs/suggest" level="method"/>
|
|
<!-- test-framework: problems -->
|
|
|
|
<!-- too much to fix core/ for now, but enforce full javadocs for key packages -->
|
|
<check-missing-javadocs dir="build/docs/core/org/apache/lucene/util/automaton" level="method"/>
|
|
<check-missing-javadocs dir="build/docs/core/org/apache/lucene/analysis" level="method"/>
|
|
<check-missing-javadocs dir="build/docs/core/org/apache/lucene/document" level="method"/>
|
|
<check-missing-javadocs dir="build/docs/core/org/apache/lucene/search/similarities" level="method"/>
|
|
<check-missing-javadocs dir="build/docs/core/org/apache/lucene/index" level="method"/>
|
|
<check-missing-javadocs dir="build/docs/core/org/apache/lucene/codecs" level="method"/>
|
|
|
|
<check-missing-javadocs dir="build/docs/spatial3d" level="method"/>
|
|
</target>
|
|
|
|
<target name="-ecj-javadoc-lint" depends="compile,compile-test,-ecj-javadoc-lint-unsupported,-ecj-resolve" if="ecj-javadoc-lint.supported">
|
|
<subant target="-ecj-javadoc-lint" failonerror="true" inheritall="false">
|
|
<propertyset refid="uptodate.and.compiled.properties"/>
|
|
<fileset dir="core" includes="build.xml"/>
|
|
<fileset dir="test-framework" includes="build.xml"/>
|
|
</subant>
|
|
<modules-crawl target="-ecj-javadoc-lint"/>
|
|
</target>
|
|
|
|
<target name="process-webpages" depends="resolve-markdown">
|
|
<makeurl property="process-webpages.buildfiles" separator="|">
|
|
<fileset dir="." includes="**/build.xml" excludes="build.xml,analysis/*,build/**,tools/**,site/**"/>
|
|
</makeurl>
|
|
<property name="Codec.java" location="core/src/java/org/apache/lucene/codecs/Codec.java"/>
|
|
<loadfile srcfile="${Codec.java}" property="defaultCodec" encoding="UTF-8">
|
|
<filterchain>
|
|
<!-- private static Codec defaultCodec = LOADER . lookup ( "LuceneXXX" ) ; -->
|
|
<containsregex pattern="^.*defaultCodec\s*=\s*LOADER\s*\.\s*lookup\s*\(\s*"([^"]+)"\s*\)\s*;.*$" replace="\1"/>
|
|
<fixcrlf eol="unix" eof="remove" />
|
|
<deletecharacters chars="\n"/>
|
|
</filterchain>
|
|
</loadfile>
|
|
|
|
<!--
|
|
The XSL input file is ignored completely, but XSL expects one to be given,
|
|
so we pass ourself (${ant.file}) here. The list of module build.xmls is given
|
|
via string parameter, that must be splitted by the XSL at '|'.
|
|
-->
|
|
<xslt in="${ant.file}" out="${javadoc.dir}/index.html" style="site/xsl/index.xsl" force="true">
|
|
<outputproperty name="method" value="html"/>
|
|
<outputproperty name="version" value="4.0"/>
|
|
<outputproperty name="encoding" value="UTF-8"/>
|
|
<outputproperty name="indent" value="yes"/>
|
|
<param name="buildfiles" expression="${process-webpages.buildfiles}"/>
|
|
<param name="version" expression="${version}"/>
|
|
<param name="defaultCodec" expression="${defaultCodec}"/>
|
|
</xslt>
|
|
|
|
<markdown todir="${javadoc.dir}">
|
|
<fileset dir="." includes="MIGRATE.txt,JRE_VERSION_MIGRATION.txt,SYSTEM_REQUIREMENTS.txt"/>
|
|
<globmapper from="*.txt" to="*.html"/>
|
|
</markdown>
|
|
|
|
<copy todir="${javadoc.dir}">
|
|
<fileset dir="site/html"/>
|
|
</copy>
|
|
</target>
|
|
|
|
<target name="javadocs-modules" description="Generate javadoc for modules classes">
|
|
<modules-crawl target="javadocs"/>
|
|
</target>
|
|
|
|
<!-- rat-sources-typedef is *not* a useless dependency. do not remove -->
|
|
<target name="rat-sources" depends="rat-sources-typedef,common.rat-sources">
|
|
<subant target="rat-sources" failonerror="true" inheritall="false">
|
|
<propertyset refid="uptodate.and.compiled.properties"/>
|
|
<fileset dir="core" includes="build.xml"/>
|
|
<fileset dir="test-framework" includes="build.xml"/>
|
|
<fileset dir="tools" includes="build.xml"/>
|
|
</subant>
|
|
<modules-crawl target="rat-sources"/>
|
|
</target>
|
|
|
|
<!-- ================================================================== -->
|
|
<!-- D I S T R I B U T I O N -->
|
|
<!-- ================================================================== -->
|
|
<!-- -->
|
|
<!-- ================================================================== -->
|
|
<target name="package" depends="jar-core, jar-test-framework, build-modules, init-dist, documentation"/>
|
|
|
|
<target name="nightly" depends="test, package-tgz">
|
|
</target>
|
|
|
|
<!-- ================================================================== -->
|
|
<!-- Packages the distribution with zip -->
|
|
<!-- ================================================================== -->
|
|
<!-- -->
|
|
<!-- ================================================================== -->
|
|
<target name="package-zip" depends="package"
|
|
description="--> Generates the Lucene distribution as .zip">
|
|
|
|
<delete file="${dist.dir}/lucene-${version}.zip"/>
|
|
<zip destfile="${dist.dir}/lucene-${version}.zip">
|
|
<zipfileset prefix="lucene-${version}" dir=".">
|
|
<patternset refid="binary.root.dist.patterns"/>
|
|
</zipfileset>
|
|
<zipfileset prefix="lucene-${version}" dir="${build.dir}">
|
|
<patternset refid="binary.build.dist.patterns"/>
|
|
</zipfileset>
|
|
</zip>
|
|
<make-checksums file="${dist.dir}/lucene-${version}.zip"/>
|
|
</target>
|
|
|
|
<!-- ================================================================== -->
|
|
<!-- packages the distribution with tar-gzip -->
|
|
<!-- ================================================================== -->
|
|
<!-- -->
|
|
<!-- ================================================================== -->
|
|
|
|
<!-- TODO: fix this stuff to not be a duplicate of the zip logic above! -->
|
|
<target name="package-tgz" depends="package"
|
|
description="--> Generates the lucene distribution as .tgz">
|
|
|
|
<delete file="${dist.dir}/lucene-${version}.tgz"/>
|
|
<tar tarfile="${dist.dir}/lucene-${version}.tgz"
|
|
longfile="gnu" compression="gzip">
|
|
<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>
|
|
<make-checksums file="${dist.dir}/lucene-${version}.tgz"/>
|
|
</target>
|
|
|
|
<!-- ================================================================== -->
|
|
<!-- packages the distribution with zip and tar-gzip -->
|
|
<!-- ================================================================== -->
|
|
<!-- -->
|
|
<!-- ================================================================== -->
|
|
<target name="package-all-binary" depends="package-zip, package-tgz"
|
|
description="--> Generates the .tgz 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 tar-gzip -->
|
|
<!-- ================================================================== -->
|
|
<target name="package-tgz-src" depends="init-dist"
|
|
description="--> Generates the Lucene source distribution as .tgz">
|
|
<property name="source.package.file"
|
|
location="${dist.dir}/lucene-${version}-src.tgz"/>
|
|
<delete file="${source.package.file}"/>
|
|
<export-source source.dir="."/>
|
|
|
|
<!-- Exclude javadoc package-list files under licenses incompatible with the ASL -->
|
|
<delete dir="${src.export.dir}/tools/javadoc/java8"/>
|
|
|
|
<!-- because we only package the "lucene/" folder, we have to adjust dir to work on: -->
|
|
<property name="local.src.export.dir" location="${src.export.dir}/lucene"/>
|
|
|
|
<build-changes changes.src.file="${local.src.export.dir}/CHANGES.txt"
|
|
changes.target.dir="${local.src.export.dir}/docs/changes"
|
|
changes.product="lucene"/>
|
|
<tar tarfile="${source.package.file}" compression="gzip" longfile="gnu">
|
|
<tarfileset prefix="lucene-${version}" dir="${local.src.export.dir}"/>
|
|
</tar>
|
|
<make-checksums file="${source.package.file}"/>
|
|
</target>
|
|
|
|
|
|
<!-- ================================================================== -->
|
|
<!-- Packages the sources from local working copy with tar-gzip -->
|
|
<!-- ================================================================== -->
|
|
<target name="package-local-src-tgz" depends="init-dist"
|
|
description="--> Packages the Lucene source from the local working copy">
|
|
<mkdir dir="${common.dir}/build"/>
|
|
<property name="source.package.file"
|
|
value="${common.dir}/build/lucene-${version}-src.tgz"/>
|
|
<delete file="${source.package.file}"/>
|
|
<tar tarfile="${source.package.file}" compression="gzip" longfile="gnu">
|
|
<tarfileset prefix="lucene-${version}" dir=".">
|
|
<patternset refid="lucene.local.src.package.patterns"/>
|
|
</tarfileset>
|
|
</tar>
|
|
</target>
|
|
|
|
<!-- ================================================================== -->
|
|
<!-- same as package-tgz-src. it is just here for compatibility. -->
|
|
<!-- ================================================================== -->
|
|
<target name="dist-src" depends="package-tgz-src"/>
|
|
|
|
<target name="dist-all" depends="dist, dist-src, -dist-changes"/>
|
|
|
|
<!-- copy changes/ to the release folder -->
|
|
<target name="-dist-changes">
|
|
<copy todir="${dist.dir}/changes">
|
|
<fileset dir="${build.dir}/docs/changes"/>
|
|
</copy>
|
|
</target>
|
|
|
|
<target name="prepare-release-no-sign" depends="clean, dist-all, generate-maven-artifacts"/>
|
|
<target name="prepare-release" depends="prepare-release-no-sign, sign-artifacts"/>
|
|
|
|
<target name="-dist-maven" depends="install-maven-tasks">
|
|
<sequential>
|
|
<m2-deploy pom.xml="${filtered.pom.templates.dir}/pom.xml"/> <!-- Lucene/Solr grandparent POM -->
|
|
<m2-deploy pom.xml="${filtered.pom.templates.dir}/lucene/pom.xml"/> <!-- Lucene parent POM -->
|
|
<subant target="-dist-maven" failonerror="true" inheritall="false">
|
|
<propertyset refid="uptodate.and.compiled.properties"/>
|
|
<fileset dir="${common.dir}/core" includes="build.xml"/>
|
|
<fileset dir="${common.dir}/test-framework" includes="build.xml"/>
|
|
</subant>
|
|
<modules-crawl target="-dist-maven"/>
|
|
</sequential>
|
|
</target>
|
|
|
|
<target name="-install-to-maven-local-repo" depends="install-maven-tasks">
|
|
<sequential>
|
|
<m2-install pom.xml="${filtered.pom.templates.dir}/pom.xml"/> <!-- Lucene/Solr grandparent POM -->
|
|
<m2-install pom.xml="${filtered.pom.templates.dir}/lucene/pom.xml"/> <!-- Lucene parent POM -->
|
|
<subant target="-install-to-maven-local-repo" failonerror="true" inheritall="false">
|
|
<propertyset refid="uptodate.and.compiled.properties"/>
|
|
<fileset dir="${common.dir}/core" includes="build.xml"/>
|
|
<fileset dir="${common.dir}/test-framework" includes="build.xml"/>
|
|
</subant>
|
|
<modules-crawl target="-install-to-maven-local-repo"/>
|
|
</sequential>
|
|
</target>
|
|
|
|
<target name="generate-maven-artifacts" depends="-unpack-lucene-tgz">
|
|
<ant dir=".." target="resolve" inheritall="false"/>
|
|
<antcall target="-filter-pom-templates" inheritall="false"/>
|
|
<antcall target="-dist-maven" inheritall="false">
|
|
<propertyset refid="uptodate.and.compiled.properties"/>
|
|
</antcall>
|
|
</target>
|
|
|
|
<target name="-validate-maven-dependencies" depends="compile-tools, install-maven-tasks, load-custom-tasks">
|
|
<sequential>
|
|
<subant target="-validate-maven-dependencies" failonerror="true" inheritall="false">
|
|
<propertyset refid="uptodate.and.compiled.properties"/>
|
|
<fileset dir="${common.dir}/core" includes="build.xml"/>
|
|
<fileset dir="${common.dir}/test-framework" includes="build.xml"/>
|
|
</subant>
|
|
|
|
<modules-crawl target="-validate-maven-dependencies"/>
|
|
</sequential>
|
|
</target>
|
|
|
|
<!-- ================================================================== -->
|
|
<!-- support for signing the artifacts using gpg -->
|
|
<!-- ================================================================== -->
|
|
<target name="sign-artifacts">
|
|
<sign-artifacts-macro artifacts.dir="${dist.dir}"/>
|
|
</target>
|
|
|
|
<target name="build-modules" depends="compile-test"
|
|
description="Builds all additional modules and their tests">
|
|
<modules-crawl target="build-artifacts-and-tests"/>
|
|
</target>
|
|
|
|
<target name="compile-test" description="Builds core, codecs, test-framework, and modules tests">
|
|
<sequential>
|
|
<ant dir="core" target="compile-test" inheritall="false">
|
|
<propertyset refid="uptodate.and.compiled.properties"/>
|
|
</ant>
|
|
<ant dir="test-framework" target="compile-test" inheritall="false">
|
|
<propertyset refid="uptodate.and.compiled.properties"/>
|
|
</ant>
|
|
<modules-crawl target="compile-test"/>
|
|
</sequential>
|
|
</target>
|
|
|
|
<target name="test-test-framework">
|
|
<ant dir="test-framework" target="test" inheritall="false">
|
|
<propertyset refid="uptodate.and.compiled.properties"/>
|
|
</ant>
|
|
</target>
|
|
|
|
<target name="test-modules">
|
|
<modules-crawl target="test"/>
|
|
</target>
|
|
|
|
<target name="changes-to-html">
|
|
<build-changes changes.product="lucene"/>
|
|
</target>
|
|
|
|
<target name="pitest-modules" depends="compile-test">
|
|
<modules-crawl target="pitest" failonerror="false"/>
|
|
</target>
|
|
|
|
<target name="jacoco" description="Generates JaCoCo code coverage reports" depends="-jacoco-install">
|
|
<!-- run jacoco for each module -->
|
|
<ant dir="${common.dir}/core" target="jacoco" inheritAll="false">
|
|
<propertyset refid="uptodate.and.compiled.properties"/>
|
|
</ant>
|
|
<ant dir="${common.dir}/test-framework" target="jacoco" inheritAll="false">
|
|
<propertyset refid="uptodate.and.compiled.properties"/>
|
|
</ant>
|
|
<modules-crawl target="jacoco"/>
|
|
|
|
<!-- produce aggregate report -->
|
|
<property name="jacoco.output.dir" location="${jacoco.report.dir}/lucene-all"/>
|
|
<!-- try to clean output dir to prevent any confusion -->
|
|
<delete dir="${jacoco.output.dir}" failonerror="false"/>
|
|
<mkdir dir="${jacoco.output.dir}"/>
|
|
|
|
<jacoco:report>
|
|
<executiondata>
|
|
<fileset dir="${common.dir}/build" includes="**/jacoco.db"/>
|
|
</executiondata>
|
|
<structure name="${Name} aggregate JaCoCo coverage report">
|
|
<classfiles>
|
|
<fileset dir="${common.dir}/build">
|
|
<include name="**/classes/java/**/*.class"/>
|
|
<exclude name="tools/**"/>
|
|
</fileset>
|
|
</classfiles>
|
|
<!-- TODO: trying to specify source files could maybe work, but would
|
|
double the size of the reports -->
|
|
</structure>
|
|
<html destdir="${jacoco.output.dir}" footer="Copyright ${year} Apache Software Foundation. All Rights Reserved."/>
|
|
</jacoco:report>
|
|
</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">
|
|
<ant dir="${common.dir}/test-framework" target="jar-core" inheritAll="false">
|
|
<propertyset refid="uptodate.and.compiled.properties"/>
|
|
</ant>
|
|
</target>
|
|
|
|
<!-- Override common-build.xml definition to check for the jar already being up-to-date -->
|
|
<target name="jar-core" depends="resolve-groovy,check-lucene-core-uptodate,compile-lucene-core" unless="lucene-core.uptodate">
|
|
<ant dir="${common.dir}/core" target="jar-core" inheritAll="false">
|
|
<propertyset refid="uptodate.and.compiled.properties"/>
|
|
</ant>
|
|
<property name="core.compiled" value="true"/>
|
|
<property name="lucene-core.uptodate" value="true"/>
|
|
</target>
|
|
|
|
<target name="jar" depends="jar-core,jar-test-framework"
|
|
description="Jars core, codecs, test-framework, and all modules">
|
|
<modules-crawl target="jar-core"/>
|
|
</target>
|
|
|
|
<target name="jar-src" description="create source jars for all modules">
|
|
<ant dir="${common.dir}/core" target="jar-src" inheritAll="false" />
|
|
<ant dir="${common.dir}/test-framework" target="jar-src" inheritAll="false" />
|
|
<modules-crawl target="jar-src"/>
|
|
</target>
|
|
|
|
<target name="get-jenkins-line-docs" unless="enwiki.exists">
|
|
<sequential>
|
|
<!-- TODO: can get .lzma instead (it's ~17% smaller) but there's no builtin ant support...? -->
|
|
<get src="http://home.apache.org/~mikemccand/enwiki.random.lines.txt.bz2"
|
|
dest="enwiki.random.lines.txt.bz2"/>
|
|
<bunzip2 src="enwiki.random.lines.txt.bz2" dest="enwiki.random.lines.txt"/>
|
|
</sequential>
|
|
</target>
|
|
|
|
<target name="jar-checksums" depends="resolve">
|
|
<jar-checksum-macro srcdir="${common.dir}" dstdir="${common.dir}/licenses"/>
|
|
</target>
|
|
|
|
<target name="regenerate">
|
|
<subant target="regenerate" failonerror="true" inheritall="false">
|
|
<propertyset refid="uptodate.and.compiled.properties"/>
|
|
<fileset dir="core" includes="build.xml"/>
|
|
<fileset dir="test-framework" includes="build.xml"/>
|
|
</subant>
|
|
<modules-crawl target="regenerate"/>
|
|
</target>
|
|
|
|
<target name="-append-module-dependencies-properties">
|
|
<sequential>
|
|
<ant dir="core" target="common.-append-module-dependencies-properties" inheritall="false"/>
|
|
<ant dir="test-framework" target="common.-append-module-dependencies-properties" inheritall="false"/>
|
|
<modules-crawl target="-append-module-dependencies-properties"/>
|
|
</sequential>
|
|
</target>
|
|
</project>
|