2006-01-29 10:16:56 -05:00
<!-- Solr build file -->
2006-11-09 18:13:58 -05:00
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
2008-08-13 06:08:04 -04:00
<project name= "solr" default= "usage" basedir= "." xmlns:artifact= "antlib:org.apache.maven.artifact.ant" >
2008-06-24 00:49:25 -04:00
<import file= "common-build.xml" />
2006-12-05 02:34:22 -05:00
2006-01-29 10:16:56 -05:00
<!-- 3rd party libraries for compilation -->
2009-06-19 23:49:00 -04:00
<property name= "lib" location= "lib" />
2006-01-29 10:16:56 -05:00
<!-- solr source files -->
2009-06-19 23:49:00 -04:00
<property name= "src" location= "src" />
<property name= "web.xml" location= "${src}/webapp/web/WEB-INF/web.xml" />
2006-01-29 10:16:56 -05:00
<!-- Destination for distribution files (demo WAR, src distro, etc.) -->
2009-06-19 23:49:00 -04:00
<property name= "dist" location= "dist" />
2006-01-29 10:16:56 -05:00
2008-12-06 08:04:26 -05:00
2006-02-15 20:05:55 -05:00
2008-02-19 22:57:44 -05:00
<property name= "clover.db.dir" location= "${dest}/tests/clover/db" />
<property name= "clover.report.dir" location= "${dest}/tests/clover/reports" />
<available
property="clover.present"
classname="com.cenqua.clover.tasks.CloverReportTask"
/>
<condition property= "clover.enabled" >
<and >
<isset property= "run.clover" />
<isset property= "clover.present" />
</and>
</condition>
2007-06-13 23:26:18 -04:00
2006-01-29 10:16:56 -05:00
<!-- Default target: usage. Prints out instructions. -->
<target name= "usage"
description="Prints out instructions">
<echo message= "Welcome to the Solr project!" />
2006-12-08 02:48:20 -05:00
<echo message= "Use 'ant example' to create a runnable example configuration." />
2008-11-30 14:33:45 -05:00
<echo message= "Use 'ant run-example' to create and run the example." />
<echo message= "And for developers:" />
2006-12-08 02:48:20 -05:00
<echo message= "Use 'ant clean' to clean compiled files." />
2006-01-29 10:50:23 -05:00
<echo message= "Use 'ant compile' to compile the source code." />
2006-11-28 17:36:42 -05:00
<echo message= "Use 'ant dist' to build the project WAR and JAR files." />
2008-08-29 13:43:05 -04:00
<echo message= "Use 'ant generate-maven-artifacts' to generate maven artifacts." />
<echo message= "Use 'ant package' to generate zip, tgz, and maven artifacts for distribution." />
2008-11-24 14:43:58 -05:00
<echo message= "Use 'ant luke' to start luke. see: http://www.getopt.org/luke/" />
2006-01-29 10:16:56 -05:00
<echo message= "Use 'ant test' to run unit tests." />
</target>
<!-- Clean: cleans compiled files and other temporary artifacts. -->
2008-08-05 07:07:02 -04:00
<target name= "clean" depends= "clean-contrib"
2006-01-29 10:16:56 -05:00
description="Cleans compiled files and other temporary artifacts.">
<delete dir= "${dest}" />
2006-02-17 19:17:44 -05:00
<delete dir= "${dist}" />
2006-01-29 10:16:56 -05:00
</target>
2008-04-16 08:45:09 -04:00
<target name= "clean-dest"
description="Cleans out ${dest} but leaves ${dist} alone. This allows us to run nightly and clover together in Hudson">
2008-04-16 09:36:30 -04:00
<delete includeemptydirs= "true" >
<fileset dir= "${dest}" >
<exclude name= "docs/" />
</fileset>
</delete>
2008-04-16 08:45:09 -04:00
</target>
2007-05-29 15:16:09 -04:00
<!-- Prepares an entity file for use in Forrest documentation -->
<target name= "init-forrest-entities" >
<!-- no description, don't advertise -->
<mkdir dir= "${dest}" />
2008-06-24 00:49:25 -04:00
<!-- A folder containing the expanded war file -->
<mkdir dir= "${dest}/web" />
2007-05-29 15:16:09 -04:00
<echo file= "${dest}/solr-specific-forrest-variables.ent" append= "false" >
< !ENTITY solr.specversion "${specversion}">
</echo>
</target>
2006-01-29 10:16:56 -05:00
2006-01-29 10:50:23 -05:00
<!-- ========================================================================= -->
2006-01-29 10:16:56 -05:00
<!-- ===================== COMPILATION - RELATED TASKS ========================= -->
2006-01-29 10:50:23 -05:00
<!-- ========================================================================= -->
2006-01-29 10:16:56 -05:00
<!-- The compilation classpath -->
<path id= "compile.classpath" >
<fileset dir= "${lib}" >
2006-02-06 11:24:21 -05:00
<include name= "*.jar" />
2006-01-29 10:16:56 -05:00
</fileset>
2007-06-13 23:26:18 -04:00
<pathelement location= "${dest}/common" />
2006-01-29 10:16:56 -05:00
</path>
2008-12-07 14:07:11 -05:00
<target name= "compile-solrj"
description="Compile the java client."
depends="init-forrest-entities">
<solr-javac destdir= "${dest}/solrj"
classpathref="compile.classpath">
<src path= "${src}/common" />
<src path= "${src}/solrj" />
</solr-javac>
</target>
<!-- This depend on all of solr -->
<path id= "compile.classpath.solrj" >
<path refid= "compile.classpath" />
<pathelement location= "${dest}/solrj" />
<!-- jetty -->
<fileset dir= "example/lib" >
<include name= "**/*.jar" />
</fileset>
</path>
2006-01-29 10:16:56 -05:00
<!-- Compile the project. -->
<target name= "compile"
2006-12-24 10:07:37 -05:00
description="Compile the source code."
2008-12-07 14:07:11 -05:00
depends="compile-solrj,init-forrest-entities">
2006-01-29 10:50:23 -05:00
2008-12-07 14:07:11 -05:00
<solr-javac destdir= "${dest}/solr"
classpathref="compile.classpath.solrj">
2006-01-29 10:50:23 -05:00
<src path= "${src}/java" />
2006-04-11 00:36:46 -04:00
<src path= "${src}/webapp/src" />
2007-06-13 23:26:18 -04:00
</solr-javac>
2006-01-29 10:16:56 -05:00
</target>
2008-12-07 14:07:11 -05:00
<target name= "javadoc-solrj" depends= "compile-solrj" description= "Generates solrj javadoc documentation." >
2008-08-04 01:56:10 -04:00
<sequential >
2008-12-07 14:07:11 -05:00
<mkdir dir= "${build.javadoc}/solrj" />
2008-08-04 01:56:10 -04:00
<path id= "javadoc.classpath" >
<path refid= "compile.classpath" />
</path>
2006-06-06 03:53:40 -04:00
2008-08-04 01:56:10 -04:00
<invoke-javadoc
2008-12-07 14:07:11 -05:00
destdir="${build.javadoc}/solrj"
title="${Name}-j ${version} API (${specversion})">
2008-08-04 01:56:10 -04:00
<sources >
2008-12-07 14:07:11 -05:00
<packageset dir= "${src}/common" />
<packageset dir= "${src}/solrj" />
2008-08-13 06:08:04 -04:00
</sources>
</invoke-javadoc>
</sequential>
</target>
2008-12-07 14:07:11 -05:00
<target name= "javadoc-core" depends= "compile" description= "Generates javadoc documentation for core." >
2008-08-13 06:08:04 -04:00
<sequential >
2008-12-07 14:07:11 -05:00
<mkdir dir= "${build.javadoc}/solr" />
2008-08-13 06:08:04 -04:00
<path id= "javadoc.classpath" >
<path refid= "compile.classpath" />
<path refid= "compile.classpath.solrj" />
2008-12-07 14:07:11 -05:00
<pathelement location= "${dest}/solrj" />
2008-08-13 06:08:04 -04:00
</path>
<invoke-javadoc
2008-12-07 14:07:11 -05:00
destdir="${build.javadoc}/solr"
2008-08-13 06:08:04 -04:00
title="${Name} ${version} core API (${specversion})">
<sources >
2008-12-07 14:07:11 -05:00
<packageset dir= "${src}/java" />
<packageset dir= "${src}/webapp/src" />
2008-08-04 01:56:10 -04:00
</sources>
</invoke-javadoc>
</sequential>
2006-02-17 19:17:44 -05:00
</target>
2008-08-04 01:56:10 -04:00
2008-12-07 14:07:11 -05:00
2008-08-04 01:56:10 -04:00
<target name= "javadoc-all" description= "Generate javadoc for core, client and contrib" >
<sequential >
<mkdir dir= "${build.javadoc}" />
<path id= "javadoc.classpath" >
<path refid= "compile.classpath" />
<path refid= "compile.classpath.solrj" />
2009-07-10 14:11:32 -04:00
<fileset dir= "contrib" >
<include name= "**/lib/**.jar" />
</fileset>
2008-08-04 01:56:10 -04:00
<pathelement location= "${dest}/client/solrj" />
</path>
<invoke-javadoc destdir= "${build.javadoc}" >
<sources >
2008-12-07 14:07:11 -05:00
<packageset dir= "${src}/common" />
<packageset dir= "${src}/solrj" />
2008-08-04 01:56:10 -04:00
<packageset dir= "${src}/java" />
<packageset dir= "${src}/webapp/src" />
<packageset dir= "contrib/dataimporthandler/src/main/java" />
2009-05-20 09:29:52 -04:00
<packageset dir= "contrib/clustering/src/main/java" />
2008-12-12 10:18:24 -05:00
<packageset dir= "contrib/extraction/src/main/java" />
2008-08-04 01:56:10 -04:00
<group title= "Core" packages= "org.apache.*" />
2008-08-13 06:08:04 -04:00
<group title= "Common" packages= "org.apache.solr.common.*" />
2008-08-04 01:56:10 -04:00
<group title= "SolrJ" packages= "org.apache.solr.client.solrj*" />
<group title= "contrib: DataImportHandler" packages= "org.apache.solr.handler.dataimport*" />
2009-05-20 09:29:52 -04:00
<group title= "contrib: Clustering" packages= "org.apache.solr.handler.clustering*" />
2008-12-12 10:18:24 -05:00
<group title= "contrib: Solr Cell" packages= "org.apache.solr.handler.extraction*" />
2008-08-04 01:56:10 -04:00
</sources>
</invoke-javadoc>
</sequential>
</target>
2008-08-05 07:07:02 -04:00
<target name= "javadoc-contrib" description= "Generate javadoc for contrib classes" depends= "build-contrib" >
2008-08-04 01:56:10 -04:00
<contrib-crawl target= "javadoc"
failonerror="true"/>
</target>
2008-12-07 14:07:11 -05:00
<target name= "javadoc" depends= "javadoc-core, javadoc-contrib, javadoc-solrj, javadoc-all" >
2008-06-24 00:49:25 -04:00
</target>
2007-06-14 18:53:25 -04:00
2007-11-08 18:40:12 -05:00
<target name= "stub-factories" depends= "dist-jar"
description="Generates stub factories as needed">
<path id= "stub.jars" >
<!-- this needs to be a list of all jars that might contain
classes we want to build factories for
-->
<fileset dir= "${lib}" >
<include name= "lucene-*.jar" />
</fileset>
<fileset dir= "${dist}" >
<include name= "*.jar" />
<exclude name= "*solrj*.jar" />
</fileset>
</path>
<pathconvert property= "jar.list" pathsep= " " refid= "stub.jars" />
<property name= "stub.list" value= "${dest}/need-stub-factories.txt" />
<java fork= "false"
classname="org.apache.solr.util.SuggestMissingFactories"
logError="true"
failonerror="true"
classpathref="test.run.classpath"
output="${stub.list}">
<arg line= "${jar.list}" />
</java>
<fail unless= "stub.src.path" > ...
This task requires that the property 'stub.src.path' be set.
It must contain a "path" listing directories containing source
files that this task should use when looking for classes that
need factories created, the format is platform specific --
typically it is colon seperated in Unix, semi-colon seperated
on windows, ie:
ant stub-factories -Dstub.src.path="./src:../lucene/contrib:../lucene/src/java"
FYI: The file ${stub.list} contains a list of classes
that seem to need stub factories. (if java files can be found to
use as guides for creating them).
</fail>
<pathconvert pathsep= " " property= "stub.src.dirs" >
<path >
<pathelement path= "${stub.src.path}" />
</path>
</pathconvert>
<exec executable= "${basedir}/src/dev-tools/stub-analysis-factory-maker.pl"
dir="src/java/org/apache/solr/analysis/"
failonerror="true">
<redirector input= "${stub.list}" >
<!-- place to put special case classes we want to ignore -->
<inputfilterchain >
<linecontainsregexp negate= "true" >
<!-- only for internal Solr highlighting purposes -->
<regexp pattern= "TokenOrderingFilter" />
</linecontainsregexp>
<linecontainsregexp negate= "true" >
<!-- no way to leverage this in Solr -->
<regexp pattern= "CachingTokenFilter" />
</linecontainsregexp>
2008-07-13 14:15:43 -04:00
<linecontainsregexp negate= "true" >
<!-- no way to leverage this in Solr -->
<regexp pattern= "HyphenationCompoundWordTokenFilter" />
</linecontainsregexp>
<linecontainsregexp negate= "true" >
<!-- no way to leverage these in Solr (yet) -->
2008-12-09 01:57:24 -05:00
<regexp pattern= "Sink|Tee" />
2008-07-13 14:15:43 -04:00
</linecontainsregexp>
<linecontainsregexp negate= "true" >
<!-- Solr already has a different impl for this -->
<regexp pattern= "SynonymTokenFilter" />
</linecontainsregexp>
2007-11-08 18:40:12 -05:00
<linecontainsregexp negate= "true" >
<!-- solr and lucene both have one? ? ? ? -->
<regexp pattern= "LengthFilter" />
</linecontainsregexp>
</inputfilterchain>
</redirector>
<arg line= "${stub.src.dirs}" />
</exec>
</target>
2006-02-17 19:17:44 -05:00
2006-01-29 10:50:23 -05:00
<!-- ========================================================================= -->
2006-01-29 10:16:56 -05:00
<!-- ===================== TESTING - RELATED TASKS ============================= -->
2006-01-29 10:50:23 -05:00
<!-- ========================================================================= -->
2006-01-29 10:16:56 -05:00
<!-- Classpath for unit test compilation. -->
<!-- For now, it's the same as main classpath. Later it will have JUnit, Clover, etc. -->
<path id= "test.compile.classpath" >
<path refid= "compile.classpath" />
2008-12-07 14:07:11 -05:00
<path refid= "compile.classpath.solrj" />
2007-06-14 18:53:25 -04:00
2008-12-07 14:07:11 -05:00
<pathelement location= "${dest}/solr" />
<pathelement location= "${dest}/solrj" /> <!-- include solrj -->
2006-02-07 17:04:39 -05:00
</path>
<path id= "test.run.classpath" >
<path refid= "test.compile.classpath" />
2007-06-14 18:53:25 -04:00
<pathelement location= "${dest}/tests" />
<!-- include the solrj classpath and jetty files included in example -->
<path refid= "compile.classpath.solrj" />
2008-02-19 22:57:44 -05:00
<pathelement path= "${java.class.path}" />
2006-01-29 10:16:56 -05:00
</path>
<!-- Compile unit tests. -->
<target name= "compileTests"
description="Compile unit tests."
2007-09-24 02:11:42 -04:00
depends="compile,compile-solrj">
2006-12-24 10:07:37 -05:00
2006-01-29 10:16:56 -05:00
<mkdir dir= "${dest}/tests" />
2007-06-13 23:26:18 -04:00
<solr-javac
2006-02-07 17:04:39 -05:00
destdir="${dest}/tests"
classpathref="test.compile.classpath">
<src path= "${src}/test" />
2007-06-13 23:26:18 -04:00
</solr-javac>
2006-01-29 10:16:56 -05:00
</target>
2008-06-24 00:49:25 -04:00
<!-- Run core unit tests. -->
2008-08-07 02:06:05 -04:00
<target name= "test-core"
2008-06-24 00:49:25 -04:00
description="Runs the core unit tests."
2007-05-29 15:16:09 -04:00
depends="init-forrest-entities, compileTests, junit" />
2008-06-24 00:49:25 -04:00
<!-- Run contrib unit tests. -->
<target name= "test"
description="Runs the core unit tests."
2008-08-07 02:06:05 -04:00
depends="test-core, test-contrib" />
2006-04-11 00:36:46 -04:00
<target name= "junit" depends= "compileTests" >
<!-- no description so it doesn't show up in - projecthelp -->
<mkdir dir= "${junit.output.dir}" />
2007-04-27 17:52:31 -04:00
<junit printsummary= "on"
2006-04-11 00:36:46 -04:00
haltonfailure="no"
errorProperty="tests.failed"
failureProperty="tests.failed"
2006-04-19 02:00:20 -04:00
dir="src/test/test-files/"
2006-04-11 00:36:46 -04:00
>
2009-01-29 16:13:55 -05:00
<jvmarg line= "${args}" />
2007-01-21 09:56:35 -05:00
<formatter type= "brief" usefile= "false" if= "junit.details" />
2006-04-11 00:36:46 -04:00
<classpath refid= "test.run.classpath" />
<formatter type= "xml" />
<batchtest fork= "yes" todir= "${junit.output.dir}" unless= "testcase" >
<fileset dir= "src/test" includes= "${junit.includes}" />
</batchtest>
<batchtest fork= "yes" todir= "${junit.output.dir}" if= "testcase" >
<fileset dir= "src/test" includes= "**/${testcase}.java" />
</batchtest>
</junit>
<fail if= "tests.failed" > Tests failed!</fail>
</target>
2007-06-14 18:53:25 -04:00
2006-09-13 10:33:28 -04:00
<target name= "test-reports"
description="Generates HTML test reports.">
2006-04-11 00:36:46 -04:00
<mkdir dir= "${junit.reports}" />
<junitreport todir= "${junit.output.dir}" >
<fileset dir= "${junit.output.dir}" >
<include name= "TEST-*.xml" />
</fileset>
<report format= "frames" todir= "${junit.reports}" />
</junitreport>
</target>
2006-01-29 10:16:56 -05:00
2008-02-19 22:57:44 -05:00
<target name= "clover" depends= "clover.setup, clover.info"
description="Instrument the Unit tests using Clover. Requires a Clover license and clover.jar in the ANT classpath. To use, specify -Drun.clover=true on the command line."/>
<target name= "clover.setup" if= "clover.enabled" >
<taskdef resource= "clovertasks" />
<mkdir dir= "${clover.db.dir}" />
<clover-setup initString= "${clover.db.dir}/solr_coverage.db" >
2008-12-07 14:07:11 -05:00
<fileset dir= "src/common" />
<fileset dir= "src/solrj" />
2008-02-19 22:57:44 -05:00
<fileset dir= "src/java" />
<fileset dir= "src/webapp/src" />
2008-08-07 02:03:24 -04:00
<fileset dir= "contrib/dataimporthandler/src/main/java" />
2009-05-20 09:29:52 -04:00
<fileset dir= "contrib/clustering/src/main/java" />
2008-12-12 10:18:24 -05:00
<fileset dir= "contrib/extraction/src/main/java" />
2008-02-19 22:57:44 -05:00
</clover-setup>
</target>
<target name= "clover.info" unless= "clover.present" >
<echo >
Clover not found. Code coverage reports disabled.
</echo>
</target>
<target name= "clover.check" >
<fail unless= "clover.present" >
##################################################################
Clover not found.
Please make sure clover.jar is in ANT_HOME/lib, or made available
to Ant using other mechanisms like -lib or CLASSPATH.
##################################################################
</fail>
</target>
<!--
Run after Junit tests.
-->
<target name= "generate-clover-reports" depends= "clover.check, clover" >
<mkdir dir= "${clover.report.dir}" />
<clover-report >
2008-04-16 12:24:46 -04:00
<current outfile= "${clover.report.dir}/clover.xml"
title="${fullnamever}">
<format type= "xml" />
</current>
2008-02-19 22:57:44 -05:00
<current outfile= "${clover.report.dir}" title= "${fullnamever}" >
<format type= "html" />
</current>
</clover-report>
</target>
2006-01-29 10:16:56 -05:00
2006-01-29 10:50:23 -05:00
<!-- ========================================================================= -->
2006-01-29 10:16:56 -05:00
<!-- ===================== DISTRIBUTION - RELATED TASKS ======================== -->
2006-01-29 10:50:23 -05:00
<!-- ========================================================================= -->
2006-01-29 10:16:56 -05:00
<!-- Creates the Solr distribution files. -->
<target name= "dist"
description="Creates the Solr distribution files."
2008-06-24 00:49:25 -04:00
depends="init-forrest-entities, dist-solrj, dist-jar, dist-contrib, dist-war" />
2006-11-29 02:08:17 -05:00
2006-02-07 17:04:39 -05:00
<!-- Creates the Solr WAR file. -->
2006-01-29 10:16:56 -05:00
<target name= "dist-war"
2006-12-08 16:01:58 -05:00
description="Creates the Solr WAR Distribution file."
2008-12-09 18:20:19 -05:00
depends="compile, make-manifest, dist-jar, dist-solrj">
2006-01-29 10:16:56 -05:00
<mkdir dir= "${dist}" />
2006-11-28 17:36:42 -05:00
<war destfile= "${dist}/${fullnamever}.war"
2009-06-19 23:49:00 -04:00
webxml="${web.xml}"
2006-11-29 02:08:17 -05:00
filesetmanifest="skip"
manifest="${dest}/META-INF/MANIFEST.MF">
<lib dir= "${lib}" >
<exclude name= "servlet-api*.jar" />
2007-05-05 13:14:22 -04:00
<exclude name= "easymock.jar" />
2008-12-07 14:27:54 -05:00
<exclude name= "junit-*.jar" />
<exclude name= "*.txt" />
<exclude name= "*.template" />
2006-11-29 02:08:17 -05:00
</lib>
2006-12-08 03:01:51 -05:00
<lib dir= "${dist}" >
2008-12-07 14:07:11 -05:00
<include name= "${fullname}-solrj-${version}.jar" />
2008-12-07 14:27:54 -05:00
<include name= "${fullname}-core-${version}.jar" />
2006-12-08 03:01:51 -05:00
</lib>
2008-03-22 19:57:52 -04:00
<fileset dir= "${src}/webapp/web" />
2008-06-24 00:49:25 -04:00
<!-- Include anything put in by contrib projects -->
<fileset dir= "${dest}/web" />
2006-12-01 12:40:39 -05:00
<metainf dir= "${basedir}" includes= "LICENSE.txt,NOTICE.txt" />
2006-01-29 10:16:56 -05:00
</war>
</target>
2008-08-13 06:08:04 -04:00
<target name= "dist-src" description= "Creates the Solr source distribution files"
depends="make-manifest">
<mkdir dir= "${dist}" />
2008-12-07 14:07:11 -05:00
<solr-jar destfile= "${dist}/${fullname}-solrj-src-${version}.jar" >
<fileset dir= "${src}/common" />
<fileset dir= "${src}/solrj" />
</solr-jar>
2008-08-13 07:19:16 -04:00
<solr-jar destfile= "${dist}/${fullname}-core-src-${version}.jar" >
2008-12-07 14:07:11 -05:00
<fileset dir= "${src}/java" />
2008-08-13 06:08:04 -04:00
<fileset dir= "${src}/webapp/src" />
</solr-jar>
2008-12-07 14:07:11 -05:00
2008-08-13 06:08:04 -04:00
<solr-jar destfile= "${dist}/apache-solr-dataimporthandler-src-${version}.jar"
2009-03-09 10:33:48 -04:00
basedir="contrib/dataimporthandler/src/main/java" />
2009-04-13 16:26:10 -04:00
<solr-jar destfile= "${dist}/apache-solr-dataimporthandler-extras-src-${version}.jar"
basedir="contrib/dataimporthandler/src/extras/main/java" />
2008-12-12 10:18:24 -05:00
<solr-jar destfile= "${dist}/apache-solr-cell-src-${version}.jar"
basedir="contrib/extraction/src" />
2009-05-20 09:29:52 -04:00
<solr-jar destfile= "${dist}/apache-solr-clustering-src-${version}.jar"
basedir="contrib/clustering/src" />
2008-08-13 06:08:04 -04:00
</target>
<target name= "dist-javadoc" description= "Creates the Solr javadoc distribution files"
depends="make-manifest, javadoc">
<mkdir dir= "${dist}" />
2008-08-13 07:19:16 -04:00
<solr-jar destfile= "${dist}/${fullname}-core-docs-${version}.jar"
2008-12-07 14:07:11 -05:00
basedir="${build.javadoc}/solr" />
2008-08-13 06:08:04 -04:00
<solr-jar destfile= "${dist}/${fullname}-solrj-docs-${version}.jar"
basedir="${build.javadoc}/solrj" />
<solr-jar destfile= "${dist}/apache-solr-dataimporthandler-docs-${version}.jar"
basedir="${build.javadoc}/contrib-solr-dataimporthandler" />
2009-05-20 09:29:52 -04:00
<solr-jar destfile= "${dist}/apache-solr-clustering-docs-${version}.jar"
basedir="${build.javadoc}/contrib-solr-clustering" />
2008-12-12 10:18:24 -05:00
<solr-jar destfile= "${dist}/apache-solr-cell-docs-${version}.jar"
basedir="${build.javadoc}/contrib-solr-cell" />
2008-08-13 06:08:04 -04:00
</target>
2006-02-17 19:17:44 -05:00
<!-- Creates the solr jar. -->
<target name= "dist-jar"
2006-12-08 16:01:58 -05:00
description="Creates the Solr JAR Distribution file."
2008-12-07 20:42:22 -05:00
depends="compile, make-manifest">
2006-01-29 10:16:56 -05:00
<mkdir dir= "${dist}" />
2008-12-07 14:07:11 -05:00
<solr-jar destfile= "${dist}/${fullname}-core-${version}.jar" >
<fileset dir= "${dest}/solr" />
</solr-jar>
2007-06-13 23:26:18 -04:00
2006-01-29 10:16:56 -05:00
</target>
2007-06-14 18:53:25 -04:00
<!-- Creates the solr jar. -->
<target name= "dist-solrj"
description="Creates the Solr JAR Distribution file."
2008-12-07 20:42:22 -05:00
depends="compile-solrj, make-manifest">
2007-06-14 18:53:25 -04:00
<mkdir dir= "${dist}" />
<solr-jar
2007-11-14 11:34:39 -05:00
destfile="${dist}/${fullname}-solrj-${version}.jar"
2008-12-07 14:07:11 -05:00
basedir="${dest}/solrj" />
2007-06-14 18:53:25 -04:00
<mkdir dir= "${dist}/solrj-lib" />
<copy todir= "${dist}/solrj-lib" >
<fileset dir= "${lib}" >
<include name= "commons-codec-*.jar" />
<include name= "commons-io-*.jar" />
2008-12-07 14:07:11 -05:00
<include name= "commons-httpclient-*.jar" />
2008-09-09 11:57:37 -04:00
<include name= "*stax-*.jar" />
<include name= "wstx-*.jar" />
2008-12-07 14:07:11 -05:00
<include name= "jcl-over-slf4j-*.jar" />
<include name= "slf4j-api-*.jar" />
2007-06-14 18:53:25 -04:00
</fileset>
</copy>
</target>
2006-02-15 20:05:55 -05:00
<target name= "example"
2006-12-08 03:32:57 -05:00
description="Creates a runnable example configuration."
2008-12-06 08:04:26 -05:00
depends="init-forrest-entities,dist-contrib,dist-war,example-contrib">
2006-11-28 17:36:42 -05:00
<copy file= "${dist}/${fullnamever}.war"
2006-05-04 08:53:31 -04:00
tofile="${example}/webapps/${ant.project.name}.war"/>
2007-02-18 16:30:03 -05:00
<jar destfile= "${example}/exampledocs/post.jar"
2008-12-07 14:07:11 -05:00
basedir="${dest}/solr"
2007-06-13 23:26:18 -04:00
filesetmanifest="skip"
2007-02-18 16:30:03 -05:00
includes="org/apache/solr/util/SimplePostTool*.class">
<manifest >
<attribute name= "Main-Class"
value="org.apache.solr.util.SimplePostTool"/>
</manifest>
</jar>
2008-12-06 08:04:26 -05:00
2008-08-07 13:27:52 -04:00
<delete includeemptydirs= "true" >
<fileset dir= "${example}/work" includes= "**/*" />
</delete>
2006-12-08 02:48:20 -05:00
<echo > See ${example}/README.txt for how to run the Solr example configuration.</echo>
2006-02-15 20:05:55 -05:00
</target>
2008-11-14 10:21:17 -05:00
<target name= "run-example" depends= "example" >
<property name= "example.solr.home" location= "example/solr" />
<property name= "example.data.dir" location= "example/solr/data" />
2008-12-20 08:15:22 -05:00
<property name= "example.debug.suspend" value= "n" />
<condition property= "example.jvm.line" value= "-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=${example.debug.suspend},address=5005" >
<isset property= "example.debug" />
</condition>
<property name= "example.jvm.line" value= "" />
<property name= "example.heap.size" value= "512M" />
<java jar= "${example}/start.jar" fork= "true" dir= "${example}" maxmemory= "${example.heap.size}" >
<jvmarg line= "${example.jvm.line}" />
2008-11-14 10:21:17 -05:00
<sysproperty key= "solr.solr.home" file= "${example.solr.home}" />
<sysproperty key= "solr.data.dir" file= "${example.data.dir}" />
</java>
</target>
2006-02-15 20:05:55 -05:00
2006-02-17 19:17:44 -05:00
<!-- make a distribution -->
2008-08-20 09:51:50 -04:00
<target name= "package" depends= "generate-maven-artifacts" />
<target name= "create-package"
2006-12-08 16:01:58 -05:00
description="Packages the Solr Distribution files and Documentation."
2008-08-13 06:08:04 -04:00
depends="dist, example, javadoc, dist-src, dist-javadoc">
2006-11-28 17:36:42 -05:00
2006-12-15 14:53:10 -05:00
<copy todir= "${build.docs}" >
<fileset dir= "site" />
</copy>
2006-12-16 16:08:42 -05:00
2008-08-14 16:09:22 -04:00
<delete file= "${dist}/${fullnamever}.tgz" failonerror= "false" />
<delete file= "${dist}/${fullnamever}.zip" failonerror= "false" />
2009-08-26 05:46:22 -04:00
<tar destfile= "${dist}/${fullnamever}.tgz" compression= "gzip" longfile= "gnu" >
2006-11-28 17:36:42 -05:00
<tarfileset dir= "."
prefix="${fullnamever}"
2008-08-05 07:09:54 -04:00
includes="LICENSE.txt NOTICE.txt *.txt *.xml lib/** src/** example/** client/** contrib/"
2008-09-11 19:04:33 -04:00
excludes="lib/README.committers.txt **/data/ **/logs/* **/classes/ **/*.sh **/bin/ src/scripts/ src/site/build/ **/target/ client/ruby/flare/ client/python" />
2006-12-17 16:38:20 -05:00
<tarfileset dir= "."
mode="755"
prefix="${fullnamever}"
includes="**/*.sh **/bin/ src/scripts/" />
2006-11-28 17:36:42 -05:00
<tarfileset dir= "."
prefix="${fullnamever}"
2007-07-14 13:24:00 -04:00
includes="dist/**"
2008-09-02 10:17:37 -04:00
excludes="*.tgz *.zip *.md5 ${dist}/*src-* ${dist}/*docs-*" />
2006-12-15 14:53:10 -05:00
<tarfileset dir= "${build.docs}"
prefix="${fullnamever}/docs/" />
2006-11-28 17:36:42 -05:00
</tar>
2006-12-08 16:01:58 -05:00
<solr-checksum file= "${dist}/${fullnamever}.tgz" />
2006-11-28 17:36:42 -05:00
2006-12-16 16:08:42 -05:00
<gunzip src= "${dist}/${fullnamever}.tgz" dest= "${dest}/${fullnamever}.tar" />
<untar src= "${dest}/${fullnamever}.tar" dest= "${dest}" />
<fixcrlf srcdir= "${dest}/${fullnamever}"
eol="crlf"
includes="**/*.txt **/*.xml **/*.java **/*.html **/*.csv **/*.css **/*.properties **/*.jsp **/*.xsl **/*.py **/*.rb **/*.js **/*.json **/*.pl"
/>
<zip destfile= "${dist}/${fullnamever}.zip" >
<zipfileset dir= "${dest}/${fullnamever}"
2006-12-17 17:28:56 -05:00
prefix="${fullnamever}"
2008-09-02 10:17:37 -04:00
excludes="**/*.sh **/bin/ src/scripts/ ${dist}/*-src-* ${dist}/*-docs-*" />
2006-12-17 17:28:56 -05:00
<zipfileset dir= "${dest}/${fullnamever}"
prefix="${fullnamever}"
includes="**/*.sh **/bin/ src/scripts/"
filemode="755" />
2006-12-16 16:08:42 -05:00
</zip>
<solr-checksum file= "${dist}/${fullnamever}.zip" />
2006-02-17 19:17:44 -05:00
</target>
2008-09-08 17:46:47 -04:00
<target name= "build-site" depends= "svn-up, init-forrest-entities" description= "Prototype Helper for Committers. Assumes SVN is in the path" >
<delete dir= "src/site/build" />
<exec executable= "forrest" dir= "src/site" />
<copy todir= "site" >
<fileset dir= "src/site/build/site" />
</copy>
<exec executable= "svn" dir= "site" >
<arg value= "ci" />
<arg value= "-m" />
<arg value= ""Forrest Entity updates"" />
</exec>
2008-09-12 11:06:34 -04:00
<exec executable= "svn" dir= "src/site" >
<arg value= "ci" />
<arg value= "-m" />
<arg value= ""Forrest Entity updates"" />
</exec>
<antcall target= "svn-up" />
2008-09-08 17:46:47 -04:00
2008-09-12 11:06:34 -04:00
</target>
2008-09-08 17:46:47 -04:00
<target name= "svn-up" >
<exec executable= "svn" >
<arg value= "update" />
</exec>
</target>
2008-09-19 11:07:17 -04:00
<target name= "clean-dist-signatures" >
<delete failonerror= "false" >
<fileset dir= "${dist}" >
<include name= "**/*.asc" />
</fileset>
</delete>
</target>
<target name= "sign-artifacts" depends= "clean-dist-signatures" >
<!-- <input message="Enter signature passphrase" addproperty="passphrase"/>
<touch file= "${user.home}/.pwd.txt" />
<chmod file= "${user.home}/.pwd.txt" perm= "600" />
<echo file= "${user.home}/.pwd.txt" > ${passphrase}</echo> -->
<sign-artifact input.file= "${dist}/${fullnamever}.tgz" output.file= "${dist}/${fullnamever}.tgz.asc" />
<sign-artifact input.file= "${dist}/${fullnamever}.zip" output.file= "${dist}/${fullnamever}.zip.asc" />
<!-- Maven artifacts -->
<sign-maven-dependency-artifacts artifact.id= "solr-commons-csv" />
<sign-maven-artifacts artifact.id= "solr-core" />
<sign-maven-artifacts artifact.id= "solr-dataimporthandler" />
2009-04-13 16:26:10 -04:00
<sign-maven-artifacts artifact.id= "solr-dataimporthandler-extras" />
2009-05-20 09:29:52 -04:00
<sign-maven-artifacts artifact.id= "solr-clustering" />
2008-12-12 10:18:24 -05:00
<sign-maven-artifacts artifact.id= "solr-cell" />
2008-09-19 11:07:17 -04:00
<sign-maven-dependency-artifacts artifact.id= "solr-lucene-analyzers" />
<sign-maven-dependency-artifacts artifact.id= "solr-lucene-core" />
<sign-maven-dependency-artifacts artifact.id= "solr-lucene-highlighter" />
<sign-maven-dependency-artifacts artifact.id= "solr-lucene-queries" />
<sign-maven-dependency-artifacts artifact.id= "solr-lucene-snowball" />
<sign-maven-dependency-artifacts artifact.id= "solr-lucene-spellchecker" />
<sign-maven-artifacts artifact.id= "solr-solrj" />
<!-- Thes are special since there are no jars, just poms -->
<sign-artifact input.file= "${maven.dist.prefix}/solr-parent/${maven_version}/solr-parent-${maven_version}.pom" />
<sign-artifact input.file= "${maven.dist.prefix}/solr-lucene-contrib/${maven_version}/solr-lucene-contrib-${maven_version}.pom" />
<!-- <delete file="${user.home}/.pwd.txt"/> -->
</target>
<target name= "prepare-release" depends= "clean, svn-up, build-site, package, sign-artifacts" description= "Prototype helper for Committers. Assumes gpg is in the path" >
2009-08-26 05:46:22 -04:00
<tar destfile= "${dist}/solr-maven.tar" longfile= "gnu" >
2008-09-12 11:06:34 -04:00
<tarfileset dir= "${dist}/maven" prefix= "maven" />
2008-09-08 17:46:47 -04:00
</tar>
2009-08-26 05:46:22 -04:00
<tar destfile= "${dist}/solr.tar" longfile= "gnu" >
2008-09-08 17:46:47 -04:00
<tarfileset dir= "${dist}" includes= "${fullnamever}.* solr-maven.tar" excludes= "${fullnamever}.war" />
</tar>
</target>
2008-08-20 09:51:50 -04:00
<target name= "generate-maven-artifacts" depends= "maven.ant.tasks-check, create-package" >
2008-08-13 06:08:04 -04:00
<sequential >
2008-09-19 11:07:17 -04:00
<!--
!!!!!!!!!!
NOTE: If you add new artifacts, please make sure you also add to the sign-artifacts target
so that they get signed during release.
!!!!!!!
-->
2008-08-13 06:08:04 -04:00
<mkdir dir= "${maven.build.dir}" />
<mkdir dir= "${maven.dist.dir}" />
<!-- ========== SOLR PARENT POM ========== -->
2008-08-16 09:49:09 -04:00
<m2-deploy pom.xml= "${src}/maven/solr-parent-pom.xml.template" />
2008-08-13 06:08:04 -04:00
<!-- ========== SOLR SPECIFIC LUCENE ARTIFACTS ========== -->
<m2-deploy pom.xml= "lib/solr-lucene-core-pom.xml.template"
jar.file="lib/lucene-core-${lucene_version}.jar" />
<m2-deploy pom.xml= "lib/solr-lucene-contrib-pom.xml.template" />
<m2-deploy pom.xml= "lib/solr-lucene-analyzers-pom.xml.template"
jar.file="lib/lucene-analyzers-${lucene_version}.jar" />
<m2-deploy pom.xml= "lib/solr-lucene-highlighter-pom.xml.template"
jar.file="lib/lucene-highlighter-${lucene_version}.jar" />
<m2-deploy pom.xml= "lib/solr-lucene-queries-pom.xml.template"
jar.file="lib/lucene-queries-${lucene_version}.jar" />
<m2-deploy pom.xml= "lib/solr-lucene-snowball-pom.xml.template"
jar.file="lib/lucene-snowball-${lucene_version}.jar" />
<m2-deploy pom.xml= "lib/solr-lucene-spellchecker-pom.xml.template"
jar.file="lib/lucene-spellchecker-${lucene_version}.jar" />
<!-- ========== SOLR SPECIFIC COMMONS CSV ========== -->
<m2-deploy pom.xml= "lib/solr-commons-csv-pom.xml.template"
jar.file="lib/commons-csv-1.0-SNAPSHOT-r609327.jar" />
<!-- ========== SOLR ARTIFACTS ========== -->
2009-05-20 09:29:52 -04:00
2008-08-13 06:08:04 -04:00
<m2-deploy pom.xml= "contrib/dataimporthandler/solr-dataimporthandler-pom.xml.template"
jar.file="${dist}/apache-solr-dataimporthandler-${version}.jar">
<artifact-attachments >
<attach file= "${dist}/apache-solr-dataimporthandler-src-${version}.jar" classifier= "sources" />
<attach file= "${dist}/apache-solr-dataimporthandler-docs-${version}.jar" classifier= "javadoc" />
</artifact-attachments>
</m2-deploy>
2009-04-13 16:26:10 -04:00
<m2-deploy pom.xml= "contrib/dataimporthandler/solr-dataimporthandler-extras-pom.xml.template"
jar.file="${dist}/apache-solr-dataimporthandler-extras-${version}.jar">
<artifact-attachments >
<attach file= "${dist}/apache-solr-dataimporthandler-extras-src-${version}.jar" classifier= "sources" />
<attach file= "${dist}/apache-solr-dataimporthandler-docs-${version}.jar" classifier= "javadoc" />
</artifact-attachments>
</m2-deploy>
2008-12-12 10:18:24 -05:00
<m2-deploy pom.xml= "contrib/extraction/solr-cell-pom.xml.template"
jar.file="${dist}/apache-solr-cell-${version}.jar">
<artifact-attachments >
<attach file= "${dist}/apache-solr-cell-src-${version}.jar" classifier= "sources" />
<attach file= "${dist}/apache-solr-cell-docs-${version}.jar" classifier= "javadoc" />
</artifact-attachments>
</m2-deploy>
2009-05-20 09:29:52 -04:00
<m2-deploy pom.xml= "contrib/clustering/solr-clustering-pom.xml.template"
jar.file="${dist}/apache-solr-clustering-${version}.jar">
<artifact-attachments >
<attach file= "${dist}/apache-solr-clustering-src-${version}.jar" classifier= "sources" />
<attach file= "${dist}/apache-solr-clustering-docs-${version}.jar" classifier= "javadoc" />
</artifact-attachments>
</m2-deploy>
<!-- Clustring specific -->
<!-- TODO: MORE NEEDED HERE ONCE WE FINALIZE THE LIBS FOR CARROT -->
<!-- end clustering specific -->
2008-12-12 10:18:24 -05:00
2008-08-16 09:49:09 -04:00
<m2-deploy pom.xml= "${src}/maven/solr-core-pom.xml.template"
2008-08-13 06:08:04 -04:00
jar.file="${dist}/apache-solr-core-${version}.jar">
<artifact-attachments >
<attach file= "${dist}/apache-solr-core-src-${version}.jar" classifier= "sources" />
<attach file= "${dist}/apache-solr-core-docs-${version}.jar" classifier= "javadoc" />
</artifact-attachments>
</m2-deploy>
2008-12-07 14:07:11 -05:00
<m2-deploy pom.xml= "${src}/maven/solr-solrj-pom.xml.template"
2008-08-13 06:08:04 -04:00
jar.file="${dist}/apache-solr-solrj-${version}.jar">
<artifact-attachments >
<attach file= "${dist}/apache-solr-solrj-src-${version}.jar" classifier= "sources" />
<attach file= "${dist}/apache-solr-solrj-docs-${version}.jar" classifier= "javadoc" />
</artifact-attachments>
</m2-deploy>
</sequential>
</target>
2006-02-17 19:17:44 -05:00
<target name= "nightly"
2008-08-28 12:32:48 -04:00
depends="test, create-package">
2006-12-08 16:01:58 -05:00
<!-- no description, don't advertise -->
2006-02-17 19:17:44 -05:00
</target>
2008-12-07 15:53:22 -05:00
<target name= "-taskdef" >
2008-09-09 16:50:05 -04:00
<typedef resource= "org/apache/rat/anttasks/antlib.xml" uri= "antlib:rat.anttasks" >
<classpath >
<fileset dir= "." includes= "rat*.jar" />
</classpath>
</typedef>
</target>
2008-12-07 15:53:22 -05:00
<target name= "rat-sources" depends= "-taskdef"
2008-09-09 16:50:05 -04:00
description="runs the tasks over src/java excluding the license directory">
<rat:report xmlns:rat= "antlib:org.apache.rat.anttasks" >
2008-09-09 17:15:03 -04:00
<fileset dir= "src/java" />
2008-12-07 14:07:11 -05:00
<fileset dir= "src/common" />
<fileset dir= "src/solrj" />
2008-09-09 17:15:03 -04:00
<fileset dir= "client" >
<exclude name= "**/CHANGES.*" />
2008-09-09 16:50:05 -04:00
</fileset>
2008-09-09 17:15:03 -04:00
<fileset dir= "contrib/dataimporthandler/src/main/java" />
<fileset dir= "contrib/dataimporthandler/src/test/java" />
2009-05-20 09:29:52 -04:00
<fileset dir= "contrib/clustering/src/main/java" />
<fileset dir= "contrib/clustering/src/test/java" />
2008-12-12 10:18:24 -05:00
<fileset dir= "contrib/extraction/src/main/java" />
<fileset dir= "contrib/extraction/src/test/java" />
2008-09-09 16:50:05 -04:00
</rat:report>
</target>
2008-12-07 15:53:22 -05:00
<!-- ========================================================================= -->
<!-- ===================== Runtime: luke ============================= -->
<!-- ========================================================================= -->
2008-11-24 14:43:58 -05:00
<available file= "luke/luke-0.9.1.jar" property= "luke.jar.exists" />
2009-06-15 19:48:11 -04:00
<target name= "luke-download" unless= "luke.jar.exists" depends= "proxy.setup" >
2008-11-24 14:43:58 -05:00
<mkdir dir= "luke" />
<get src= "http://www.getopt.org/luke/luke-0.9.1/luke-0.9.1.jar"
dest="luke/luke-0.9.1.jar"/>
<get src= "http://people.apache.org/repo/m2-snapshot-repository/org/apache/lucene/lucene-misc/2.4-SNAPSHOT/lucene-misc-2.4-SNAPSHOT.jar"
dest="luke/lucene-misc-2.4-SNAPSHOT.jar" />
</target>
<target name= "luke" depends= "luke-download" >
<java fork= "true"
classname="org.getopt.luke.Luke"
logError="true"
failonerror="true">
<classpath >
<fileset dir= "${lib}" >
<include name= "*.jar" />
</fileset>
<fileset dir= "luke" >
<include name= "luke-0.9.1.jar" />
<include name= "lucene-misc-2.4-SNAPSHOT.jar" />
</fileset>
</classpath>
</java>
</target>
2006-02-17 19:17:44 -05:00
2006-02-06 11:24:21 -05:00
</project>
2006-02-15 20:05:55 -05:00
2007-05-05 13:14:22 -04:00