Apache Solr open-source search software
LUCENE-894: Add custom build file for binary distributions that includes targets to build the demos.
Michael Busch81849454e4c8
diff --git a/CHANGES.txt b/CHANGES.txtindex e769cbc2ae5..38204cdce95 100644--- a/CHANGES.txt+++ b/CHANGES.txt@@ -249,6 +249,9 @@ Build3. 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 behaviordiff --git a/build.xml b/build.xmlindex ba9fd352dfd..f48fd4d6699 100644--- a/build.xml+++ b/build.xml@@ -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>diff --git a/src/demo/demo-build.template b/src/demo/demo-build.templatenew file mode 100644index 00000000000..d46576926a7--- /dev/null+++ b/src/demo/demo-build.template@@ -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>