2010-03-17 17:31:44 -04:00
<?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.
-->
2012-09-26 09:00:03 -04:00
<project name= "lucene-solr" default= "-projecthelp" basedir= "." >
2015-07-23 11:53:30 -04:00
<import file= "lucene/common-build.xml" />
2014-03-10 06:37:15 -04:00
2017-01-13 14:20:31 -05:00
<property name= "jgit-version" value= "4.6.0.201612231935-r" />
2016-01-24 16:05:38 -05:00
2014-08-28 07:28:53 -04:00
<property name= "tests.heap-dump-dir" location= "heapdumps" />
<property name= "maven-build-dir" value= "maven-build" />
2019-04-16 08:00:09 -04:00
<property name= "maven-version" value= "3.5.0" />
2014-08-28 07:28:53 -04:00
<property name= "maven.dependencies.filters.file" location= "lucene/build/maven.dependencies.filters.properties" />
2014-08-30 11:48:16 -04:00
<property name= "smokeTestRelease.dir" location= "lucene/build/smokeTestRelease/dist" />
<property name= "smokeTestRelease.tmp" location= "lucene/build/smokeTestRelease/tmp" />
2014-08-28 07:28:53 -04:00
<property name= "smokeTestRelease.testArgs" value= "" />
2012-09-26 09:00:03 -04:00
<target name= "-projecthelp" >
<java fork= "false" classname= "org.apache.tools.ant.Main" taskname= "-" >
<arg value= "-projecthelp" />
<arg value= "-f" />
<arg value= "${ant.file}" />
</java>
</target>
2012-04-15 10:41:44 -04:00
<target name= "test-help" description= "Test runner help" >
2012-09-28 09:44:36 -04:00
<subant buildpath= "lucene" target= "test-help" inheritall= "false" failonerror= "true" />
2012-04-15 10:41:44 -04:00
</target>
2012-09-15 08:42:21 -04:00
<target name= "precommit" description= "Run basic checks before committing"
2016-01-23 07:47:14 -05:00
depends="check-working-copy,validate,documentation-lint"/>
2012-09-15 08:42:21 -04:00
2015-07-23 11:53:30 -04:00
<target name= "test" description= "Test both Lucene and Solr" depends= "resolve-groovy" >
<mkdir dir= "lucene/build" />
<tempfile property= "tests.totals.tmpfile"
destdir="lucene/build"
prefix=".test-totals-"
suffix=".tmp"
deleteonexit="true"
createfile="true" />
<subant target= "test" inheritall= "false" failonerror= "true" >
<fileset dir= "lucene" includes= "build.xml" />
<fileset dir= "solr" includes= "build.xml" />
<propertyset >
<propertyset refid= "uptodate.and.compiled.properties" />
<propertyref name= "tests.totals.tmpfile" />
</propertyset>
</subant>
<property name= "tests.totals.toplevel" value= "true" />
<antcall target= "-check-totals" />
2010-03-17 17:31:44 -04:00
</target>
2012-02-13 09:12:59 -05:00
2015-07-23 11:53:30 -04:00
<target name= "jacoco" depends= "resolve-groovy" description= "Generates JaCoCo code coverage reports" >
2015-04-09 07:47:57 -04:00
<subant target= "jacoco" inheritall= "false" failonerror= "true" >
<fileset dir= "lucene" includes= "build.xml" />
<fileset dir= "solr" includes= "build.xml" />
2015-07-23 11:53:30 -04:00
<propertyset refid= "uptodate.and.compiled.properties" />
2015-04-09 07:47:57 -04:00
</subant>
</target>
2015-07-23 11:53:30 -04:00
<target name= "pitest" depends= "resolve-groovy" description= "Run PITest on both Lucene and Solr" >
2014-12-08 16:49:35 -05:00
<subant target= "pitest" inheritall= "false" failonerror= "true" >
2012-10-19 09:14:00 -04:00
<fileset dir= "lucene" includes= "build.xml" />
<fileset dir= "solr" includes= "build.xml" />
2015-07-23 11:53:30 -04:00
<propertyset refid= "uptodate.and.compiled.properties" />
2012-10-19 09:14:00 -04:00
</subant>
2012-09-04 19:54:13 -04:00
</target>
2014-11-29 18:52:42 -05:00
<target name= "beast" >
<fail message= "The Beast only works inside of individual modules" />
</target>
2017-03-02 11:43:44 -05:00
<target name= "documentation" depends= "resolve-markdown" description= "Generate Lucene and Solr Documentation" >
2012-10-19 09:14:00 -04:00
<subant target= "documentation" inheritall= "false" failonerror= "true" >
<fileset dir= "lucene" includes= "build.xml" />
<fileset dir= "solr" includes= "build.xml" />
2015-07-23 11:53:30 -04:00
<propertyset refid= "uptodate.and.compiled.properties" />
2012-10-19 09:14:00 -04:00
</subant>
2012-04-23 00:29:21 -04:00
</target>
2017-03-02 11:43:44 -05:00
<target name= "documentation-lint" depends= "resolve-markdown,-ecj-javadoc-lint-unsupported,-ecj-resolve" description= "Validates the generated documentation (HTML errors, broken links,...)" >
2012-10-19 07:52:20 -04:00
<subant target= "documentation-lint" inheritall= "false" failonerror= "true" >
<fileset dir= "lucene" includes= "build.xml" />
<fileset dir= "solr" includes= "build.xml" />
2015-07-23 11:53:30 -04:00
<propertyset refid= "uptodate.and.compiled.properties" />
</subant>
</target>
<target name= "check-forbidden-apis" depends= "-install-forbidden-apis" description= "Check forbidden API calls in compiled class files." >
<subant target= "check-forbidden-apis" inheritall= "false" failonerror= "true" >
<fileset dir= "lucene" includes= "build.xml" />
<fileset dir= "solr" includes= "build.xml" />
<propertyset refid= "uptodate.and.compiled.properties" />
2012-10-19 07:52:20 -04:00
</subant>
</target>
2018-03-15 12:31:45 -04:00
<target name= "validate" description= "Validate dependencies, licenses, etc." depends= "validate-source-patterns,resolve-groovy,rat-sources-typedef,-install-forbidden-apis" >
2012-08-10 11:37:31 -04:00
<subant target= "validate" inheritall= "false" failonerror= "true" >
<fileset dir= "lucene" includes= "build.xml" />
<fileset dir= "solr" includes= "build.xml" />
2015-07-23 11:53:30 -04:00
<propertyset refid= "uptodate.and.compiled.properties" />
</subant>
<subant buildpath= "lucene" target= "check-lib-versions" inheritall= "false" failonerror= "true" >
<propertyset refid= "uptodate.and.compiled.properties" />
2012-08-10 11:37:31 -04:00
</subant>
</target>
2014-09-10 15:22:32 -04:00
2018-04-01 08:40:33 -04:00
<target name= "validate-source-patterns" description= "Validate source code (invalid code patterns,...)" unless= "disable.source-patterns" depends= "resolve-groovy,rat-sources-typedef" >
2018-02-10 14:24:33 -05:00
<groovy taskname= "source-patterns" classpathref= "rat.classpath" src= "${common.dir}/tools/src/groovy/check-source-patterns.groovy" />
2011-03-18 14:40:02 -04:00
</target>
2015-08-11 18:13:00 -04:00
2015-07-23 11:53:30 -04:00
<target name= "rat-sources" description= "Runs rat across all sources and tests" depends= "common.rat-sources" >
2012-09-28 09:44:36 -04:00
<subant target= "rat-sources" inheritall= "false" failonerror= "true" >
<fileset dir= "lucene" includes= "build.xml" />
<fileset dir= "solr" includes= "build.xml" />
2015-07-23 11:53:30 -04:00
<propertyset refid= "uptodate.and.compiled.properties" />
2012-09-28 09:44:36 -04:00
</subant>
2012-04-04 01:03:53 -04:00
</target>
2012-10-08 08:17:55 -04:00
<target name= "resolve" description= "Resolves all dependencies" >
2012-09-28 09:44:36 -04:00
<subant target= "resolve" inheritall= "false" failonerror= "true" >
<fileset dir= "lucene" includes= "build.xml" />
<fileset dir= "solr" includes= "build.xml" />
2015-07-23 11:53:30 -04:00
<propertyset refid= "uptodate.and.compiled.properties" />
2012-09-28 09:44:36 -04:00
</subant>
2012-03-30 14:04:43 -04:00
</target>
2013-02-06 12:57:53 -05:00
<!-- lucene/test - framework and solr/test - framework are excluded from compilation -->
2011-04-15 20:50:56 -04:00
<target name= "compile" description= "Compile Lucene and Solr" >
2012-09-28 09:44:36 -04:00
<subant target= "compile" inheritall= "false" failonerror= "true" >
<fileset dir= "lucene" includes= "build.xml" />
<fileset dir= "solr" includes= "build.xml" />
2015-07-23 11:53:30 -04:00
<propertyset refid= "uptodate.and.compiled.properties" />
</subant>
</target>
<target name= "compile-core" description= "Compile Lucene Core" >
<subant target= "compile-core" inheritall= "false" failonerror= "true" >
<fileset dir= "lucene" includes= "build.xml" />
<propertyset refid= "uptodate.and.compiled.properties" />
2012-09-28 09:44:36 -04:00
</subant>
2010-04-13 09:28:56 -04:00
</target>
2013-02-06 12:57:53 -05:00
<target name= "compile-test" description= "Compile Lucene and Solr tests and test-frameworks" >
<subant target= "compile-test" inheritAll= "false" failonerror= "true" >
<fileset dir= "lucene" includes= "build.xml" />
<fileset dir= "solr" includes= "build.xml" />
2015-07-23 11:53:30 -04:00
<propertyset refid= "uptodate.and.compiled.properties" />
2013-02-06 12:57:53 -05:00
</subant>
</target>
<target name= "jar" description= "Build Lucene and Solr Jar files" >
<subant target= "jar" inheritall= "false" failonerror= "true" >
<fileset dir= "lucene" includes= "build.xml" />
<fileset dir= "solr" includes= "build.xml" />
2015-07-23 11:53:30 -04:00
<propertyset refid= "uptodate.and.compiled.properties" />
2013-02-06 12:57:53 -05:00
</subant>
</target>
2013-08-30 10:06:22 -04:00
<target name= "jar-src" description= "Build Lucene and Solr Source Jar files" >
<subant target= "jar-src" inheritall= "false" failonerror= "true" >
<fileset dir= "lucene" includes= "build.xml" />
<fileset dir= "solr" includes= "build.xml" />
2015-07-23 11:53:30 -04:00
<propertyset refid= "uptodate.and.compiled.properties" />
2013-08-30 10:06:22 -04:00
</subant>
</target>
2013-11-02 01:04:19 -04:00
<target name= "get-maven-poms" depends= "resolve"
2012-12-19 11:24:09 -05:00
description="Copy Maven POMs from dev-tools/maven/ to maven-build/">
2013-10-31 11:20:08 -04:00
<ant dir= "lucene" target= "-get-maven-poms" inheritall= "false" />
2011-01-20 22:44:13 -05:00
</target>
2012-05-08 00:33:02 -04:00
<target name= "clean-maven-build"
2012-09-28 09:44:36 -04:00
description="Clean up Maven POMs in working copy">
2012-05-08 00:33:02 -04:00
<delete failonerror= "true" dir= "${maven-build-dir}/" />
</target>
2017-03-02 11:43:44 -05:00
<target name= "generate-maven-artifacts" depends= "resolve,resolve-groovy,resolve-markdown,install-maven-tasks"
2012-04-03 16:52:02 -04:00
description="Generate Maven Artifacts for Lucene and Solr">
2010-09-19 23:58:23 -04:00
<property name= "maven.dist.dir" location= "dist/maven" />
<mkdir dir= "${maven.dist.dir}" />
2013-11-02 01:04:19 -04:00
<ant dir= "lucene" inheritall= "false" >
<target name= "-unpack-lucene-tgz" />
<target name= "-filter-pom-templates" />
2015-07-23 11:53:30 -04:00
<propertyset refid= "uptodate.and.compiled.properties" />
</ant>
<ant dir= "solr" target= "-unpack-solr-tgz" inheritall= "false" >
<propertyset refid= "uptodate.and.compiled.properties" />
2013-11-02 01:04:19 -04:00
</ant>
<subant target= "-dist-maven" inheritall= "false" failonerror= "true" >
2012-09-28 09:44:36 -04:00
<property name= "maven.dist.dir" location= "${maven.dist.dir}" />
<fileset dir= "lucene" includes= "build.xml" />
<fileset dir= "solr" includes= "build.xml" />
2015-07-23 11:53:30 -04:00
<propertyset refid= "uptodate.and.compiled.properties" />
2012-09-28 09:44:36 -04:00
</subant>
2010-06-16 22:25:11 -04:00
</target>
2017-09-07 09:22:56 -04:00
<target name= "-install-maven-artifacts" depends= "resolve,resolve-groovy,resolve-markdown,install-maven-tasks" >
<ant dir= "lucene" inheritall= "false" >
<target name= "-unpack-lucene-tgz" />
<target name= "-filter-pom-templates" />
<propertyset refid= "uptodate.and.compiled.properties" />
</ant>
<ant dir= "solr" target= "-unpack-solr-tgz" inheritall= "false" >
<propertyset refid= "uptodate.and.compiled.properties" />
</ant>
<subant target= "-install-to-maven-local-repo" inheritall= "false" failonerror= "true" >
<fileset dir= "lucene" includes= "build.xml" />
<fileset dir= "solr" includes= "build.xml" />
<propertyset refid= "uptodate.and.compiled.properties" />
</subant>
</target>
<target name= "validate-maven-dependencies" depends= "-install-maven-artifacts"
2013-10-31 11:20:08 -04:00
description="Validates maven dependencies, licenses, etc.">
2015-07-23 11:53:30 -04:00
<subant target= "-validate-maven-dependencies" inheritall= "false" failonerror= "true" >
<fileset dir= "lucene" includes= "build.xml" />
<fileset dir= "solr" includes= "build.xml" />
<propertyset refid= "uptodate.and.compiled.properties" />
</subant>
2012-09-06 13:39:06 -04:00
</target>
2012-09-09 05:19:32 -04:00
2015-07-23 11:53:30 -04:00
<target name= "run-maven-build" depends= "get-maven-poms,install-maven-tasks,resolve-groovy" description= "Runs the Maven build using automatically generated POMs" >
2018-02-10 14:24:33 -05:00
<groovy src= "${common.dir}/tools/src/groovy/run-maven-build.groovy" />
2012-09-09 05:19:32 -04:00
</target>
<target name= "remove-maven-artifacts" description= "Removes all Lucene/Solr Maven artifacts from the local repository" >
<echo message= "Removing all Lucene/Solr Maven artifacts from '${user.home}/.m2/repository'..." />
<delete includeemptydirs= "true" >
2012-09-09 05:30:52 -04:00
<fileset dir= "${user.home}/.m2/repository" erroronmissingdir= "false" >
2012-09-09 05:19:32 -04:00
<include name= "org/apache/lucene/**" />
<include name= "org/apache/solr/**" />
</fileset>
</delete>
</target>
2012-09-06 13:39:06 -04:00
2013-12-10 10:50:38 -05:00
<target name= "netbeans" depends= "resolve" description= "Setup Netbeans configuration" >
<pathconvert property= "netbeans.fileset.sourcefolders" pathsep= "|" dirsep= "/" >
2013-12-11 10:53:18 -05:00
<dirset dir= "${basedir}/lucene" includes= "**/src/java, **/src/examples, **/src/test, **/src/resources"
2014-09-02 10:25:58 -04:00
excludes="tools/**, build/**" />
2013-12-11 10:53:18 -05:00
<dirset dir= "${basedir}/solr" includes= "**/src/java, **/src/examples, **/src/test, **/src/resources"
excludes="build/**" />
2013-12-10 10:50:38 -05:00
<map from= "${basedir}/" to= "" />
</pathconvert>
2013-12-11 10:53:18 -05:00
<!-- TODO: find a better way to exclude duplicate JAR files & fix the servlet - api mess! -->
<pathconvert property= "netbeans.path.libs" pathsep= ":" dirsep= "/" >
<fileset dir= "${basedir}/lucene" includes= "**/lib/*.jar"
2018-07-07 09:20:40 -04:00
excludes="**/*servlet-api*.jar, tools/**, build/**"/>
2013-12-11 10:53:18 -05:00
<fileset dir= "${basedir}/solr" includes= "**/test-lib/*.jar,**/lib/*.jar"
2015-07-27 14:12:45 -04:00
excludes="core/test-lib/*servlet-api*.jar, contrib/analysis-extras/**, test-framework/lib/junit*, test-framework/lib/ant*, test-framework/lib/randomizedtesting*, build/**, dist/**, package/**, server/solr-webapp/**" />
2013-12-10 10:50:38 -05:00
<map from= "${basedir}/" to= "" />
</pathconvert>
<mkdir dir= "nbproject" />
2013-12-11 10:53:18 -05:00
<copy todir= "nbproject" overwrite= "true" >
<fileset dir= "dev-tools/netbeans/nbproject" />
</copy>
2013-12-10 10:50:38 -05:00
<xslt in= "${ant.file}" out= "nbproject/project.xml" style= "dev-tools/netbeans/nb-project.xsl" force= "true" >
<outputproperty name= "indent" value= "yes" />
<param name= "netbeans.fileset.sourcefolders" expression= "${netbeans.fileset.sourcefolders}" />
2013-12-11 10:53:18 -05:00
<param name= "netbeans.path.libs" expression= "${netbeans.path.libs}" />
<param name= "netbeans.source-level" expression= "1.7" />
2013-12-10 10:50:38 -05:00
</xslt>
</target>
<target name= "clean-netbeans" description= "Removes all Netbeans configuration files" >
<delete dir= "nbproject" failonerror= "true" />
<delete dir= "nb-build" failonerror= "true" />
</target>
2012-10-08 08:17:55 -04:00
<target name= "eclipse" depends= "resolve" description= "Setup Eclipse configuration" >
2013-06-06 17:32:53 -04:00
<basename file= "${basedir}" property= "eclipseprojectname" />
2018-03-18 06:43:51 -04:00
<copy file= "dev-tools/eclipse/dot.project" tofile= ".project" overwrite= "false" encoding= "UTF-8" >
<filterset >
<filter token= "ECLIPSEPROJECTNAME" value= "${eclipseprojectname}" />
</filterset>
</copy>
<copy overwrite= "false" todir= "eclipse-build" encoding= "UTF-8" >
<fileset dir= "dev-tools/eclipse" includes= "*.launch" />
2013-06-06 17:32:53 -04:00
<filterset >
<filter token= "ECLIPSEPROJECTNAME" value= "${eclipseprojectname}" />
</filterset>
</copy>
2010-12-31 16:08:18 -05:00
<mkdir dir= ".settings" />
2012-02-15 15:47:00 -05:00
<copy todir= ".settings/" overwrite= "true" >
<fileset dir= "dev-tools/eclipse/dot.settings" includes= "*.prefs" />
</copy>
2018-03-18 06:43:51 -04:00
2012-12-10 18:59:19 -05:00
<pathconvert property= "eclipse.fileset.sourcefolders" pathsep= "|" dirsep= "/" >
2014-09-02 10:25:58 -04:00
<dirset dir= "${basedir}/lucene" includes= "**/src/java, **/src/resources, **/src/test, **/src/test-files, **/src/examples" excludes= "tools/**, build/**" />
2012-12-10 18:59:19 -05:00
<dirset dir= "${basedir}/solr" includes= "**/src/java, **/src/resources, **/src/test, **/src/test-files, **/src/examples" excludes= "build/**" />
<map from= "${basedir}/" to= "" />
</pathconvert>
<!-- TODO: find a better way to exclude duplicate JAR files & fix the servlet - api mess! -->
<pathconvert property= "eclipse.fileset.libs" pathsep= "|" dirsep= "/" >
2018-07-07 09:20:40 -04:00
<fileset dir= "${basedir}/lucene" includes= "**/lib/*.jar" excludes= "**/*servlet-api*.jar, tools/**, build/**" />
2013-07-11 00:03:24 -04:00
<fileset dir= "${basedir}/solr" includes= "**/test-lib/*.jar,**/lib/*.jar" excludes= "core/test-lib/*servlet-api*.jar, contrib/analysis-extras/**, test-framework/lib/junit*, test-framework/lib/ant*, test-framework/lib/randomizedtesting*, build/**, dist/**, package/**" />
2012-12-10 18:59:19 -05:00
<map from= "${basedir}/" to= "" />
</pathconvert>
2018-03-18 06:43:51 -04:00
<pathconvert property= "eclipse.fileset.webfolders" pathsep= "|" dirsep= "/" >
<dirset dir= "${basedir}/solr/server/contexts" excludes= "**/*" />
<dirset dir= "${basedir}/solr/server/etc" excludes= "**/*" />
<dirset dir= "${basedir}/solr/server/modules" excludes= "**/*" />
<dirset dir= "${basedir}/solr/server/solr" excludes= "**/*" />
<dirset dir= "${basedir}/solr/webapp/web" excludes= "**/*" />
<map from= "${basedir}/" to= "" />
</pathconvert>
2012-12-10 18:59:19 -05:00
<xslt in= "${ant.file}" out= ".classpath" style= "dev-tools/eclipse/dot.classpath.xsl" force= "true" >
<outputproperty name= "indent" value= "yes" />
<param name= "eclipse.fileset.libs" expression= "${eclipse.fileset.libs}" />
<param name= "eclipse.fileset.sourcefolders" expression= "${eclipse.fileset.sourcefolders}" />
2018-03-18 06:43:51 -04:00
<param name= "eclipse.fileset.webfolders" expression= "${eclipse.fileset.webfolders}" />
2012-12-10 18:59:19 -05:00
</xslt>
2010-12-31 16:08:18 -05:00
<echo >
2012-02-15 15:47:00 -05:00
SUCCESS: You must right-click your project and choose Refresh.
2019-04-16 08:00:09 -04:00
Your project must use a Java 11 JRE.
2010-12-31 16:08:18 -05:00
</echo>
</target>
2012-09-28 09:44:36 -04:00
<target name= "clean-eclipse" description= "Removes all Eclipse configuration files" >
<delete dir= ".settings" failonerror= "true" />
<delete failonerror= "true" >
<fileset dir= "." includes= ".classpath,.project" />
</delete>
<delete dir= "eclipse-build" failonerror= "true" />
</target>
2012-10-08 08:17:55 -04:00
<target name= "idea" depends= "resolve" description= "Setup IntelliJ IDEA configuration" >
2013-09-20 01:23:41 -04:00
<condition property= "idea.jdk.is.set" >
<isset property= "idea.jdk" />
</condition>
2013-09-20 01:37:26 -04:00
<!-- Define ${idea.jdk} if it's not yet defined - otherwise literal "${idea.jdk}" is substituted -->
2013-09-20 01:23:41 -04:00
<property name= "idea.jdk" value= "" />
2014-08-22 15:14:11 -04:00
<!-- delete those files first, so they are regenerated by the filtering below
(add more files with dynamic properties like versions here): -->
<delete dir= ".idea" includes= "misc.xml workspace.xml" />
<!-- Copy files with filtering: -->
<copy todir= "." overwrite= "false" encoding= "UTF-8" >
2011-02-24 08:02:44 -05:00
<fileset dir= "dev-tools/idea" />
2013-09-20 02:53:16 -04:00
<filterset begintoken= "subst.="" endtoken= """ >
2013-09-19 21:45:33 -04:00
<filter token= "idea.jdk" value= "${idea.jdk}" />
</filterset>
2014-08-22 15:14:11 -04:00
<filterset >
<filter token= "version" value= "${version}" />
<filter token= "version.base" value= "${version.base}" />
</filterset>
2010-12-30 14:49:51 -05:00
</copy>
2013-09-20 01:23:41 -04:00
<antcall target= "-post-idea-instructions" />
</target>
<target name= "-post-idea-instructions" unless= "idea.jdk.is.set" >
2010-12-30 14:49:51 -05:00
<echo >
2013-09-20 01:23:41 -04:00
To complete IntelliJ IDEA setup, you must manually configure
File | Project Structure | Project | Project SDK.
You won't have to do this in the future if you define property
$${idea.jdk}, e.g. in ~/lucene.build.properties, ~/build.properties
or lucene/build.properties, with a value consisting of the
following two XML attributes/values (adjust values according to
JDKs you have defined locally - see
File | Project Structure | Platform Settings | SDKs):
2019-04-16 08:00:09 -04:00
idea.jdk = project-jdk-name="11" project-jdk-type="JavaSDK"
2010-12-30 14:49:51 -05:00
</echo>
</target>
2012-06-26 07:47:31 -04:00
2011-02-24 08:02:44 -05:00
<target name= "clean-idea"
2010-12-30 14:49:51 -05:00
description="Removes all IntelliJ IDEA configuration files">
<delete dir= ".idea" failonerror= "true" />
<delete failonerror= "true" >
<fileset dir= "." includes= "*.iml,*.ipr,*.iws" />
<fileset dir= "solr" includes= "**/*.iml" />
<fileset dir= "lucene" includes= "**/*.iml" />
</delete>
2012-09-13 18:48:59 -04:00
<delete dir= "idea-build" failonerror= "true" />
2010-12-30 14:49:51 -05:00
</target>
2012-09-28 09:44:36 -04:00
<target name= "clean" description= "Clean Lucene and Solr build dirs" >
2010-09-19 23:58:23 -04:00
<delete dir= "dist" />
2012-10-19 06:53:18 -04:00
<delete dir= "${tests.heap-dump-dir}" />
<subant target= "clean" inheritall= "false" failonerror= "true" >
<fileset dir= "lucene" includes= "build.xml" />
<fileset dir= "solr" includes= "build.xml" />
2015-07-23 11:53:30 -04:00
<propertyset refid= "uptodate.and.compiled.properties" />
2012-10-19 06:53:18 -04:00
</subant>
2010-03-17 18:25:11 -04:00
</target>
2014-02-23 17:25:52 -05:00
<target name= "clean-jars" description= "Remove all JAR files from lib folders in the checkout" >
<delete failonerror= "true" >
<fileset dir= "." >
<include name= "**/*.jar" />
<exclude name= "*/build/**" />
<exclude name= "*/dist/**" />
<exclude name= "*/package/**" />
<exclude name= "*/example/exampledocs/**" />
</fileset>
</delete>
</target>
2012-08-03 10:05:26 -04:00
<target name= "jar-checksums" description= "Recompute SHA1 checksums for all JAR files." >
2012-09-28 09:44:36 -04:00
<subant target= "jar-checksums" inheritall= "false" failonerror= "true" >
<fileset dir= "lucene" includes= "build.xml" />
<fileset dir= "solr" includes= "build.xml" />
2015-07-23 11:53:30 -04:00
<propertyset refid= "uptodate.and.compiled.properties" />
2012-09-28 09:44:36 -04:00
</subant>
2012-04-14 15:23:09 -04:00
</target>
2019-04-16 08:00:09 -04:00
<target name= "-nightly-smoke-java12params" if= "smokeTestRelease.java12" >
2018-02-09 12:45:10 -05:00
<!-- convert path to UNIX style, so windows backslashes don't hurt escaping: -->
2019-04-16 08:00:09 -04:00
<pathconvert targetos= "unix" property= "-smokeTestRelease.java12params" >
<regexpmapper from= "^(.*)$" to= "--test-java12 '\1'" />
<path location= "${smokeTestRelease.java12}" />
2018-02-09 12:45:10 -05:00
</pathconvert>
</target>
2019-04-16 08:00:09 -04:00
<target name= "nightly-smoke" description= "Builds an unsigned release and smoke tests it (pass '-DsmokeTestRelease.java12=/path/to/jdk-12' to additionally test with Java 12 or later)"
depends="clean,resolve-groovy,resolve-markdown,install-maven-tasks,-nightly-smoke-java12params">
<fail message= "To run nightly smoke, the JDK must be exactly Java 11, was: ${java.specification.version}" >
2014-08-30 11:48:16 -04:00
<condition >
2019-04-16 08:00:09 -04:00
<not > <equals arg1= "${java.specification.version}" arg2= "11" /> </not>
2014-08-30 11:48:16 -04:00
</condition>
</fail>
2019-04-16 08:00:09 -04:00
<property name= "-smokeTestRelease.java12params" value= "" /> <!-- (if not yet defined) -->
2014-08-30 11:48:16 -04:00
<exec executable= "${python32.exe}" failonerror= "true" taskname= "python32" >
2013-07-04 13:33:41 -04:00
<arg value= "-V" />
2014-08-30 11:48:16 -04:00
</exec>
<subant target= "prepare-release-no-sign" inheritall= "false" failonerror= "true" >
<fileset dir= "lucene" includes= "build.xml" />
<fileset dir= "solr" includes= "build.xml" />
<!-- pass ${version.base} here to emulate a real release, without appendix like " - SNAPSHOT": -->
<property name= "version" value= "${version.base}" />
2015-07-24 16:01:09 -04:00
<propertyset refid= "uptodate.and.compiled.properties" />
</subant>
2014-08-30 11:48:16 -04:00
<mkdir dir= "${smokeTestRelease.dir}" />
<copy todir= "${smokeTestRelease.dir}/lucene" >
<fileset dir= "lucene/dist" />
</copy>
<copy todir= "${smokeTestRelease.dir}/solr" >
<fileset dir= "solr/package" />
</copy>
<local name= "url" />
<makeurl file= "${smokeTestRelease.dir}" validate= "false" property= "url" />
<exec executable= "${python32.exe}" failonerror= "true" taskname= "smoker" >
<arg value= "-u" />
<!-- Tell Python not to write any bytecode cache into the filesystem: -->
<arg value= "-B" />
<arg file= "dev-tools/scripts/smokeTestRelease.py" />
2019-04-16 08:00:09 -04:00
<arg line= "${-smokeTestRelease.java12params}" />
2014-08-30 11:48:16 -04:00
<arg value= "--revision" />
<arg value= "skip" />
<!-- pass ${version.base} here to emulate a real release, without appendix like " - SNAPSHOT": -->
<arg value= "--version" />
<arg value= "${version.base}" />
<arg value= "--tmp-dir" />
<arg file= "${smokeTestRelease.tmp}" />
<arg value= "--not-signed" />
<arg value= "${url}" />
<arg value= "${smokeTestRelease.testArgs}" />
</exec>
<delete dir= "${smokeTestRelease.dir}" />
<delete dir= "${smokeTestRelease.tmp}" />
2012-08-07 16:58:46 -04:00
</target>
2012-08-10 10:58:59 -04:00
2016-01-24 16:05:38 -05:00
<macrodef xmlns:ivy= "antlib:org.apache.ivy.ant" name= "wc-checker" >
<attribute name= "failonmodifications" /> <!-- fail if modifications were found, otherwise it only fails on unversioned files -->
<sequential >
<local name= "wc.unversioned.files" />
<local name= "wc.modified.files" />
<ivy:cachepath xmlns:ivy= "antlib:org.apache.ivy.ant"
organisation="org.eclipse.jgit" module="org.eclipse.jgit" revision="${jgit-version}"
inline="true" conf="default" transitive="true" pathid="jgit.classpath"/>
2018-02-10 14:24:33 -05:00
<groovy taskname= "wc-checker" classpathref= "jgit.classpath" src= "${common.dir}/tools/src/groovy/check-working-copy.groovy" />
2016-01-24 16:05:38 -05:00
<fail if= "wc.unversioned.files"
message="Source checkout is dirty (unversioned/missing files) after running tests!!! Offending files:${line.separator}${wc.unversioned.files}"/>
<fail message= "Source checkout is modified!!! Offending files:${line.separator}${wc.modified.files}" >
<condition >
<and >
<istrue value= "@{failonmodifications}" />
<isset property= "wc.modified.files" />
</and>
</condition>
</fail>
</sequential>
</macrodef>
<target name= "check-working-copy" description= "Checks working copy for unversioned changes" depends= "resolve-groovy" >
<wc-checker failonmodifications= "${is.jenkins.build}" />
2012-08-10 19:18:18 -04:00
</target>
2018-02-11 04:49:01 -05:00
<target name= "run-clover" description= "Runs all tests to measure coverage and generates report (pass "ANT_OPTS=-Xmx2G" as environment)" depends= "clean" >
2014-08-30 14:00:10 -04:00
<antcall inheritAll= "false" >
2012-08-11 07:11:36 -04:00
<param name= "run.clover" value= "true" />
<!-- must be 1, as clover does not like parallel test runs: -->
2012-12-05 15:15:11 -05:00
<param name= "tests.jvms.override" value= "1" />
2012-10-19 06:53:18 -04:00
<!-- Also override some other props to be fast: -->
2012-08-11 07:11:36 -04:00
<param name= "tests.multiplier" value= "1" />
<param name= "tests.nightly" value= "false" />
<param name= "tests.weekly" value= "false" />
2012-09-23 08:53:48 -04:00
<param name= "tests.badapples" value= "true" />
<!-- The idea behind Clover is to determine test coverage, so be immune to failing tests: -->
<param name= "tests.haltonfailure" value= "false" />
2012-09-28 09:44:36 -04:00
2015-07-25 10:20:20 -04:00
<target name= "clover" />
2012-09-28 09:44:36 -04:00
<target name= "test" />
<target name= "-generate-clover-reports" />
2015-07-25 10:20:20 -04:00
<propertyset refid= "uptodate.and.compiled.properties" />
2012-08-11 07:11:36 -04:00
</antcall>
</target>
2012-09-06 13:39:06 -04:00
2015-07-23 11:53:30 -04:00
<!--
Run after Junit tests.
This target is in a separate file, as it needs to include common-build.xml,
but must run from top-level!
-->
<target name= "-generate-clover-reports" depends= "clover" >
<fail unless= "run.clover" > Clover not enabled!</fail>
<mkdir dir= "${clover.report.dir}" />
<fileset dir= "." id= "clover.test.result.files" >
<include name= "*/build/**/test/TEST-*.xml" />
</fileset>
2018-02-11 13:24:22 -05:00
<fileset dir= "." id= "clover.test.src.files" >
<include name= "**/src/test/**/*.java" />
<!-- test framework source files are all test code: -->
<include name= "*/test-framework/src/**/*.java" />
</fileset>
2015-07-23 11:53:30 -04:00
<clover-report projectName= "Apache Lucene/Solr" >
<current outfile= "${clover.report.dir}" title= "Apache Lucene/Solr ${version}" numThreads= "0" >
<format type= "html" filter= "assert" />
<testresults refid= "clover.test.result.files" />
2018-02-11 13:24:22 -05:00
<testsources refid= "clover.test.src.files" />
2015-07-23 11:53:30 -04:00
</current>
<current outfile= "${clover.report.dir}/clover.xml" title= "Apache Lucene/Solr ${version}" >
<format type= "xml" filter= "assert" />
<testresults refid= "clover.test.result.files" />
2018-02-11 13:24:22 -05:00
<testsources refid= "clover.test.src.files" />
2015-07-23 11:53:30 -04:00
</current>
</clover-report>
<echo > You can find the merged Lucene/Solr Clover report in '${clover.report.dir}'.</echo>
2012-09-28 09:44:36 -04:00
</target>
2015-07-24 05:36:36 -04:00
<target name= "test-with-heapdumps" depends= "resolve-groovy,-test-with-heapdumps-enabled,-test-with-heapdumps-disabled" description= "Runs tests with heap dumps on OOM enabled (if VM supports this)" />
2012-10-19 06:53:18 -04:00
<condition property= "vm.supports.heapdumps" >
<or >
<contains string= "${java.vm.name}" substring= "hotspot" casesensitive= "false" />
<contains string= "${java.vm.name}" substring= "openjdk" casesensitive= "false" />
</or>
</condition>
<target name= "-test-with-heapdumps-enabled" if= "vm.supports.heapdumps" >
<echo level= "info" message= "${java.vm.name}: Enabling heap dumps on OutOfMemoryError to dir '${tests.heap-dump-dir}'." />
<mkdir dir= "${tests.heap-dump-dir}" />
<delete includeEmptyDirs= "true" >
<fileset dir= "${tests.heap-dump-dir}" includes= "**/*" />
</delete>
<antcall inheritAll= "false" target= "test" >
<param name= "tests.heapdump.args" value= "-XX:+HeapDumpOnOutOfMemoryError "-XX:HeapDumpPath=${tests.heap-dump-dir}"" />
2015-07-23 17:07:02 -04:00
<propertyset refid= "uptodate.and.compiled.properties" />
2012-10-19 06:53:18 -04:00
</antcall>
<pathconvert property= "heapdumps.list" setonempty= "false" pathsep= "${line.separator}" >
<fileset dir= "${tests.heap-dump-dir}" />
<map from= "${tests.heap-dump-dir}${file.separator}" to= "* " />
</pathconvert>
<fail if= "heapdumps.list" message= "Some of the tests produced a heap dump, but did not fail. Maybe a suppressed OutOfMemoryError? Dumps created:${line.separator}${heapdumps.list}" />
<delete dir= "${tests.heap-dump-dir}" />
</target>
<target name= "-test-with-heapdumps-disabled" unless= "vm.supports.heapdumps" >
<echo level= "warning" message= "WARN: The used JVM (${java.vm.name}) does not support HPROF heap dumps on OutOfMemoryError." />
2015-07-24 05:36:36 -04:00
<antcall target= "test" >
<propertyset refid= "uptodate.and.compiled.properties" />
</antcall>
2012-10-19 06:53:18 -04:00
</target>
2014-09-24 17:51:43 -04:00
<target name= "regenerate" description= "Runs all code regenerators" >
2014-12-08 16:49:35 -05:00
<subant target= "regenerate" inheritall= "false" failonerror= "true" >
2014-09-24 17:51:43 -04:00
<fileset dir= "lucene" includes= "build.xml" />
<!-- todo:
<fileset dir= "solr" includes= "build.xml" /> -->
2015-07-23 11:53:30 -04:00
<propertyset refid= "uptodate.and.compiled.properties" />
2014-09-24 17:51:43 -04:00
</subant>
</target>
2015-07-23 11:53:30 -04:00
<!-- should only be called by jenkins, not precommit! -->
2016-01-24 16:05:38 -05:00
<target name= "-check-after-regeneration" depends= "resolve-groovy" >
<wc-checker failonmodifications= "true" />
2014-09-24 17:51:43 -04:00
</target>
<!-- TODO: remove me when jenkins works -->
<target name= "regenerateAndCheck" depends= "regenerate,-check-after-regeneration" />
2016-01-24 16:05:38 -05:00
2014-09-24 17:51:43 -04:00
<target name= "-append-all-modules-dependencies-properties" >
2015-07-23 11:53:30 -04:00
<delete file= "lucene/build/module.dependencies.properties" />
<subant target= "-append-module-dependencies-properties" inheritall= "false" failonerror= "true" >
<fileset dir= "lucene" includes= "build.xml" />
<fileset dir= "solr" includes= "build.xml" />
<propertyset refid= "uptodate.and.compiled.properties" />
</subant>
2014-09-24 17:51:43 -04:00
</target>
2012-09-28 09:44:36 -04:00
<!-- Jenkins tasks -->
2016-01-23 07:47:14 -05:00
<target name= "-jenkins-base" depends= "-print-java-info,clean,test-with-heapdumps,validate,documentation-lint,jar-checksums,check-working-copy" />
2014-09-24 17:51:43 -04:00
<target name= "-print-java-info" >
<echo level= "info" taskname= "java-info" > java version " ${java.version}"
${java.runtime.name} (${java.runtime.version}, ${java.vendor})
2014-09-25 03:01:11 -04:00
${java.vm.name} (${java.vm.version}, ${java.vm.vendor})
2014-09-24 17:51:43 -04:00
Test args: [${args}]</echo>
</target>
2013-02-08 17:00:15 -05:00
<target name= "jenkins-hourly" >
<antcall >
<param name= "is.jenkins.build" value= "true" />
2016-07-17 07:02:03 -04:00
<param name= "tests.haltonfailure" value= "false" />
2018-02-27 16:36:14 -05:00
<param name= "tests.badapples" value= "false" />
2018-02-26 23:33:41 -05:00
<target name= "-jenkins-base" />
</antcall>
</target>
<target name= "jenkins-badapples" >
<antcall >
<param name= "is.jenkins.build" value= "true" />
<param name= "tests.haltonfailure" value= "false" />
2018-02-27 16:36:14 -05:00
<param name= "tests.badapples" value= "true" />
2013-02-08 17:00:15 -05:00
<target name= "-jenkins-base" />
</antcall>
</target>
2012-09-28 09:44:36 -04:00
2012-12-18 05:03:29 -05:00
<target name= "jenkins-nightly" >
<antcall >
2013-02-08 17:00:15 -05:00
<param name= "is.jenkins.build" value= "true" />
2016-07-17 07:02:03 -04:00
<param name= "tests.haltonfailure" value= "false" />
2012-12-18 05:03:29 -05:00
<param name= "tests.nightly" value= "true" />
2018-02-27 16:36:14 -05:00
<param name= "tests.badapples" value= "false" />
2013-02-08 17:00:15 -05:00
<target name= "-jenkins-base" />
2012-12-18 05:03:29 -05:00
</antcall>
</target>
2018-02-27 17:08:12 -05:00
<target name= "jenkins-nightly-badapples" >
<antcall >
<param name= "is.jenkins.build" value= "true" />
<param name= "tests.haltonfailure" value= "false" />
<param name= "tests.nightly" value= "true" />
<param name= "tests.badapples" value= "true" />
<target name= "-jenkins-base" />
</antcall>
</target>
2017-03-02 11:43:44 -05:00
<target name= "jenkins-maven-nightly" depends= "-print-java-info,clean,clean-maven-build,resolve-groovy,resolve-markdown,install-maven-tasks" >
2018-01-11 15:14:38 -05:00
<!-- step 1: build, install, validate and publish ANT - generated maven artifacts: -->
2012-12-12 08:57:33 -05:00
<antcall >
2013-02-08 17:00:15 -05:00
<param name= "is.jenkins.build" value= "true" />
2012-12-12 08:57:33 -05:00
<target name= "remove-maven-artifacts" />
<target name= "validate-maven-dependencies" />
2018-01-11 15:14:38 -05:00
<target name= "generate-maven-artifacts" />
2012-12-12 08:57:33 -05:00
</antcall>
<!-- step 2: run the maven build to check that the pom templates also work to drive "mvn": -->
<antcall >
2013-02-08 17:00:15 -05:00
<param name= "is.jenkins.build" value= "true" />
2012-12-12 08:57:33 -05:00
<target name= "remove-maven-artifacts" />
<target name= "run-maven-build" />
</antcall>
</target>
2012-09-28 09:44:36 -04:00
2014-09-24 17:51:43 -04:00
<target name= "jenkins-clover" depends= "-print-java-info" >
2013-02-08 17:00:15 -05:00
<antcall >
<param name= "is.jenkins.build" value= "true" />
<target name= "run-clover" />
</antcall>
</target>
2013-07-23 17:59:18 -04:00
2015-07-23 11:53:30 -04:00
<!-- useless targets (override common - build.xml): -->
<target name= "generate-test-reports" />
2010-04-13 09:28:56 -04:00
</project>