You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by mc...@apache.org on 2008/03/28 16:15:50 UTC

svn commit: r642255 - /harmony/enhanced/trunk/build.xml

Author: mcfirst
Date: Fri Mar 28 08:15:47 2008
New Revision: 642255

URL: http://svn.apache.org/viewvc?rev=642255&view=rev
Log:
Applying the patch from HARMONY-5521 [build] fix incremental federated build

Modified:
    harmony/enhanced/trunk/build.xml

Modified: harmony/enhanced/trunk/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/trunk/build.xml?rev=642255&r1=642254&r2=642255&view=diff
==============================================================================
--- harmony/enhanced/trunk/build.xml (original)
+++ harmony/enhanced/trunk/build.xml Fri Mar 28 08:15:47 2008
@@ -18,7 +18,7 @@
 -->
 
 
-<project name="build-harmony" default="default" basedir=".">
+<project name="build-harmony" default="build" basedir=".">
 
     <!-- name of the target directory to use for building and final assembly -->
     <property name="target.dir" value="target" />
@@ -33,34 +33,67 @@
     <property name="hy.local.zlib" value="false" />
 
     <description>
-        Apache Harmony subproject federation script
+        Apache Harmony project federation script
     </description>
 
-    <!-- ================================================================================ -->
-    <!--     main target - should checkout, build and package hdk, jdk and jre            -->
-    <!-- ================================================================================ -->
-    <target name="default"
+    <target name="help">
+        <echo>
+Apache Harmony Ant Build
+
+Usage:
+
+  ant build
+    Compiles the java and native code to produce a jdk in
+    "target/hdk".
+
+  ant clean
+    Removes all the files generated by a build.
+
+  ant rebuild
+    Performs a full build - that is 'clean' then 'build'.
+
+  ant snapshot
+    Produces a archive (tar/zip) of a build.
+
+  ant fetch-depends
+    Fetches dependencies. Note: Some of Harmony's dependencies are
+    licensed under terms other than the Apache License v2.
+
+  ant properties
+    Display the common build properties.
+
+        </echo>
+    </target>
+
+
+    <!-- ============================================================== -->
+    <!--     main target - should checkout, build and package hdk,
+             jdk and jre                                                -->
+    <!-- ============================================================== -->
+    <target name="all"
         description="setup and build complete implementation"
         depends="setup,
                  populate-src,
-                 build-all,
+                 clean,
+                 build,
                  assemble-artifacts,
                  bundle-hdk,
                  bundle-jdk,
                  bundle-jre"/>
     
-    <target name="make-snapshot"
+    <target name="snapshot"
         description="setup and build complete src + binaries set"
         depends="bundle-src,
-                 build-all,
+                 clean,
+                 build,
                  assemble-artifacts,
                  bundle-hdk,
                  bundle-jdk,
                  bundle-jre"/>
 
-    <target name="build-all"
+    <target name="build"
         description="build complete implementation"
-        depends="show-props,
+        depends="properties,
                  build-classlib,
                  build-vm,
                  build-commonresources,
@@ -73,27 +106,44 @@
                  bundle-src-tgz,
                  bundle-src-zip" />
 
-    <!-- =============================================================================== -->
-    <!--     populates the source directories, working_classlib and working_vm           -->
-    <!-- =============================================================================== -->
+    <!-- ============================================================== -->
+    <!--     populates the source directories, working_classlib,
+             working_vm, working_jdktools, and common_resources         -->
+    <!-- ============================================================== -->
     <target name="populate-src" 
         description="checkout the class library and VM source trees"
         depends="init,
-                 show-props,
+                 properties,
                  switch-svn-vm,
                  switch-svn-classlib,
                  switch-svn-jdktools,
                  switch-svn-commonresources" />
 
-    <!-- ================================================================================ -->
-    <!--     creates the HDK bundle appropriate for the platform                          -->
-    <!-- ================================================================================ -->
+    <!-- ============================================================== -->
+    <!--     creates the HDK bundle appropriate for the platform        -->
+    <!-- ============================================================== -->
     <target name="bundle-hdk" 
         depends="assemble-artifacts,
                  assemble-hdk-doc,
                  bundle-hdk-tgz,
                  bundle-hdk-zip" />
 
+    <!-- ============================================================== -->
+    <!--     builds with a clean first                                  -->
+    <!-- ============================================================== -->
+    <target name="rebuild" depends="clean, build"
+        description="Performs a full build - that is 'clean' then 'build'" />
+
+    <!-- ============================================================== -->
+    <!--     fetches external dependencies                              -->
+    <!-- ============================================================== -->
+    <target name="fetch-depends"
+        description="Fetches dependencies. Note: Some of Harmony dependencies are licensed under terms other than the Apache License v2."
+        depends="fetch-classlib-libs,
+                 fetch-vm-libs,
+                 build-commonresources,
+                 fetch-jdktools-libs"/>
+
     <target name="bundle-hdk-tgz" depends="init" if="is.unix">
 
         <!-- create the tar file and then md5 checksum using harmony-hdk-rev as the root,
@@ -136,9 +186,9 @@
         <chksum dir="${target.dir}" file="${deploy.hdk.zip}" type="sha" />
     </target>
 
-    <!-- ================================================================================ -->
-    <!--     creates the JDK bundle appropriate for the platform                          -->
-    <!-- ================================================================================ -->
+    <!-- ============================================================== -->
+    <!-- creates the JDK bundle appropriate for the platform            -->
+    <!-- ============================================================== -->
     <target name="bundle-jdk"
         depends="assemble-jdk-doc,
                  bundle-jdk-tgz,
@@ -181,9 +231,9 @@
         <chksum dir="${target.dir}" file="${deploy.jdk.zip}" type="sha" />
     </target>
 
-    <!-- ================================================================================ -->
-    <!--     creates the JRE bundle appropriate for the platform                          -->
-    <!-- ================================================================================ -->
+    <!-- ============================================================== -->
+    <!-- creates the JRE bundle appropriate for the platform            -->
+    <!-- ============================================================== -->
     <target name="bundle-jre" 
         depends="assemble-jre-doc,
                  bundle-jre-tgz,
@@ -224,9 +274,9 @@
     </target>
 
 
-    <!-- ================================================================================ -->
-    <!--    from the classlib and vm builds, creates the hdk and jre                      -->
-    <!-- ================================================================================ -->
+    <!-- ============================================================== -->
+    <!-- from the classlib and vm builds, creates the hdk and jre       -->
+    <!-- ============================================================== -->
     <target name="assemble-artifacts"
         depends="init,
                  assemble-stuff,
@@ -292,9 +342,9 @@
 
     </target>
 
-    <!-- ================================================================================ -->
-    <!--    copy license and notices into the root of the hdk                             -->
-    <!-- ================================================================================ -->
+    <!-- ============================================================== -->
+    <!-- copies a license and notices into the root of the hdk          -->
+    <!-- ============================================================== -->
     <target name="assemble-hdk-doc">
 
         <copy todir="${target.dir}/hdk">
@@ -308,9 +358,9 @@
 
     </target>
 
-    <!-- ================================================================================ -->
-    <!--    copy license and notices into the root of the JDK and JRE                     -->
-    <!-- ================================================================================ -->
+    <!-- ============================================================== -->
+    <!-- copies a license and notices into the root of the JDK and JRE  -->
+    <!-- ============================================================== -->
     <target name="assemble-jre-doc">
 
         <copy todir="${target.dir}/hdk/jdk/jre">
@@ -334,9 +384,9 @@
         </copy>
     </target>
 
-    <!-- ================================================================================ -->
-    <!--    build the classlib - ensure depends are up to date an then rebuild            -->
-    <!-- ================================================================================ -->
+    <!-- ============================================================== -->
+    <!-- ensures dependencies are up to date, then builds classlib      -->
+    <!-- ============================================================== -->
 
     <propertyset id="required.props">
         <propertyref name="hy.cfg" />
@@ -346,7 +396,7 @@
     </propertyset>
     
     <target name="build-classlib" depends="auto-fetch-classlib-libs">
-        <ant antfile="working_classlib/build.xml" target="rebuild" inheritAll="false" >
+        <ant antfile="working_classlib/build.xml" target="build" inheritAll="false" >
             <propertyset refid="required.props" />
             <property name="svn.info" value="${harmony.long.version}"/>
             <property name="svn.revision" value="${harmony.version}"/>
@@ -389,11 +439,11 @@
         </ant>
     </target>
 
-    <!-- ================================================================================ -->
-    <!--    build the vm - ensure depends are up to date an then rebuild            -->
-    <!-- ================================================================================ -->
+    <!-- ============================================================== -->
+    <!-- ensures that dependencies are up to date and then builds a vm  -->
+    <!-- ============================================================== -->
     <target name="build-vm" depends="auto-fetch-vm-libs">
-        <ant antfile="working_vm/build.xml" target="rebuild" inheritAll="false" >
+        <ant antfile="working_vm/build.xml" target="build" inheritAll="false" >
             <propertyset refid="required.props" />
             <property name="svn.info" value="${harmony.long.version}"/>
             <property name="svn.revision" value="${harmony.version}"/>
@@ -426,10 +476,20 @@
         </ant>
     </target>
 
-    <!-- ================================================================================ -->
-    <!--    build the common resources - ensure depends are up to date an then rebuild            -->
-    <!-- ================================================================================ -->
-    <target name="build-commonresources">
+    <!-- ============================================================== -->
+    <!-- fetches the common resources                                   -->
+    <!-- ============================================================== -->
+    <target name="build-commonresources" depends="auto-fetch-commonresources"/>
+
+    <target name="auto-fetch-commonresources" if="auto.fetch">
+        <ant target="fetch-commonresources">
+            <propertyset refid="required.props" />
+            <property name="svn.info" value="${harmony.long.version}"/>
+            <property name="svn.revision" value="${harmony.version}"/>
+        </ant>
+    </target>
+
+    <target name="fetch-commonresources">
         <ant antfile="common_resources/build.xml" target="fetch-depends" inheritall="false" >
             <property name="hy.cfg" value="${hy.cfg}"/>
             <property name="svn.info" value="${harmony.long.version}"/>
@@ -437,11 +497,11 @@
         </ant>
     </target>
 
-    <!-- ================================================================================ -->
-    <!--    build the jdktools - ensure depends are up to date an then rebuild            -->
-    <!-- ================================================================================ -->
+    <!-- ============================================================== -->
+    <!-- ensures dependencies are up to date, then builds jdktools      -->
+    <!-- ============================================================== -->
     <target name="build-jdktools" depends="auto-fetch-jdktools-libs">
-        <ant antfile="working_jdktools/build.xml" target="rebuild" inheritall="false" >
+        <ant antfile="working_jdktools/build.xml" target="build" inheritall="false" >
             <property name="hy.cfg" value="${hy.cfg}"/>
             <property name="svn.info" value="${harmony.long.version}"/>
             <property name="svn.revision" value="${harmony.version}"/>
@@ -468,18 +528,18 @@
         </ant>
     </target>
 
-    <!-- ================================================================================ -->
-    <!--    trivial setup                                                                 -->
-    <!-- ================================================================================ -->
-    <target name="setup" depends="init, show-props">
+    <!-- ============================================================== -->
+    <!-- recreates distribution dir                                     -->
+    <!-- ============================================================== -->
+    <target name="setup" depends="init, properties">
         <delete dir="${target.dir}"/>
         <mkdir dir="${target.dir}"/>
     </target>
 
 
-    <!-- ================================================================================ -->
-    <!--    hard reset - remove checked out classlib and vm tree- be sure you want this   -->
-    <!-- ================================================================================ -->
+    <!-- ============================================================== -->
+    <!-- hard reset - removes checked out classlib and vm tree          -->
+    <!-- ============================================================== -->
     <target name="reset"
         description="removes vm and classlib dirs and resets - BE SURE YOU WANT TO DO THIS"
         depends="clean">
@@ -502,9 +562,9 @@
         <delete dir="${target.dir}" failonerror="false" />
     </target>
 
-    <!-- ================================================================================ -->
-    <!--    Switches the working_vm directory to vm choice - wired for DRLVM for now      -->
-    <!-- ================================================================================ -->
+    <!-- ============================================================== -->
+    <!-- switches the working_vm directory to vm module (DRLVM for now) -->
+    <!-- ============================================================== -->
     <target name="switch-svn-vm" depends="init" if="is.svn">
         <exec executable="svn" dir="working_vm" failonerror="true">
             <arg line="-r${svn.revision}"/>
@@ -513,9 +573,9 @@
         </exec>
     </target>
 
-    <!-- ================================================================================ -->
-    <!--    Switches the working_classlib directory to classlib                          -->
-    <!-- ================================================================================ -->
+    <!-- ============================================================== -->
+    <!-- switches the working_classlib directory to classlib            -->
+    <!-- ============================================================== -->
     <target name="switch-svn-classlib" depends="init" if="is.svn">
         <exec executable="svn" dir="working_classlib" failonerror="true">
             <arg line="-r${svn.revision}"/>
@@ -524,9 +584,9 @@
         </exec>
     </target>
 
-    <!-- ================================================================================ -->
-    <!--    Switches the working_jdktools directory to jdktools                           -->
-    <!-- ================================================================================ -->
+    <!-- ============================================================== -->
+    <!-- switches the working_jdktools directory to jdktools            -->
+    <!-- ============================================================== -->
     <target name="switch-svn-jdktools" depends="init" if="is.svn">
         <exec executable="svn" dir="working_jdktools" failonerror="true">
             <arg line="-r${svn.revision}"/>
@@ -535,9 +595,9 @@
         </exec>
     </target>
 
-    <!-- ================================================================================ -->
-    <!--    Switches the common_resources directory to common_resources                   -->
-    <!-- ================================================================================ -->
+    <!-- ============================================================== -->
+    <!-- switches the common_resources directory to common_resources    -->
+    <!-- ============================================================== -->
     <target name="switch-svn-commonresources" depends="init" if="is.svn">
         <exec executable="svn" dir="common_resources" failonerror="true">
             <arg line="-r${svn.revision}"/>
@@ -546,10 +606,9 @@
         </exec>
     </target>
 
-    <!-- ================================================================================ -->
-    <!--   init :                                                                         -->
-    <!--     basic setup - reused stuff from classlib/properties.xml for expediency       -->
-    <!-- ================================================================================ -->
+    <!-- ============================================================== -->
+    <!-- sets up a platform                                             -->
+    <!-- ============================================================== -->
     <target name="init" depends="svn-prop">
         <!-- Determine our operating system -->
         <condition property="is.windows">
@@ -660,7 +719,7 @@
 
     </target>
 
-    <target name="show-props" depends="init">
+    <target name="properties" depends="init">
         <echo>
                    Apache Harmony Federated Build
             ==========================================
@@ -675,14 +734,14 @@
         </echo>
     </target>
 
-    <!-- ================================================================================ -->
-    <!-- svn-prop : get svn revision number of the build.xml file                         -->
-    <!--                                                                                  -->
-    <!--         taken from classlib/properties.xml, because of uncertainty               -->
-    <!--         of state of the working_classlib dir, I need a copy                      -->
-    <!--   TODO - we want to be able to pass property in to ant so we don't need a        -->
-    <!--      pause and it's reproducable                                                 -->
-    <!-- ================================================================================ -->
+    <!-- ============================================================== -->
+    <!-- svn-prop: gets svn revision number of the build.xml file       -->
+    <!--                                                                -->
+    <!-- taken from classlib/properties.xml, because of uncertainty     -->
+    <!-- of the state of the working_classlib dir, I need a copy        -->
+    <!-- TODO - we want to be able to pass property in to ant           -->
+    <!--        so we don't need a pause and it's reproducable          -->
+    <!-- ============================================================== -->
     <target name="svn-prop">
         <exec executable="svn"
               dir="."
@@ -818,9 +877,9 @@
         <chmod file="${target.dir}/src/debian/rules" perm="ugo+x" />
     </target>
 
-    <!-- ================================================================================ -->
-    <!-- produces a nicer looking checksum - taken from classlib/build.xml                -->
-    <!-- ================================================================================ -->
+    <!-- ============================================================== -->
+    <!-- produces a nice looking checksum                               -->
+    <!-- ============================================================== -->
     <macrodef name="chksum">
         <attribute name="dir" />
         <attribute name="file" />