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.
|
|
|
|
-->
|
|
|
|
|
2010-03-17 17:54:11 -04:00
|
|
|
<project name="lucene-solr" default="test" basedir=".">
|
2012-04-15 10:41:44 -04:00
|
|
|
<target name="test-help" description="Test runner help">
|
|
|
|
<subant target="test-help" inheritall="false" failonerror="true">
|
|
|
|
<fileset dir="lucene" includes="build.xml" />
|
|
|
|
</subant>
|
|
|
|
</target>
|
|
|
|
|
2012-07-20 10:26:07 -04:00
|
|
|
<target name="test" description="Test both Lucene and Solr">
|
2010-03-17 17:31:44 -04:00
|
|
|
<sequential>
|
|
|
|
<subant target="test" inheritall="false" failonerror="true">
|
2010-03-17 18:25:11 -04:00
|
|
|
<fileset dir="lucene" includes="build.xml" />
|
|
|
|
<fileset dir="solr" includes="build.xml" />
|
2010-03-17 17:31:44 -04:00
|
|
|
</subant>
|
|
|
|
</sequential>
|
|
|
|
</target>
|
2012-02-13 09:12:59 -05:00
|
|
|
|
2011-11-21 10:45:07 -05:00
|
|
|
<target name="javadocs" description="Generate Lucene and Solr javadocs">
|
|
|
|
<sequential>
|
|
|
|
<subant target="javadocs" inheritall="false" failonerror="true">
|
|
|
|
<fileset dir="lucene" includes="build.xml" />
|
|
|
|
<fileset dir="solr" includes="build.xml" />
|
|
|
|
</subant>
|
2012-04-23 00:29:21 -04:00
|
|
|
</sequential>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="javadocs-lint">
|
|
|
|
<sequential>
|
|
|
|
<subant target="javadocs-lint" inheritall="false" failonerror="true">
|
|
|
|
<fileset dir="lucene" includes="build.xml" />
|
|
|
|
<fileset dir="solr" includes="build.xml" />
|
|
|
|
</subant>
|
2011-11-21 10:45:07 -05:00
|
|
|
</sequential>
|
|
|
|
</target>
|
2012-02-13 09:12:59 -05:00
|
|
|
|
2012-08-10 11:37:31 -04:00
|
|
|
<target name="validate" description="Validate dependencies, licenses, etc." depends="-validate-source-patterns">
|
|
|
|
<subant target="validate" inheritall="false" failonerror="true">
|
|
|
|
<fileset dir="lucene" includes="build.xml" />
|
|
|
|
<fileset dir="solr" includes="build.xml" />
|
|
|
|
</subant>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="-validate-source-patterns" unless="disable.source-patterns">
|
2012-08-10 10:58:59 -04:00
|
|
|
<!-- check that there are no nocommits or @author javadoc tags: -->
|
|
|
|
<property name="validate.currDir" location="."/>
|
|
|
|
<pathconvert pathsep="${line.separator}" dirsep="/" property="validate.patternsFound" setonempty="false">
|
|
|
|
<fileset dir="${validate.currDir}">
|
|
|
|
<include name="**/*.java"/>
|
|
|
|
<exclude name="**/backwards/**"/>
|
|
|
|
<or>
|
|
|
|
<containsregexp expression="@author\b" casesensitive="yes"/>
|
|
|
|
<containsregexp expression="\bno(n|)commit\b" casesensitive="no"/>
|
|
|
|
</or>
|
|
|
|
</fileset>
|
|
|
|
<map from="${validate.currDir}${file.separator}" to="* "/>
|
|
|
|
</pathconvert>
|
|
|
|
<fail if="validate.patternsFound">The following files contain @author tags or nocommits:${line.separator}${validate.patternsFound}</fail>
|
2011-03-18 14:40:02 -04:00
|
|
|
</target>
|
2012-02-13 09:12:59 -05:00
|
|
|
|
2012-04-04 01:03:53 -04:00
|
|
|
<target name="rat-sources" description="Runs rat across all sources and tests">
|
|
|
|
<sequential><subant target="rat-sources" inheritall="false" failonerror="true">
|
|
|
|
<fileset dir="lucene" includes="build.xml" />
|
|
|
|
<fileset dir="solr" includes="build.xml" />
|
|
|
|
</subant></sequential>
|
|
|
|
</target>
|
|
|
|
|
2012-06-26 07:47:31 -04:00
|
|
|
<target name="resolve" depends="clean-jars" description="Resolves all dependencies">
|
2012-03-30 14:04:43 -04:00
|
|
|
<sequential><subant target="resolve" inheritall="false" failonerror="true">
|
|
|
|
<fileset dir="lucene" includes="build.xml" />
|
|
|
|
<fileset dir="solr" includes="build.xml" />
|
|
|
|
</subant></sequential>
|
|
|
|
</target>
|
|
|
|
|
2011-04-15 20:50:56 -04:00
|
|
|
<target name="compile" description="Compile Lucene and Solr">
|
2010-04-13 09:28:56 -04:00
|
|
|
<sequential>
|
2011-03-18 14:40:02 -04:00
|
|
|
|
2010-04-13 09:28:56 -04:00
|
|
|
<subant target="compile" inheritall="false" failonerror="true">
|
2010-05-07 18:51:45 -04:00
|
|
|
<fileset dir="lucene" includes="build.xml" />
|
2010-04-13 09:28:56 -04:00
|
|
|
<fileset dir="solr" includes="build.xml" />
|
|
|
|
</subant>
|
|
|
|
</sequential>
|
|
|
|
</target>
|
|
|
|
|
2012-05-30 10:45:44 -04:00
|
|
|
<property name="version" value="5.0-SNAPSHOT"/>
|
2012-05-08 00:33:02 -04:00
|
|
|
<property name="maven-build-dir" value="maven-build"/>
|
2012-04-02 23:30:59 -04:00
|
|
|
<target name="get-maven-poms"
|
2012-05-08 00:33:02 -04:00
|
|
|
description="Copy Maven POMs from dev-tools/maven/ to ${maven-build-dir}/">
|
|
|
|
<copy todir="${maven-build-dir}" overwrite="true">
|
2011-01-20 22:44:13 -05:00
|
|
|
<fileset dir="${basedir}/dev-tools/maven"/>
|
2011-01-22 02:26:17 -05:00
|
|
|
<filterset begintoken="@" endtoken="@">
|
|
|
|
<filter token="version" value="${version}"/>
|
|
|
|
</filterset>
|
|
|
|
<globmapper from="*.template" to="*"/>
|
2011-01-20 22:44:13 -05:00
|
|
|
</copy>
|
|
|
|
</target>
|
|
|
|
|
2012-05-08 00:33:02 -04:00
|
|
|
<target name="clean-maven-build"
|
|
|
|
description="Remove ">
|
|
|
|
<delete failonerror="true" dir="${maven-build-dir}/"/>
|
|
|
|
</target>
|
|
|
|
|
2012-04-03 16:52:02 -04:00
|
|
|
<target name="generate-maven-artifacts"
|
|
|
|
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}" />
|
|
|
|
|
2010-06-16 22:25:11 -04:00
|
|
|
<sequential>
|
2012-04-03 16:52:02 -04:00
|
|
|
<ant dir="lucene" target="filter-pom-templates"/>
|
2010-06-16 22:25:11 -04:00
|
|
|
<subant target="generate-maven-artifacts" inheritall="false" failonerror="true">
|
2010-09-19 23:58:23 -04:00
|
|
|
<property name="maven.dist.dir" location="${maven.dist.dir}" />
|
2012-04-03 16:52:02 -04:00
|
|
|
<property name="filtered.pom.templates.uptodate" value="true"/>
|
2010-06-16 22:25:11 -04:00
|
|
|
<fileset dir="lucene" includes="build.xml" />
|
|
|
|
<fileset dir="solr" includes="build.xml" />
|
|
|
|
</subant>
|
|
|
|
</sequential>
|
|
|
|
</target>
|
|
|
|
|
2012-06-26 07:47:31 -04:00
|
|
|
<target name="eclipse" depends="clean-jars, resolve" description="Setup Eclipse configuration">
|
2011-05-24 02:05:30 -04:00
|
|
|
<copy file="dev-tools/eclipse/dot.project" tofile=".project" overwrite="false"/>
|
2010-12-31 16:08:18 -05:00
|
|
|
<copy file="dev-tools/eclipse/dot.classpath" tofile=".classpath" overwrite="true"/>
|
|
|
|
<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>
|
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.
|
|
|
|
Your project must use a Java 6 JRE.
|
2010-12-31 16:08:18 -05:00
|
|
|
</echo>
|
|
|
|
</target>
|
|
|
|
|
2012-06-26 07:47:31 -04:00
|
|
|
<target name="idea" depends="clean-jars, resolve" description="Setup IntelliJ IDEA configuration">
|
2010-12-30 14:49:51 -05:00
|
|
|
<copy todir=".">
|
2011-02-24 08:02:44 -05:00
|
|
|
<fileset dir="dev-tools/idea"/>
|
2010-12-30 14:49:51 -05:00
|
|
|
</copy>
|
|
|
|
<echo>
|
|
|
|
To complete IntelliJ IDEA setup, you must manually configure
|
2012-03-30 14:04:43 -04:00
|
|
|
File | Project Structure | Project | Project SDK.
|
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>
|
|
|
|
</target>
|
|
|
|
|
2012-07-20 10:26:07 -04:00
|
|
|
<target name="clean" description="Clean Lucene and Solr">
|
2010-09-19 23:58:23 -04:00
|
|
|
<delete dir="dist" />
|
2010-03-17 18:25:11 -04:00
|
|
|
<sequential>
|
|
|
|
<subant target="clean" inheritall="false" failonerror="true">
|
|
|
|
<fileset dir="lucene" includes="build.xml" />
|
|
|
|
<fileset dir="solr" includes="build.xml" />
|
|
|
|
</subant>
|
2012-03-09 09:41:18 -05:00
|
|
|
<delete dir="dist" failonerror="false" />
|
2010-03-17 18:25:11 -04:00
|
|
|
</sequential>
|
|
|
|
</target>
|
|
|
|
|
2012-03-30 14:04:43 -04:00
|
|
|
<!-- TODO: in the future, we don't need to actually put
|
|
|
|
jars in the lib/ folders, but can just put in classpath.
|
|
|
|
only packaging tasks really need that (and could do it
|
|
|
|
under build/ directories) -->
|
|
|
|
<target name="clean-jars" description="Clean local jars">
|
|
|
|
<delete>
|
|
|
|
<fileset dir="." includes="**/*.jar"/>
|
|
|
|
</delete>
|
|
|
|
</target>
|
|
|
|
|
2012-04-03 12:22:06 -04:00
|
|
|
<target name="ivy-bootstrap" description="Download and install Ivy in the users ant lib dir">
|
2012-03-30 14:04:43 -04:00
|
|
|
<subant target="ivy-bootstrap" inheritall="false" failonerror="true">
|
|
|
|
<fileset dir="lucene" includes="build.xml" />
|
|
|
|
</subant>
|
|
|
|
</target>
|
|
|
|
|
2012-08-03 10:05:26 -04:00
|
|
|
<target name="jar-checksums" description="Recompute SHA1 checksums for all JAR files.">
|
|
|
|
<sequential>
|
|
|
|
<subant target="jar-checksums" inheritall="false" failonerror="true">
|
|
|
|
<fileset dir="lucene" includes="build.xml" />
|
|
|
|
<fileset dir="solr" includes="build.xml" />
|
|
|
|
</subant>
|
|
|
|
</sequential>
|
2012-04-14 15:23:09 -04:00
|
|
|
</target>
|
2012-08-07 16:58:46 -04:00
|
|
|
|
2012-08-10 10:58:59 -04:00
|
|
|
<!-- define here, as common-build is not included! -->
|
2012-08-07 16:58:46 -04:00
|
|
|
<property name="python32.exe" value="python3.2" />
|
|
|
|
<property name="fakeRelease" value="lucene/build/fakeRelease"/>
|
|
|
|
<property name="fakeReleaseTmp" value="lucene/build/fakeReleaseTmp"/>
|
|
|
|
<property name="fakeReleaseVersion" value="5.0"/> <!-- *not* -SNAPSHOT, the real version -->
|
|
|
|
|
|
|
|
<target name="nightly-smoke" description="Builds an unsigned release and smoke tests it." depends="clean">
|
|
|
|
<sequential>
|
2012-08-10 10:58:59 -04:00
|
|
|
<fail unless="JAVA6_HOME">JAVA6_HOME property is not defined.</fail>
|
|
|
|
<fail unless="JAVA7_HOME">JAVA7_HOME property is not defined.</fail>
|
2012-08-07 16:58:46 -04:00
|
|
|
<subant target="prepare-release-no-sign" inheritall="false" failonerror="true">
|
|
|
|
<fileset dir="lucene" includes="build.xml" />
|
|
|
|
<fileset dir="solr" includes="build.xml" />
|
|
|
|
<property name="version" value="${fakeReleaseVersion}" />
|
|
|
|
</subant>
|
|
|
|
<delete dir="${fakeRelease}"/>
|
|
|
|
<delete dir="${fakeReleaseTmp}"/>
|
|
|
|
<mkdir dir="${fakeRelease}"/>
|
|
|
|
<copy todir="${fakeRelease}/lucene">
|
|
|
|
<fileset dir="lucene/dist"/>
|
|
|
|
</copy>
|
|
|
|
<copy todir="${fakeRelease}/lucene/changes">
|
|
|
|
<fileset dir="lucene/build/docs/changes"/>
|
|
|
|
</copy>
|
|
|
|
<get src="http://people.apache.org/keys/group/lucene.asc"
|
|
|
|
dest="${fakeRelease}/lucene/KEYS"/>
|
|
|
|
<copy todir="${fakeRelease}/solr">
|
|
|
|
<fileset dir="solr/package"/>
|
|
|
|
</copy>
|
|
|
|
<copy file="${fakeRelease}/lucene/KEYS" todir="${fakeRelease}/solr"/>
|
|
|
|
<makeurl file="${fakeRelease}" validate="false" property="fakeRelease.uri"/>
|
|
|
|
<exec executable="${python32.exe}" failonerror="true">
|
|
|
|
<arg value="-u"/>
|
|
|
|
<arg value="dev-tools/scripts/smokeTestRelease.py"/>
|
|
|
|
<arg value="${fakeRelease.uri}"/>
|
|
|
|
<arg value="${fakeReleaseVersion}"/>
|
|
|
|
<arg value="${fakeReleaseTmp}"/>
|
|
|
|
<arg value="false"/>
|
|
|
|
<env key="JAVA6_HOME" value="${JAVA6_HOME}"/>
|
|
|
|
<env key="JAVA7_HOME" value="${JAVA7_HOME}"/>
|
|
|
|
</exec>
|
|
|
|
<delete dir="${fakeRelease}"/>
|
|
|
|
<delete dir="${fakeReleaseTmp}"/>
|
|
|
|
</sequential>
|
|
|
|
</target>
|
2012-08-10 10:58:59 -04:00
|
|
|
|
2012-08-10 19:18:18 -04:00
|
|
|
<!-- Calls only generate-clover-reports on Lucene, as Solr's is just a clone with other target; the database itsself is fixed -->
|
|
|
|
<target name="generate-clover-reports">
|
|
|
|
<subant target="generate-clover-reports" inheritall="false" failonerror="true">
|
|
|
|
<fileset dir="." includes="build-clover.xml" />
|
|
|
|
</subant>
|
|
|
|
</target>
|
|
|
|
|
2012-08-10 10:58:59 -04:00
|
|
|
<!-- Jenkins tasks -->
|
2012-08-10 11:37:31 -04:00
|
|
|
<target name="jenkins-hourly" depends="clean,test,validate,-jenkins-javadocs-lint,-svn-status"/>
|
2012-08-11 07:11:36 -04:00
|
|
|
|
|
|
|
<target name="jenkins-clover">
|
|
|
|
<antcall target="-jenkins-clover">
|
|
|
|
<param name="run.clover" value="true"/>
|
|
|
|
<!-- must be 1, as clover does not like parallel test runs: -->
|
|
|
|
<param name="tests.jvms" value="1"/>
|
|
|
|
<!-- Also override some other props to be fast, ignoring what's set on command line: -->
|
|
|
|
<param name="tests.multiplier" value="1"/>
|
|
|
|
<param name="tests.slow" value="false"/>
|
|
|
|
<param name="tests.nightly" value="false"/>
|
|
|
|
<param name="tests.weekly" value="false"/>
|
|
|
|
<param name="tests.multiplier" value="1"/>
|
|
|
|
</antcall>
|
|
|
|
</target>
|
|
|
|
<target name="-jenkins-clover" depends="clean,test,generate-clover-reports"/>
|
2012-08-10 10:58:59 -04:00
|
|
|
|
2012-08-10 11:37:31 -04:00
|
|
|
<!-- we need this extra condition, as we want to match only on "true", not solely if property is set: -->
|
|
|
|
<property name="disable.javadocs-lint" value="false" />
|
|
|
|
<condition property="-disable.javadocs-lint">
|
|
|
|
<equals arg1="${disable.javadocs-lint}" arg2="true"/>
|
|
|
|
</condition>
|
|
|
|
<target name="-jenkins-javadocs-lint" unless="-disable.javadocs-lint">
|
|
|
|
<antcall target="javadocs-lint"/>
|
|
|
|
</target>
|
|
|
|
|
2012-08-10 10:58:59 -04:00
|
|
|
<!-- define here, as common-build is not included! -->
|
|
|
|
<property name="svn.exe" value="svn" />
|
|
|
|
|
|
|
|
<target name="-svn-status">
|
|
|
|
<exec executable="${svn.exe}" dir="." failonerror="true">
|
|
|
|
<arg value="status"/>
|
|
|
|
<redirector outputproperty="svn.status.output">
|
|
|
|
<outputfilterchain>
|
|
|
|
<linecontainsregexp>
|
|
|
|
<regexp pattern="^\?" />
|
|
|
|
</linecontainsregexp>
|
|
|
|
<tokenfilter>
|
|
|
|
<replaceregex pattern="^........" replace="* " />
|
|
|
|
<replacestring from="${file.separator}" to="/" />
|
|
|
|
</tokenfilter>
|
|
|
|
</outputfilterchain>
|
|
|
|
</redirector>
|
|
|
|
</exec>
|
|
|
|
<fail message="Source checkout is dirty after running tests!!! Offending files:${line.separator}${svn.status.output}">
|
|
|
|
<condition>
|
|
|
|
<not>
|
|
|
|
<equals arg1="${svn.status.output}" arg2=""/>
|
|
|
|
</not>
|
|
|
|
</condition>
|
|
|
|
</fail>
|
|
|
|
</target>
|
2010-04-13 09:28:56 -04:00
|
|
|
</project>
|