2004-01-05 02:09:42 -05:00
|
|
|
<?xml version="1.0"?>
|
|
|
|
|
|
|
|
<project name="common">
|
|
|
|
|
2004-02-24 14:08:06 -05:00
|
|
|
<!-- default values, intended to be overridden-->
|
|
|
|
<property name="version" value="dev"/>
|
|
|
|
<property name="Name" value="${ant.project.name}"/>
|
|
|
|
|
|
|
|
<!-- not intended to be overridden-->
|
2004-01-05 10:54:53 -05:00
|
|
|
<property name="src.dir" location="src/java"/>
|
2004-01-05 02:09:42 -05:00
|
|
|
<property name="build.dir" location="build"/>
|
|
|
|
<property name="build.classes.dir" location="${build.dir}/classes"/>
|
2004-02-24 14:08:06 -05:00
|
|
|
<property name="build.javadoc" value="${build.dir}/docs/api"/>
|
2004-08-17 19:44:59 -04:00
|
|
|
<property name="build.encoding" value="utf-8"/>
|
2004-02-24 14:08:06 -05:00
|
|
|
|
|
|
|
<property name="release.host" value="www.apache.org"/>
|
|
|
|
<property name="release.path" value="/www/cvs.apache.org/dist/jakarta/lucene/sandbox/${ant.project.name}"/>
|
|
|
|
|
|
|
|
<property name="web.host" value="www.apache.org"/>
|
|
|
|
<property name="web.path" value="/www/jakarta.apache.org/lucene/docs/lucene-sandbox/${ant.project.name}"/>
|
|
|
|
|
|
|
|
<property name="javadoc.link.java" value="http://java.sun.com/j2se/1.4.1/docs/api/"/>
|
|
|
|
<property name="javadoc.link.lucene" value="http://jakarta.apache.org/lucene/docs/api/"/>
|
2004-01-05 10:54:53 -05:00
|
|
|
|
|
|
|
<property name="test.src.dir" location="src/test"/>
|
|
|
|
<property name="test.output.dir" location="${build.dir}/test"/>
|
|
|
|
<property name="test.classes.dir" location="${test.output.dir}/classes"/>
|
|
|
|
|
2004-01-05 02:09:42 -05:00
|
|
|
<property name="dist.dir" location="dist"/>
|
2004-02-24 14:08:06 -05:00
|
|
|
<property name="dist.name" value="${ant.project.name}-${version}"/>
|
|
|
|
<property name="package.dir" location="dist/${dist.name}"/>
|
2004-01-05 11:35:10 -05:00
|
|
|
|
2004-01-05 02:09:42 -05:00
|
|
|
<property name="junit.jar" location="${ant.home}/lib/junit.jar"/>
|
|
|
|
<dirname file="${ant.file.common}" property="common.dir"/>
|
|
|
|
<property name="lucene.dir" location="${common.dir}/../../jakarta-lucene"/>
|
|
|
|
|
|
|
|
<property name="build.debug" value="true"/>
|
|
|
|
<property name="junit.fork" value="true"/>
|
|
|
|
|
2004-02-24 14:08:06 -05:00
|
|
|
<property name="jakarta.site2.home" location="../../../jakarta-site2"/>
|
|
|
|
<property name="project.name" value="site"/>
|
|
|
|
<property name="docs.src" location="xdocs"/>
|
|
|
|
<property name="docs.dest" location="docs"/>
|
|
|
|
|
|
|
|
<path id="anakia.classpath">
|
|
|
|
<fileset dir="${jakarta.site2.home}/lib">
|
|
|
|
<include name="*.jar"/>
|
|
|
|
</fileset>
|
|
|
|
</path>
|
|
|
|
|
2004-01-05 02:09:42 -05:00
|
|
|
<!-- ========================================================== -->
|
|
|
|
<!-- Datatype declarations -->
|
|
|
|
<!-- ========================================================== -->
|
2004-01-05 11:35:10 -05:00
|
|
|
<!-- TODO: define ${lucene.jar} for easeir overriding -->
|
2004-01-05 02:09:42 -05:00
|
|
|
<path id="compile.classpath">
|
2004-08-17 19:44:59 -04:00
|
|
|
<fileset dir="${lucene.dir}" includes="build/lucene*.jar"/>
|
|
|
|
<pathelement path="${project.classpath}"/>
|
2004-01-05 02:09:42 -05:00
|
|
|
</path>
|
|
|
|
|
|
|
|
<path id="test.classpath">
|
|
|
|
<path refid="compile.classpath"/>
|
|
|
|
<pathelement location="${junit.jar}"/>
|
|
|
|
<pathelement location="${build.classes.dir}"/>
|
|
|
|
<pathelement location="${test.classes.dir}"/>
|
|
|
|
</path>
|
|
|
|
|
|
|
|
|
|
|
|
<target name="init">
|
|
|
|
<echo message="Building ${ant.project.name}"/>
|
|
|
|
<tstamp/>
|
|
|
|
|
|
|
|
<mkdir dir="${build.dir}"/>
|
|
|
|
<mkdir dir="${build.classes.dir}"/>
|
|
|
|
<mkdir dir="${dist.dir}"/>
|
|
|
|
|
2004-01-05 10:54:53 -05:00
|
|
|
<mkdir dir="${test.output.dir}"/>
|
2004-01-05 02:09:42 -05:00
|
|
|
<mkdir dir="${test.classes.dir}"/>
|
2004-01-05 10:54:53 -05:00
|
|
|
|
|
|
|
<available property="has.tests" file="${test.src.dir}" type="dir"/>
|
2004-01-05 02:09:42 -05:00
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="clean"
|
|
|
|
description="Deletes all previous build artifacts">
|
|
|
|
<delete dir="${build.dir}"/>
|
|
|
|
<delete dir="${build.classes.dir}"/>
|
|
|
|
<delete dir="${dist.dir}"/>
|
2004-02-24 14:08:06 -05:00
|
|
|
<delete dir="${package.dir}"/>
|
2004-01-05 02:09:42 -05:00
|
|
|
|
2004-01-05 10:54:53 -05:00
|
|
|
<delete dir="${test.output.dir}"/>
|
2004-01-05 02:09:42 -05:00
|
|
|
<delete dir="${test.classes.dir}"/>
|
|
|
|
</target>
|
|
|
|
|
2004-01-05 11:35:10 -05:00
|
|
|
<target name="dist" depends="compile" description="Create JAR">
|
2004-02-24 14:08:06 -05:00
|
|
|
<jar jarfile="${dist.dir}/${dist.name}.jar"
|
2004-01-05 11:35:10 -05:00
|
|
|
basedir="${build.classes.dir}"
|
|
|
|
/>
|
2004-01-05 02:09:42 -05:00
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="compile" depends="init">
|
|
|
|
<javac destdir="${build.classes.dir}"
|
2004-01-05 11:35:10 -05:00
|
|
|
debug="${build.debug}"
|
|
|
|
includeAntRuntime="yes"
|
|
|
|
deprecation="true"
|
|
|
|
srcdir="${src.dir}"
|
|
|
|
classpathref="compile.classpath"
|
2004-08-17 19:44:59 -04:00
|
|
|
encoding="${build.encoding}"
|
2004-01-05 11:35:10 -05:00
|
|
|
/>
|
2004-01-23 12:38:35 -05:00
|
|
|
<copy todir="${build.classes.dir}">
|
|
|
|
<fileset dir="${src.dir}" excludes="**/*.java"/>
|
|
|
|
</copy>
|
2004-01-05 02:09:42 -05:00
|
|
|
</target>
|
|
|
|
|
2004-01-05 10:54:53 -05:00
|
|
|
<target name="test-compile" depends="compile" if="has.tests">
|
2004-01-05 02:09:42 -05:00
|
|
|
<javac destdir="${test.classes.dir}"
|
2004-01-05 11:35:10 -05:00
|
|
|
debug="${build.debug}"
|
|
|
|
includeAntRuntime="yes"
|
|
|
|
srcdir="src/test"
|
|
|
|
classpathref="test.classpath"
|
2004-08-17 19:44:59 -04:00
|
|
|
encoding="${build.encoding}"
|
2004-01-05 11:35:10 -05:00
|
|
|
/>
|
2004-01-05 02:09:42 -05:00
|
|
|
|
|
|
|
<copy todir="${test.classes.dir}">
|
|
|
|
<fileset dir="src/test" excludes="**/*.java"/>
|
|
|
|
</copy>
|
|
|
|
</target>
|
|
|
|
|
2004-01-05 10:54:53 -05:00
|
|
|
<target name="test" depends="test-compile" if="has.tests">
|
2004-01-05 02:09:42 -05:00
|
|
|
<junit printsummary="no"
|
2004-01-05 11:35:10 -05:00
|
|
|
errorProperty="test.failed"
|
|
|
|
failureProperty="test.failed"
|
|
|
|
fork="${junit.fork}">
|
2004-01-05 02:09:42 -05:00
|
|
|
<classpath refid="test.classpath"/>
|
|
|
|
<sysproperty key="docs.dir" file="${test.classes.dir}"/>
|
2004-01-05 10:54:53 -05:00
|
|
|
<sysproperty key="index.dir" file="${test.output.dir}/index"/>
|
2004-08-17 19:44:59 -04:00
|
|
|
<sysproperty key="dataDir" file="${test.src.dir}"/>
|
2004-01-05 02:09:42 -05:00
|
|
|
<formatter type="brief" usefile="false"/>
|
|
|
|
<test name="${testcase}" if="testcase"/>
|
|
|
|
<batchtest todir="${test.data.dir}" unless="testcase">
|
|
|
|
<fileset dir="${test.classes.dir}"
|
2004-01-05 11:35:10 -05:00
|
|
|
includes="**/*Test.class,**/Test*.class"
|
|
|
|
/>
|
2004-01-05 02:09:42 -05:00
|
|
|
</batchtest>
|
|
|
|
</junit>
|
|
|
|
|
|
|
|
<fail if="test.failed">
|
|
|
|
Unit tests failed. Check log or reports for details
|
|
|
|
</fail>
|
|
|
|
|
|
|
|
</target>
|
|
|
|
|
2004-01-05 11:35:10 -05:00
|
|
|
<target name="default" depends="test,dist"/>
|
2004-01-05 02:09:42 -05:00
|
|
|
|
2004-02-24 14:08:06 -05:00
|
|
|
<!-- ================================================================== -->
|
|
|
|
<!-- Documentation -->
|
|
|
|
<!-- ================================================================== -->
|
|
|
|
<target name="javadoc" depends="compile">
|
|
|
|
<mkdir dir="${build.javadoc}"/>
|
|
|
|
<javadoc
|
|
|
|
sourcepath="${src.dir}"
|
|
|
|
overview="${src.dir}/overview.html"
|
|
|
|
packagenames="*"
|
|
|
|
destdir="${build.javadoc}"
|
|
|
|
author="true"
|
|
|
|
version="true"
|
|
|
|
use="true"
|
|
|
|
windowtitle="${Name} ${version} API"
|
|
|
|
doctitle="${Name} ${version} API"
|
|
|
|
>
|
|
|
|
<link href="${javadoc.link.java}"/>
|
|
|
|
<link href="${javadoc.link.lucene}"/>
|
|
|
|
<classpath refid="compile.classpath"/>
|
|
|
|
</javadoc>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<!-- ================================================================== -->
|
|
|
|
<!-- D I S T R I B U T I O N -->
|
|
|
|
<!-- ================================================================== -->
|
|
|
|
<!-- -->
|
|
|
|
<!-- ================================================================== -->
|
|
|
|
<target name="package" depends="dist, javadoc">
|
|
|
|
<mkdir dir="${package.dir}"/>
|
|
|
|
<mkdir dir="${package.dir}/docs"/>
|
|
|
|
<mkdir dir="${package.dir}/docs/api"/>
|
|
|
|
<copy todir="${package.dir}/docs/api">
|
|
|
|
<fileset dir="${build.javadoc}"/>
|
|
|
|
</copy>
|
|
|
|
|
|
|
|
<copy todir="${package.dir}/docs">
|
|
|
|
<fileset dir="${docs.dest}/"/>
|
|
|
|
</copy>
|
|
|
|
|
|
|
|
<copy todir="${package.dir}">
|
|
|
|
<fileset dir=".">
|
|
|
|
<include name="*.txt"/>
|
|
|
|
</fileset>
|
|
|
|
</copy>
|
|
|
|
|
|
|
|
<copy todir="${package.dir}/src">
|
|
|
|
<fileset dir="src"/>
|
|
|
|
</copy>
|
|
|
|
<copy todir="${package.dir}/" file="build.xml"/>
|
|
|
|
<copy todir="${dist.dir}/" file="${common.dir}/common.xml"/>
|
|
|
|
|
|
|
|
<copy file="${dist.dir}/${dist.name}.jar" todir="${package.dir}"/>
|
|
|
|
|
|
|
|
<tar tarfile="${dist.dir}/${dist.name}.tar.gz" basedir="${dist.dir}/"
|
|
|
|
compression="gzip" includes="${dist.name}/**,common.xml"/>
|
|
|
|
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<!-- ================================================================== -->
|
|
|
|
<!-- Copy release to server -->
|
|
|
|
<!-- ================================================================== -->
|
|
|
|
<target name="release" depends="package">
|
|
|
|
<exec executable="ssh">
|
|
|
|
<arg value="${release.host}"/>
|
|
|
|
<arg value="mkdir"/>
|
|
|
|
<arg value="${release.path}/${dist.name}"/>
|
|
|
|
</exec>
|
|
|
|
<exec executable="scp">
|
|
|
|
<arg value="${dist.dir}/${dist.name}.jar"/>
|
|
|
|
<arg value="${dist.dir}/${dist.name}.tar.gz"/>
|
|
|
|
<arg value="${release.host}:${release.path}/${dist.name}"/>
|
|
|
|
</exec>
|
|
|
|
<exec executable="ssh">
|
|
|
|
<arg value="${web.host}"/>
|
|
|
|
<arg value="rm"/>
|
|
|
|
<arg value="-rf"/>
|
|
|
|
<arg value="${web.path}/api"/>
|
|
|
|
</exec>
|
|
|
|
<exec executable="scp">
|
|
|
|
<arg value="-r"/>
|
|
|
|
<arg value="${build.javadoc}"/>
|
|
|
|
<arg value="${web.host}:${web.path}/api"/>
|
|
|
|
</exec>
|
|
|
|
</target>
|
2004-01-05 19:08:23 -05:00
|
|
|
|
2004-01-05 02:09:42 -05:00
|
|
|
</project>
|