LUCENE-894: Add custom build file for binary distributions that includes targets to build the demos.

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@544040 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Busch 2007-06-04 04:03:24 +00:00
parent e2939508e5
commit 81849454e4
3 changed files with 125 additions and 3 deletions

View File

@ -249,6 +249,9 @@ Build
3. LUCENE-900: "ant test" now enables Java assertions (in Luecene packages).
(Doron Cohen)
4. LUCENE-894: Add custom build file for binary distributions that includes
targets to build the demos. (Chris Hostetter, Michael Busch)
======================= Release 2.1.0 2007-02-14 =======================
Changes in runtime behavior

View File

@ -6,7 +6,7 @@
<import file="common-build.xml"/>
<property name="build.demo.template" value="src/demo/demo-build.template"/>
<property name="demo.name" value="lucene-demos-${version}"/>
<property name="demo.war.name" value="luceneweb"/>
@ -54,7 +54,8 @@
includes="${final.name}.jar,${demo.war.name}.war,${demo.name}.jar,docs/,contrib/*/*.jar"
/>
<patternset id="binary.root.dist.patterns"
includes="src/demo/,src/jsp/,build.xml,docs/,*.txt"
includes="src/demo/,src/jsp/,docs/,*.txt"
excludes="${build.demo.template}"
/>
@ -159,7 +160,13 @@
<!-- -->
<!-- ================================================================== -->
<target name="package" depends="jar-core, javadocs, war-demo, build-contrib, init-dist">
<copy file="${build.demo.template}" tofile="${build.dir}/build-demo.xml">
<filterset begintoken="@PLACEHOLDER_" endtoken="@">
<filter token="version" value="${version}"/>
<filter token="javac.source" value="${javac.source}"/>
<filter token="javac.target" value="${javac.target}"/>
</filterset>
</copy>
</target>
<target name="nightly" depends="test, package-tgz">
@ -178,6 +185,7 @@
<zipfileset prefix="lucene-${version}" dir=".">
<patternset refid="binary.root.dist.patterns"/>
</zipfileset>
<zipfileset dir="${build.dir}" includes="build-demo.xml" fullpath="lucene-${version}/build.xml"/>
<zipfileset prefix="lucene-${version}" dir="${build.dir}">
<patternset refid="binary.build.dist.patterns"/>
</zipfileset>
@ -198,6 +206,7 @@
<tarfileset prefix="lucene-${version}" dir=".">
<patternset refid="binary.root.dist.patterns"/>
</tarfileset>
<tarfileset dir="${build.dir}" includes="build-demo.xml" fullpath="lucene-${version}/build.xml"/>
<tarfileset prefix="lucene-${version}" dir="${build.dir}">
<patternset refid="binary.build.dist.patterns"/>
</tarfileset>

View File

@ -0,0 +1,110 @@
<?xml version="1.0"?>
<project name="lucene-demo" default="compile-demo" basedir=".">
<dirname file="${ant.file.common}" property="common.dir"/>
<property name="version" value="@PLACEHOLDER_version@"/>
<property name="javac.source" value="@PLACEHOLDER_javac.source@"/>
<property name="javac.target" value="@PLACEHOLDER_javac.target@"/>
<property name="build.dir" location="build"/>
<property name="core.name" value="lucene-core-${version}"/>
<property name="demo.name" value="lucene-demos-${version}"/>
<property name="demo.war.name" value="luceneweb"/>
<!-- Build classpath -->
<path id="classpath">
<pathelement location="${common.dir}/${core.name}.jar"/>
</path>
<path id="demo.classpath">
<path refid="classpath"/>
<pathelement location="${build.dir}/classes/demo"/>
</path>
<available
property="jar.core.present"
type="file"
file="${common.dir}/${core.name}.jar"
/>
<target name="jar.core-check">
<fail unless="jar.core.present">
##################################################################
${common.dir}/${core.name}.jar not found.
##################################################################
</fail>
</target>
<!-- ================================================================== -->
<!-- J A R -->
<!-- ================================================================== -->
<!-- -->
<!-- ================================================================== -->
<target name="jar-demo" depends="compile-demo"
description="Build demo jar file">
<jar
destfile="${demo.name}.jar"
basedir="${build.dir}/classes/demo"
excludes="**/*.java"
/>
</target>
<target name="war-demo" depends="jar-demo"
description="Build demo war file">
<war destfile="${demo.war.name}.war"
webxml="src/jsp/WEB-INF/web.xml">
<fileset dir="src/jsp" excludes="WEB-INF/web.xml"/>
<lib dir="." includes="${demo.name}.jar"/>
<lib dir="." includes="${core.name}.jar"/>
</war>
</target>
<!-- ================================================================== -->
<!-- B U I L D D E M O -->
<!-- ================================================================== -->
<!-- -->
<!-- ================================================================== -->
<target name="compile-demo" depends="jar.core-check"
description="Compile demo classes">
<mkdir dir="${build.dir}/classes/demo"/>
<compile
srcdir="src/demo"
destdir="${build.dir}/classes/demo">
<classpath refid="demo.classpath"/>
</compile>
</target>
<target name="clean"
description="Removes contents of build directory">
<delete dir="${build.dir}"/>
</target>
<!--+
| M A C R O S
+-->
<macrodef name="compile">
<attribute name="srcdir"/>
<attribute name="destdir"/>
<element name="nested" implicit="yes" optional="yes"/>
<sequential>
<mkdir dir="@{destdir}"/>
<javac
srcdir="@{srcdir}"
destdir="@{destdir}"
deprecation="off"
debug="on"
source="${javac.source}"
target="${javac.target}">
<nested/>
</javac>
</sequential>
</macrodef>
</project>