2006-01-29 10:16:56 -05:00
|
|
|
<!-- Solr build file -->
|
|
|
|
<project name="solr" default="usage" basedir=".">
|
|
|
|
<!-- Initialize property values: allow easy customization via build.properties -->
|
|
|
|
<property file="build.properties" />
|
|
|
|
|
|
|
|
<!-- Solr version -->
|
|
|
|
<property name="version" value="1.0" />
|
|
|
|
|
|
|
|
<!-- 3rd party libraries for compilation -->
|
|
|
|
<property name="lib" value="lib" />
|
|
|
|
|
|
|
|
<!-- solr source files -->
|
|
|
|
<property name="src" value="src" />
|
|
|
|
|
|
|
|
<!-- Destination for compiled classes and binaries -->
|
|
|
|
<property name="dest" value="build" />
|
|
|
|
|
|
|
|
<!-- Destination for distribution files (demo WAR, src distro, etc.) -->
|
|
|
|
<property name="dist" value="dist" />
|
|
|
|
|
|
|
|
<!-- Default target: usage. Prints out instructions. -->
|
|
|
|
<target name="usage"
|
|
|
|
description="Prints out instructions">
|
|
|
|
<echo message="Welcome to the Solr project!" />
|
2006-01-29 10:50:23 -05:00
|
|
|
<echo message="Use 'ant compile' to compile the source code." />
|
2006-01-29 10:16:56 -05:00
|
|
|
<echo message="Use 'ant dist' to build the project distribution files." />
|
|
|
|
<echo message="Use 'ant clean' to clean compiled files." />
|
|
|
|
<echo message="Use 'ant test' to run unit tests." />
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<!-- Clean: cleans compiled files and other temporary artifacts. -->
|
|
|
|
<target name="clean"
|
|
|
|
description="Cleans compiled files and other temporary artifacts.">
|
|
|
|
<delete dir="${dest}" />
|
|
|
|
</target>
|
|
|
|
|
|
|
|
|
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}">
|
|
|
|
<include name="lucene-core-nightly.jar" />
|
|
|
|
<include name="lucene-snowball-nightly.jar" />
|
|
|
|
<include name="servlet-api-2.4.jar" />
|
2006-01-29 10:50:23 -05:00
|
|
|
<include name="xpp3-1.1.3.4.O.jar" />
|
2006-01-29 10:16:56 -05:00
|
|
|
</fileset>
|
|
|
|
</path>
|
|
|
|
|
|
|
|
<!-- Compile the project. -->
|
|
|
|
<target name="compile"
|
|
|
|
description="Compile the source code.">
|
|
|
|
<mkdir dir="${dest}" />
|
2006-01-29 10:50:23 -05:00
|
|
|
|
2006-01-29 10:16:56 -05:00
|
|
|
<javac destdir="${dest}"
|
|
|
|
classpathref="compile.classpath">
|
2006-01-29 10:50:23 -05:00
|
|
|
<src path="${src}/java" />
|
|
|
|
<src path="${src}/webapp" />
|
|
|
|
|
|
|
|
<!-- This dir includes tests, but is needed by core: need to split these up -->
|
|
|
|
<!-- A better name for this directory is needed anyways. -->
|
|
|
|
<src path="${src}/lucene_extras" >
|
|
|
|
</src>
|
|
|
|
|
|
|
|
<!-- Only need this for now because lucene_extras has a test class -->
|
|
|
|
<exclude name="**/Test*" />
|
2006-01-29 10:16:56 -05:00
|
|
|
|
|
|
|
</javac>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
|
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" />
|
|
|
|
</path>
|
|
|
|
|
|
|
|
<!-- Compile unit tests. -->
|
|
|
|
<target name="compileTests"
|
|
|
|
description="Compile unit tests."
|
|
|
|
depends="compile">
|
|
|
|
<mkdir dir="${dest}/tests" />
|
|
|
|
<javac destdir="${dest}/tests"
|
|
|
|
classpathref="test.compile.classpath">
|
|
|
|
<src dir="${src}/test" />
|
|
|
|
<src dir="${src}/apps/SolarTest/src" />
|
|
|
|
</javac>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<!-- Run unit tests. -->
|
|
|
|
<target name="test"
|
|
|
|
description="Runs the unit tests."
|
|
|
|
depends="compileTests">
|
|
|
|
<echo message="TO-DO later or after we convert tests to JUnit." />
|
|
|
|
</target>
|
|
|
|
|
|
|
|
|
|
|
|
|
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."
|
|
|
|
depends="dist-src, dist-war, dist-bin" />
|
|
|
|
|
|
|
|
<!-- Creates the demo WAR file. -->
|
|
|
|
<target name="dist-war"
|
|
|
|
description="Creates the demo WAR file."
|
|
|
|
depends="compile">
|
|
|
|
<mkdir dir="${dist}" />
|
|
|
|
<war destfile="${dist}/${ant.project.name}-${version}.war"
|
|
|
|
webxml="${src}/webapp/WEB-INF/web.xml">
|
|
|
|
<classes dir="${dest}" />
|
|
|
|
<lib dir="${lib}">
|
|
|
|
<exclude name="servlet-api-2.4.jar" />
|
|
|
|
</lib>
|
2006-01-29 10:50:23 -05:00
|
|
|
|
|
|
|
|
|
|
|
<fileset dir="${src}/webapp/resources" />
|
2006-01-29 10:16:56 -05:00
|
|
|
</war>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<!-- Creates the source distribution. -->
|
|
|
|
<target name="dist-src"
|
|
|
|
description="Creates the source distribution."
|
|
|
|
depends="clean">
|
|
|
|
<mkdir dir="${dist}" />
|
|
|
|
<zip destfile="${dist}/${ant.project.name}-${version}-src.zip"
|
|
|
|
basedir="${src}" />
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<!-- Creates the binary distribution. -->
|
|
|
|
<target name="dist-bin"
|
|
|
|
description="Creates the binary distribution."
|
|
|
|
depends="clean, compile, dist-war">
|
|
|
|
<mkdir dir="${dist}" />
|
|
|
|
|
|
|
|
<jar destfile="${dist}/${ant.project.name}-${version}.jar"
|
|
|
|
basedir="${dest}" />
|
|
|
|
|
|
|
|
<zip destfile="${dist}/${ant.project.name}-${version}.zip"
|
|
|
|
basedir="${dist}" />
|
|
|
|
</target>
|
|
|
|
|
|
|
|
</project>
|