瀏覽代碼

HADOOP-356. Add contrib code to 'compile' and 'test' build targets, so that contrib code is better maintained.

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@423040 13f79535-47bb-0310-9956-ffa450edef68
Doug Cutting 19 年之前
父節點
當前提交
d217fed273
共有 3 個文件被更改,包括 39 次插入18 次删除
  1. 3 0
      CHANGES.txt
  2. 31 17
      build.xml
  3. 5 1
      src/contrib/build.xml

+ 3 - 0
CHANGES.txt

@@ -40,6 +40,9 @@ Trunk (unreleased changes)
 11. HADOOP-252.  Add versioning to RPC protocols.
     (Milind Bhandarkar via cutting)
 
+12. HADOOP-356.  Add contrib to "compile" and "test" build targets, so
+    that this code is better maintained. (Michel Tourn via cutting)
+
 
 Release 0.4.0 - 2006-06-28
 

+ 31 - 17
build.xml

@@ -128,8 +128,8 @@
           javacchome="${javacc.home}"
       />
   </target>
-
-  <target name="compile" depends="init, record-parser">
+  
+  <target name="compile-core" depends="init, record-parser">
 
     <jsp-compile
      uriroot="${src.webapps}/task"
@@ -167,7 +167,16 @@
 
   </target>
 
-  <target name="compile-examples" depends="compile">
+  <target name="compile-contrib" depends="compile-core">
+     <subant target="deploy">
+        <fileset file="${basedir}/src/contrib/build.xml"/>
+     </subant>  	
+  </target>
+  
+  <target name="compile" depends="compile-core, compile-contrib">
+  </target>
+
+  <target name="compile-examples" depends="compile-core">
     <javac 
      encoding="${build.encoding}" 
      srcdir="${examples.dir}"
@@ -187,7 +196,7 @@
   <!-- ================================================================== -->
   <!--                                                                    -->
   <!-- ================================================================== -->
-  <target name="jar" depends="compile">
+  <target name="jar" depends="compile-core">
     <tar compression="gzip" destfile="${build.classes}/bin.tgz">
       <tarfileset dir="bin" mode="755"/>
     </tar>
@@ -221,7 +230,7 @@
   <!-- ================================================================== -->
   <!--                                                                    -->
   <!-- ================================================================== -->
-  <target name="metrics.jar" depends="compile">
+  <target name="metrics.jar" depends="compile-core">
     <jar jarfile="${build.dir}/hadoop-metrics-${version}.jar"
          basedir="${build.classes}">
       <include name="**/metrics/**" />
@@ -233,7 +242,7 @@
   <!-- ================================================================== -->
   <!-- Compile test code                                                  --> 
   <!-- ================================================================== -->
-  <target name="compile-test" depends="compile, jar">
+  <target name="compile-core-test" depends="compile-core, jar">
     <javac 
      encoding="${build.encoding}" 
      srcdir="${test.src.dir}"
@@ -258,7 +267,7 @@
   <!-- ================================================================== -->
   <!-- Run unit tests                                                     --> 
   <!-- ================================================================== -->
-  <target name="test" depends="compile, examples, compile-test">
+  <target name="test-core" depends="compile-core, examples, compile-core-test">
 
     <delete dir="${test.build.data}"/>
     <mkdir dir="${test.build.data}"/>
@@ -283,10 +292,20 @@
       </batchtest>
     </junit>
 
+
     <fail if="tests.failed">Tests failed!</fail>
 
   </target>   
 
+  <target name="test-contrib">
+    <subant target="test">
+        <fileset file="${basedir}/src/contrib/build.xml"/>
+    </subant>  	
+  </target>   
+  
+  <target name="test" depends="test-core, test-contrib">
+  </target>
+
   <!-- Run all unit tests, not just Test*, and use non-test configuration. -->
   <target name="test-cluster">
     <antcall target="test">
@@ -301,7 +320,7 @@
   <!-- ================================================================== -->
   <!-- Documentation                                                      -->
   <!-- ================================================================== -->
-  <target name="javadoc" depends="compile, default-doc">
+  <target name="javadoc" depends="default-doc">
     <mkdir dir="${build.javadoc}"/>
     <javadoc
       overview="${src.dir}/overview.html"
@@ -334,7 +353,7 @@
   <!-- ================================================================== -->
   <!--                                                                    -->
   <!-- ================================================================== -->
-  <target name="package" depends="jar, javadoc, examples, compile-test">
+  <target name="package" depends="jar, javadoc, examples, compile-core-test">
     <mkdir dir="${dist.dir}"/>
     <mkdir dir="${dist.dir}/lib"/>
     <mkdir dir="${dist.dir}/bin"/>
@@ -404,7 +423,7 @@
   <!-- ================================================================== -->
   <!-- Clean.  Delete the build files, and their directories              -->
   <!-- ================================================================== -->
-  <target name="clean">
+  <target name="clean" depends="clean-contrib">
     <delete dir="${build.dir}"/>
   </target>
 
@@ -412,17 +431,12 @@
   <!-- Contrib targets. For now, they must be called explicitely          -->
   <!-- Using subant instead of ant as a workaround for 30569              -->
   <!-- ================================================================== -->
-  <target name="deploy-contrib" depends="compile">
+  <target name="deploy-contrib" depends="compile-core">
      <subant target="deploy">        
         <fileset file="src/contrib/build.xml"/>
      </subant>  	
   </target>
-  <target name="test-contrib" depends="compile">
-     <subant target="test">        
-        <fileset file="src/contrib/build.xml"/>
-     </subant>  	
-  </target>
-  <target name="clean-contrib" depends="compile">
+  <target name="clean-contrib">
      <subant target="clean">        
         <fileset file="src/contrib/build.xml"/>
      </subant>  	

+ 5 - 1
src/contrib/build.xml

@@ -1,7 +1,11 @@
 <?xml version="1.0"?>
 
 <project name="hadoopcontrib" default="deploy" basedir=".">
-
+  
+  <!-- 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" -->
+  
   <!-- ====================================================== -->
   <!-- Build & deploy all the contrib jars.                   -->
   <!-- ====================================================== -->