harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r743555 - in /harmony/enhanced/classlib/trunk: make/ modules/auth/ modules/awt/ modules/imageio/ modules/instrument/ modules/misc/ modules/nio/ modules/nio_char/ modules/prefs/ modules/print/ modules/security/
Date Wed, 11 Feb 2009 23:09:25 GMT
Author: hindessm
Date: Wed Feb 11 23:09:24 2009
New Revision: 743555

URL: http://svn.apache.org/viewvc?rev=743555&view=rev
Log:
Reduce coupling by removing module names where possible.
Make build.module/exclude.module options work for build-native target.
I added some internal targets to the module build files for top-level
build-native target to use when polling the modules in order to keep
the consistently named build-native targets at the module level.

Modified:
    harmony/enhanced/classlib/trunk/make/build-java.xml
    harmony/enhanced/classlib/trunk/make/build-native.xml
    harmony/enhanced/classlib/trunk/make/build-test.xml
    harmony/enhanced/classlib/trunk/make/properties.xml
    harmony/enhanced/classlib/trunk/modules/auth/build.xml
    harmony/enhanced/classlib/trunk/modules/awt/build.xml
    harmony/enhanced/classlib/trunk/modules/imageio/build.xml
    harmony/enhanced/classlib/trunk/modules/instrument/build.xml
    harmony/enhanced/classlib/trunk/modules/misc/build.xml
    harmony/enhanced/classlib/trunk/modules/nio/build.xml
    harmony/enhanced/classlib/trunk/modules/nio_char/build.xml
    harmony/enhanced/classlib/trunk/modules/prefs/build.xml
    harmony/enhanced/classlib/trunk/modules/print/build.xml
    harmony/enhanced/classlib/trunk/modules/security/build.xml

Modified: harmony/enhanced/classlib/trunk/make/build-java.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/make/build-java.xml?rev=743555&r1=743554&r2=743555&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/make/build-java.xml (original)
+++ harmony/enhanced/classlib/trunk/make/build-java.xml Wed Feb 11 23:09:24 2009
@@ -66,7 +66,7 @@
                      -clean-bin-catch-all"/>
 
     <target name="-modules-clean-bin">
-        <call-modules target="clean" />
+        <poll-modules target="clean" />
     </target>
 
     <target name="-clean-bin-catch-all-test">
@@ -178,7 +178,7 @@
             </bootclasspath>
         </hy.javac>
 
-        <call-modules target="build" />
+        <poll-modules target="build" />
     </target>
 
 

Modified: harmony/enhanced/classlib/trunk/make/build-native.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/make/build-native.xml?rev=743555&r1=743554&r2=743555&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/make/build-native.xml (original)
+++ harmony/enhanced/classlib/trunk/make/build-native.xml Wed Feb 11 23:09:24 2009
@@ -70,20 +70,14 @@
     	
     	<!-- These module targets take care of building and copying
              their shared libs -->
-    	<ant dir="modules/portlib" antfile="build.xml" target="build-native" />
-        <ant dir="modules/luni" antfile="build.xml" target="build-native-core" />
-    	<ant dir="modules/archive" antfile="build.xml" target="build-native" />
-    	<ant dir="modules/auth" antfile="build.xml" target="build-native" />
-        <ant dir="modules/prefs" antfile="build.xml" target="build-native" />
-    	<ant dir="modules/luni" antfile="build.xml" target="build-native-secondary" />
-        <ant dir="modules/nio" antfile="build.xml" target="build-native" />    	
-        <ant dir="modules/nio_char" antfile="build.xml" target="build-native" />  
 	
-        <ant dir="modules/misc" antfile="build.xml" target="build-native" />    	
-        <ant dir="modules/awt" antfile="build.xml" target="build-native" />    	
-        <ant dir="modules/security" antfile="build.xml" target="build-native" />  
 	
-        <ant dir="modules/instrument" antfile="build.xml" target="build-native" />
   	
-        <ant dir="modules/imageio" antfile="build.xml" target="build-native" />   
	
-        <ant dir="modules/print" antfile="build.xml" target="build-native" />    	
+        <!-- these must be run in a specific order due to dependencies -->
+    	<ant dir="modules/portlib" target="build-native" />
+        <ant dir="modules/luni" target="build-native-core" />
+    	<ant dir="modules/archive" target="build-native" />
+    	<ant dir="modules/luni" target="build-native-secondary" />
+
+        <!-- the rest can be run in any order -->
+        <poll-modules target="build-native-all" />
     </target>
 
 
@@ -94,19 +88,7 @@
         depends="copy-makefile-includes,-make-clean,clean-makefile-includes" />
 
     <target name="-make-clean">
-        <ant dir="modules/portlib" antfile="build.xml" target="clean-native" />
-    	<ant dir="modules/auth" antfile="build.xml" target="clean-native" />
-    	<ant dir="modules/archive" antfile="build.xml" target="clean-native" />
-        <ant dir="modules/prefs" antfile="build.xml" target="clean-native" />
-    	<ant dir="modules/luni" antfile="build.xml" target="clean-native" />
-    	<ant dir="modules/nio" antfile="build.xml" target="clean-native" />
-    	<ant dir="modules/nio_char" antfile="build.xml" target="clean-native" />
-    	<ant dir="modules/misc" antfile="build.xml" target="clean-native" />
-    	<ant dir="modules/awt" antfile="build.xml" target="clean-native" />
-    	<ant dir="modules/security" antfile="build.xml" target="clean-native" />
-    	<ant dir="modules/instrument" antfile="build.xml" target="clean-native" />
-        <ant dir="modules/imageio" antfile="build.xml" target="clean-native" />   
	
-        <ant dir="modules/print" antfile="build.xml" target="clean-native" />    	
+        <poll-modules target="clean-native" />
     	<delete dir="${native.lib.target}" />
     </target>
 
@@ -174,11 +156,7 @@
           target: overlay-oss              
          ================================= -->
     <target name="overlay-oss">
-        <ant dir="modules/luni" antfile="build.xml"
-             target="overlay-oss" />
-
-    	<ant dir="modules/archive" antfile="build.xml" 
-	     target="overlay-oss" />        
+        <poll-modules target="overlay-oss" />
     </target>
 
     <!-- ================================= 
@@ -187,12 +165,7 @@
     <target name="copy-includes" >
 	<!-- Call copy-native-includes targets to copy across
 	     global includes to deploy/includes/harmony -->
-    	<ant dir="modules/archive" antfile="build.xml"
-             target="copy-native-includes" />
-    	<ant dir="modules/luni" antfile="build.xml" 
-    	     target="copy-native-includes" />
-        <ant dir="modules/portlib" antfile="build.xml"
-             target="copy-native-includes" />
+        <poll-modules target="copy-native-includes" />
 
     </target>
 	
@@ -203,12 +176,8 @@
 	<!-- Call clean.native.includes targets to delete global
    	     includes under deploy/includes/harmony -->
         
-    	<ant dir="modules/archive" antfile="build.xml" 
-    	     target="clean-native-includes" />
-    	<ant dir="modules/luni" antfile="build.xml" 
-    	     target="clean-native-includes" />
-        <ant dir="modules/portlib" antfile="build.xml"
-             target="clean-native-includes" />
+        <poll-modules target="clean-native-includes" />
+
         <!-- delete the deploy/include and deploy/jdk/include directories -->
         <delete dir="${hy.hdk}/include" />
         <delete dir="${hy.hdk}/jdk/include" />
@@ -240,10 +209,7 @@
           target: clean-overlay-oss              
          ================================= -->
     <target name="clean-overlay-oss">
-        <ant dir="modules/luni" antfile="build.xml" 
-             target="clean-overlay-oss" />
-     	<ant dir="modules/archive" antfile="build.xml" 
-    	     target="clean-overlay-oss" />
+        <poll-modules target="clean-overlay-oss" />
     </target>
 
 </project>

Modified: harmony/enhanced/classlib/trunk/make/build-test.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/make/build-test.xml?rev=743555&r1=743554&r2=743555&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/make/build-test.xml (original)
+++ harmony/enhanced/classlib/trunk/make/build-test.xml Wed Feb 11 23:09:24 2009
@@ -53,7 +53,7 @@
     </target>
 
     <target name="test-modules" depends="support-jar, test-jre-vm-info">
-        <call-modules target="-test-module" />
+        <poll-modules target="-test-module" />
     </target>
 
     <target name="gen-report" depends="full-report,short-report" />

Modified: harmony/enhanced/classlib/trunk/make/properties.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/make/properties.xml?rev=743555&r1=743554&r2=743555&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/make/properties.xml (original)
+++ harmony/enhanced/classlib/trunk/make/properties.xml Wed Feb 11 23:09:24 2009
@@ -271,7 +271,7 @@
     </condition>
     <property name="jpeg.home" value="/usr" />
     
-    <!-- default property for call-modules macro - i.e. all modules -->
+    <!-- default property for poll-modules macro - i.e. all modules -->
     <property name="build.module" value="*" />
     <property name="exclude.module" value="nothing" />
 
@@ -467,16 +467,54 @@
         </exec>
     </target>
 
-    <macrodef name="call-modules">
+    <macrodef name="poll-modules" 
+        description="directory-based macros for polling sub-builds">
         <attribute name="target" />
+        <attribute name="dir" default="modules" />
+        <attribute name="includes" default="${build.module}"/>
+        <attribute name="excludes" default="${exclude.module}"/>
+        <attribute name="antfile" default="*.xml"/>
         <sequential>
+            <!-- convert dirset pattern to fileset pattern-->
+            <property name="@{dir}.loc" location="@{dir}"/>
+            <pathconvert property="list.@{dir}.@{target}" 
+                pathsep="${file.separator}@{antfile}," setonempty="no">
+                <path>
+                    <dirset dir="@{dir}"
+                            includes="@{includes}"
+                            excludes="@{excludes}">
+                        <exclude name=".*" />
+                    </dirset>
+                </path>
+                <map from="${@{dir}.loc}${file.separator}" to=""/>
+            </pathconvert>
+            <!-- append antfile suffix to last item in the list, if any -->
+            <condition property="poll.@{dir}.@{target}"
+                value="${list.@{dir}.@{target}}${file.separator}@{antfile}" 
+                else="">
+                <isset property="list.@{dir}.@{target}"/>
+            </condition>
+            <poll-build target="@{target}" dir="@{dir}" 
+                includes="${poll.@{dir}.@{target}}"/>
+        </sequential>
+    </macrodef>
+
+    <macrodef name="poll-build"
+        description="plain-filter macros for polling sub-builds">
+        <attribute name="target" />
+        <attribute name="dir" />
+        <attribute name="includes" default="**/*.xml"/>
+        <attribute name="excludes" default=""/>
+        <sequential>
+            <echo message="polling @{includes}"/>
             <subant target="@{target}">
+                <!-- TODO: modules probably need to work these properties
+                     out for themselves in order to reduce coupling -->
                 <property name="hy.test.vm.name" value="${hy.test.vm.name}"/>
-                <dirset dir="modules"
-                        includes="${build.module}"
-                        excludes="${exclude.module}">
-                    <exclude name=".*" />
-                </dirset>
+                <property name="depends.oss" value="${depends.oss}"/>
+                <fileset dir="@{dir}" includes="@{includes}" excludes="@{excludes}">
+                    <containsregexp expression="&lt;target[^&gt;]*name=&quot;@{target}&quot;"/>
+                </fileset>
             </subant>
         </sequential>
     </macrodef>

Modified: harmony/enhanced/classlib/trunk/modules/auth/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/auth/build.xml?rev=743555&r1=743554&r2=743555&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/auth/build.xml (original)
+++ harmony/enhanced/classlib/trunk/modules/auth/build.xml Wed Feb 11 23:09:24 2009
@@ -71,7 +71,8 @@
     <target name="-test-module" depends="build, compile-tests, prepare-exclude, run-tests"
/>
     
     <!-- Build native code -->
-    <target name="build-native" >
+    <target name="build-native" depends="build-native-all" />
+    <target name="build-native-all" >
         <make dir="${hy.auth.src.main.native}/auth/${hy.os.family}" />
 
         <!-- Copy the built shared libs over to the jre/bin dir -->

Modified: harmony/enhanced/classlib/trunk/modules/awt/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/build.xml?rev=743555&r1=743554&r2=743555&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/build.xml (original)
+++ harmony/enhanced/classlib/trunk/modules/awt/build.xml Wed Feb 11 23:09:24 2009
@@ -151,7 +151,8 @@
         </jar>
     </target>
 
-    <target name="build-native"
+    <target name="build-native" depends="build-native-all" />
+    <target name="build-native-all"
         depends="-build-native-common,-build-native-unix,-build-native-windows" />
         
     <target name="-build-native-common">

Modified: harmony/enhanced/classlib/trunk/modules/imageio/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/imageio/build.xml?rev=743555&r1=743554&r2=743555&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/imageio/build.xml (original)
+++ harmony/enhanced/classlib/trunk/modules/imageio/build.xml Wed Feb 11 23:09:24 2009
@@ -100,7 +100,8 @@
         </javac>
     </target>
     
-    <target name="build-native">
+    <target name="build-native" depends="build-native-all" />
+    <target name="build-native-all" >
         <make dir="${hy.imageio.src.main.native}/jpegencoder/${hy.os.family}" />
         <!-- Copy the built shared libs over to the jre/bin dir -->
         <copy todir="${hy.jdk}/jre/bin" overwrite="yes">

Modified: harmony/enhanced/classlib/trunk/modules/instrument/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/instrument/build.xml?rev=743555&r1=743554&r2=743555&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/instrument/build.xml (original)
+++ harmony/enhanced/classlib/trunk/modules/instrument/build.xml Wed Feb 11 23:09:24 2009
@@ -56,7 +56,8 @@
     <target name="-test-module" depends="build, compile-tests, prepare-exclude, run-tests"
/>
 
     <!-- Build native code -->
-    <target name="build-native" >
+    <target name="build-native" depends="build-native-all" />
+    <target name="build-native-all" >
         <make dir="${hy.instrument.src.main.native}/instrument/${hy.os.family}" />
 
         <!-- Copy the built shared libs over to the jre/bin dir -->

Modified: harmony/enhanced/classlib/trunk/modules/misc/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/misc/build.xml?rev=743555&r1=743554&r2=743555&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/misc/build.xml (original)
+++ harmony/enhanced/classlib/trunk/modules/misc/build.xml Wed Feb 11 23:09:24 2009
@@ -121,7 +121,8 @@
         </jar>
     </target>
 
-    <target name="build-native" >
+    <target name="build-native" depends="build-native-all" />
+    <target name="build-native-all" >
         <make dir="${hy.misc.src.main.native}/accessors/${hy.os.family}" />
 
         <!-- Copy the built shared libs over to the jre/bin dir -->

Modified: harmony/enhanced/classlib/trunk/modules/nio/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/nio/build.xml?rev=743555&r1=743554&r2=743555&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/nio/build.xml (original)
+++ harmony/enhanced/classlib/trunk/modules/nio/build.xml Wed Feb 11 23:09:24 2009
@@ -69,7 +69,8 @@
             depends="build, compile-tests, prepare-exclude, run-tests" />
 
     <!-- Build natives.-->
-    <target name="build-native">
+    <target name="build-native" depends="build-native-all" />
+    <target name="build-native-all" >
         <make dir="${hy.nio.src.main.native}/nio/${hy.os.family}" />
 
         <!-- Copy the built shared libs over to the jre/bin dir -->

Modified: harmony/enhanced/classlib/trunk/modules/nio_char/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/nio_char/build.xml?rev=743555&r1=743554&r2=743555&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/nio_char/build.xml (original)
+++ harmony/enhanced/classlib/trunk/modules/nio_char/build.xml Wed Feb 11 23:09:24 2009
@@ -44,7 +44,8 @@
     <target name="build" depends="compile-java, copy-resources, build-jar" />
 
     <!-- Build natives.-->
-    <target name="build-native">
+    <target name="build-native" depends="build-native-all" />
+    <target name="build-native-all" >
 
         <make dir="${hy.nio_char.src.main.native}/niochar/${hy.os.family}" />
 

Modified: harmony/enhanced/classlib/trunk/modules/prefs/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/prefs/build.xml?rev=743555&r1=743554&r2=743555&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/prefs/build.xml (original)
+++ harmony/enhanced/classlib/trunk/modules/prefs/build.xml Wed Feb 11 23:09:24 2009
@@ -59,7 +59,8 @@
 
     <!-- Build natives. Currently there are only windows natives for
      prefs, so we check if we are on a windows platform -->
-    <target name="build-native" if="is.windows">
+    <target name="build-native" depends="build-native-all" />
+    <target name="build-native-all" if="is.windows">
         <make dir="${hy.prefs.src.main.native}/prefs/${hy.os.family}" />
 
         <!-- Copy the built shared libs over to the jre/bin dir -->

Modified: harmony/enhanced/classlib/trunk/modules/print/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/print/build.xml?rev=743555&r1=743554&r2=743555&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/print/build.xml (original)
+++ harmony/enhanced/classlib/trunk/modules/print/build.xml Wed Feb 11 23:09:24 2009
@@ -102,7 +102,8 @@
         </javac>
     </target>
     
-    <target name="build-native" if="is.windows">
+    <target name="build-native" depends="build-native-all" />
+    <target name="build-native-all" if="is.windows">
         <make dir="${hy.print.src.main.native}/print/${hy.os.family}" />
         <!-- Copy the built shared libs over to the jre/bin dir -->
         <copy todir="${hy.jdk}/jre/bin" overwrite="yes">

Modified: harmony/enhanced/classlib/trunk/modules/security/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/security/build.xml?rev=743555&r1=743554&r2=743555&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/security/build.xml (original)
+++ harmony/enhanced/classlib/trunk/modules/security/build.xml Wed Feb 11 23:09:24 2009
@@ -80,7 +80,8 @@
     <available file="${hy.security.src.main.native}/security/${hy.os.family}" property="native.present"
/>
 
 
-    <target name="build-native" if="native.present" >
+    <target name="build-native" depends="build-native-all" />
+    <target name="build-native-all" if="native.present" >
         <make dir="${hy.security.src.main.native}/security/${hy.os.family}" />
 
         <!-- Copy the built shared libs over to the jre/bin dir -->



Mime
View raw message