Author: mahadev
Date: Thu Mar  4 20:10:19 2010
New Revision: 919149

URL: http://svn.apache.org/viewvc?rev=919149&view=rev
Log:
ZOOKEEPER-640. make build.xml more configurable to ease packaging for linux 
distros (phunt via mahadev)

Modified:
    hadoop/zookeeper/trunk/CHANGES.txt
    hadoop/zookeeper/trunk/build.xml
    hadoop/zookeeper/trunk/src/contrib/build-contrib.xml
    hadoop/zookeeper/trunk/src/contrib/build.xml
    hadoop/zookeeper/trunk/src/recipes/build-recipes.xml

Modified: hadoop/zookeeper/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/CHANGES.txt?rev=919149&r1=919148&r2=919149&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/CHANGES.txt (original)
+++ hadoop/zookeeper/trunk/CHANGES.txt Thu Mar  4 20:10:19 2010
@@ -305,6 +305,9 @@
   ZOOKEEPER-658. update forrest docs - AuthFLE no longer supported (flavio via
   mahadev)
 
+  ZOOKEEPER-640. make build.xml more configurable to ease packaging for linux
+  distros (phunt via mahadev)
+
 NEW FEATURES:
   ZOOKEEPER-539. generate eclipse project via ant target. (phunt via mahadev)
 

Modified: hadoop/zookeeper/trunk/build.xml
URL: 
http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/build.xml?rev=919149&r1=919148&r2=919149&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/build.xml (original)
+++ hadoop/zookeeper/trunk/build.xml Thu Mar  4 20:10:19 2010
@@ -35,7 +35,18 @@
 
     <property name="src.dir" value="${basedir}/src" />
     <property name="java.src.dir" value="${src.dir}/java/main" />
+
     <property name="lib.dir" value="${src.dir}/java/lib" />
+    <property name="lib.dir.includes" value="**/*.jar" />
+    <property name="lib.dir.excludes" value="**/excluded/" />
+
+    <!-- prior to ant 1.7.1 fileset always fails if dir doesn't exist
+         so just point to bin directory and provide settings that exclude
+         everything - user can change as appropriate -->
+    <property name="additional.lib.dir" value="bin" />
+    <property name="additional.lib.dir.includes" value="**/*.jar" />
+    <property name="additional.lib.dir.excludes" value="**/*.jar" />
+
     <property name="build.dir" value="${basedir}/build" />
     <property name="distribution" value="${basedir}/distribution" />
     <property name="src_generated.dir" value="${src.dir}/java/generated" />
@@ -156,9 +167,14 @@
     <!-- the normal classpath -->
     <path id="java.classpath">
       <pathelement location="${build.classes}"/>
+      <!-- allow the user to override (e.g. if there are local versions) -->
+      <fileset dir="${additional.lib.dir}">
+        <include name="${additional.lib.dir.includes}" />
+        <exclude name="${additional.lib.dir.excludes}" />
+      </fileset>
       <fileset dir="${lib.dir}">
-        <include name="**/*.jar" />
-        <exclude name="**/excluded/" />
+        <include name="${lib.dir.includes}" />
+        <exclude name="${lib.dir.excludes}" />
       </fileset>
       <fileset dir="${ant.home}/lib">
         <include name="ant.jar" />

Modified: hadoop/zookeeper/trunk/src/contrib/build-contrib.xml
URL: 
http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/build-contrib.xml?rev=919149&r1=919148&r2=919149&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/contrib/build-contrib.xml (original)
+++ hadoop/zookeeper/trunk/src/contrib/build-contrib.xml Thu Mar  4 20:10:19 
2010
@@ -53,10 +53,28 @@
   <target name="check-contrib"/>
   <target name="init-contrib"/>
 
-  <fileset id="lib.jars" dir="${root}" includes="lib/*.jar"/>
+  <property name="lib.jars.includes" value="lib/*.jar" />
+  <property name="lib.jars.excludes" value="" />
+
+  <!-- prior to ant 1.7.1 fileset always fails if dir doesn't exist
+       so just point to bin directory and provide settings that exclude
+       everything - user can change as appropriate -->
+  <property name="additional.lib.dir" value="${zk.root}/bin" />
+  <property name="additional.lib.dir.includes" value="**/*.jar" />
+  <property name="additional.lib.dir.excludes" value="**/*.jar" />
+
+  <fileset id="lib.jars" dir="${root}">
+    <include name="${lib.jars.includes}" />
+    <exclude name="${lib.jars.excludes}" />
+  </fileset>
 
   <path id="classpath">
     <pathelement location="${build.classes}"/>
+    <!-- allow the user to override (e.g. if there are local versions) -->
+    <fileset dir="${additional.lib.dir}">
+      <include name="${additional.lib.dir.includes}" />
+      <exclude name="${additional.lib.dir.excludes}" />
+    </fileset>
     <fileset refid="lib.jars"/>
     <pathelement location="${zk.root}/build/classes"/>
     <fileset dir="${ivy.lib}">

Modified: hadoop/zookeeper/trunk/src/contrib/build.xml
URL: 
http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/build.xml?rev=919149&r1=919148&r2=919149&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/contrib/build.xml (original)
+++ hadoop/zookeeper/trunk/src/contrib/build.xml Thu Mar  4 20:10:19 2010
@@ -18,7 +18,15 @@
 -->
 
 <project name="zookeepercontrib" default="compile" basedir=".">
-  
+
+  <property name="contribfilesetincludes" value="*/build.xml" />
+  <property name="contribfilesetexcludes" value="" />
+
+  <fileset id="contribfileset" dir=".">
+    <include name="${contribfilesetincludes}"/>
+    <exclude name="${contribfilesetexcludes}"/>
+  </fileset>
+
   <!-- In case one of the contrib subdirectories -->
   <!-- fails the build or test targets and you cannot fix it: -->
   <!-- Then add to fileset: excludes="badcontrib/build.xml" -->
@@ -28,7 +36,7 @@
   <!-- ====================================================== -->
   <target name="compile">
     <subant target="jar">
-      <fileset dir="." includes="*/build.xml"/>
+      <fileset refid="contribfileset" />
     </subant>
   </target>
   
@@ -37,7 +45,7 @@
   <!-- ====================================================== -->
   <target name="package">
     <subant target="package">
-      <fileset dir="." includes="*/build.xml"/>
+      <fileset refid="contribfileset" />
     </subant>
   </target>
   
@@ -46,7 +54,7 @@
   <!-- ====================================================== -->
   <target name="test">
     <subant target="test">
-      <fileset dir="." includes="*/build.xml"/>
+      <fileset refid="contribfileset" />
     </subant>
   </target>
   
@@ -56,7 +64,7 @@
   <!-- ====================================================== -->
   <target name="clean">
     <subant target="clean">
-      <fileset dir="." includes="*/build.xml"/>
+      <fileset refid="contribfileset" />
     </subant>
   </target>
 

Modified: hadoop/zookeeper/trunk/src/recipes/build-recipes.xml
URL: 
http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/recipes/build-recipes.xml?rev=919149&r1=919148&r2=919149&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/recipes/build-recipes.xml (original)
+++ hadoop/zookeeper/trunk/src/recipes/build-recipes.xml Thu Mar  4 20:10:19 
2010
@@ -42,10 +42,28 @@
   <target name="check-recipes"/>
   <target name="init-recipes"/>
 
-  <fileset id="lib.jars" dir="${root}" includes="lib/*.jar"/>
+  <property name="lib.jars.includes" value="lib/*.jar" />
+  <property name="lib.jars.excludes" value="" />
+
+  <!-- prior to ant 1.7.1 fileset always fails if dir doesn't exist
+       so just point to bin directory and provide settings that exclude
+       everything - user can change as appropriate -->
+  <property name="additional.lib.dir" value="${zk.root}/bin" />
+  <property name="additional.lib.dir.includes" value="**/*.jar" />
+  <property name="additional.lib.dir.excludes" value="**/*.jar" />
+
+  <fileset id="lib.jars" dir="${root}">
+    <include name="${lib.jars.includes}" />
+    <exclude name="${lib.jars.excludes}" />
+  </fileset>
 
   <path id="classpath">
     <pathelement location="${build.classes}"/>
+    <!-- allow the user to override (e.g. if there are local versions) -->
+    <fileset dir="${additional.lib.dir}">
+      <include name="${additional.lib.dir.includes}" />
+      <exclude name="${additional.lib.dir.excludes}" />
+    </fileset>
     <fileset refid="lib.jars"/>
     <pathelement location="${zk.root}/build/classes"/>
     <fileset dir="${zk.root}/build/lib">


Reply via email to