lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From busc...@apache.org
Subject svn commit: r544040 - in /lucene/java/trunk: CHANGES.txt build.xml src/demo/demo-build.template
Date Mon, 04 Jun 2007 04:03:25 GMT
Author: buschmi
Date: Sun Jun  3 21:03:24 2007
New Revision: 544040

URL: http://svn.apache.org/viewvc?view=rev&rev=544040
Log:
LUCENE-894: Add custom build file for binary distributions that includes targets to build
the demos.

Added:
    lucene/java/trunk/src/demo/demo-build.template
Modified:
    lucene/java/trunk/CHANGES.txt
    lucene/java/trunk/build.xml

Modified: lucene/java/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/java/trunk/CHANGES.txt?view=diff&rev=544040&r1=544039&r2=544040
==============================================================================
--- lucene/java/trunk/CHANGES.txt (original)
+++ lucene/java/trunk/CHANGES.txt Sun Jun  3 21:03:24 2007
@@ -249,6 +249,9 @@
  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

Modified: lucene/java/trunk/build.xml
URL: http://svn.apache.org/viewvc/lucene/java/trunk/build.xml?view=diff&rev=544040&r1=544039&r2=544040
==============================================================================
--- lucene/java/trunk/build.xml (original)
+++ lucene/java/trunk/build.xml Sun Jun  3 21:03:24 2007
@@ -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>

Added: lucene/java/trunk/src/demo/demo-build.template
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/demo/demo-build.template?view=auto&rev=544040
==============================================================================
--- lucene/java/trunk/src/demo/demo-build.template (added)
+++ lucene/java/trunk/src/demo/demo-build.template Sun Jun  3 21:03:24 2007
@@ -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>



Mime
View raw message