Can the JDK be compiled by Ant as a whole? Seems so. With this config the compilation yields no 'cannot found' errors
1 <?xml version="1.0" encoding="UTF-8"?>
2 <project name="modularize" default="all" basedir=".">
3 <description>Scripts to build JDK Java sources in modularized way</description>
6 <antcall target="base"/>
7 <antcall target="beans"/>
8 <antcall target="applet"/>
9 <antcall target="deprecated7"/>
12 <!-- basic parameters -->
13 <property name="plugs" value="../../plugs"/>
14 <fail message="You need to provide location of plugs">
15 <condition><not><available file="${plugs}/jre/lib/rt-closed.jar"/></not></condition>
17 <pathconvert property="gensrc">
18 <path><dirset dir="../build"><include name="*/gensrc"/></dirset></path>
20 <fail message="You need to provide location of JDK's generated sources via -Dgensrc=...">
21 <condition><not><available file="${gensrc}"/></not></condition>
24 <pathelement location="src/share/classes"/>
25 <pathelement location="${gensrc}"/>
26 <pathelement location="${gensrc}/../impsrc"/>
27 <pathelement location="src/solaris/classes"/>
28 <pathelement location="../jaxp/src/share/classes/"/>
29 <pathelement location="../langtools/src/share/classes/"/>
30 <pathelement location="../jaxws/src/share/classes/"/>
31 <pathelement location="../corba/src/share/classes/"/>
32 <!-- <pathelement location="src/windows/classes"/> -->
34 <property name="build.dir" location="build/modularize"/>
36 <!-- this is the core of the separation - definition
37 of what classes belong into what compilation group.
39 <selector id="applet">
41 <filename name="java/beans/AppletInitializer*"/>
42 <filename name="java/applet/**"/>
43 <filename name="sun/applet/**"/>
44 <filename name="META-INF/services/sun.beans.AppletProxy"/>
50 <filename name="java/beans/**"/>
51 <filename name="sun/beans/**"/>
52 <filename name="com/sun/beans/**"/>
55 <selector refid="applet"/>
56 <selector refid="deprecated7"/>
61 <selector id="deprecated7">
63 <filename name="java/beans/Beans*"/>
69 <selector refid="applet"/>
70 <selector refid="beans"/>
71 <selector refid="client"/>
72 <selector refid="enterprise"/>
73 <selector refid="deprecated7"/>
75 <!-- exclude files that need pre-processing like
76 java/nio/ByteBufferAs-X-Buffer.java
80 <filename name="**/*-*"/>
81 <filename name="java/dyn/**"/>
82 <filename name="sun/dyn/**"/>
84 <filename name="com/sun/script/javascript/**"/>
88 <!-- individual compilation tasks -->
90 <target name="deprecated7">
91 <antcall target="-compile-one-module">
92 <param name="module" value="deprecated7"/>
93 <param name="depends" value="beans:applet"/>
96 <target name="applet">
97 <antcall target="-compile-one-module">
98 <param name="module" value="applet"/>
99 <param name="depends" value="beans"/>
102 <target name="beans">
103 <antcall target="-compile-one-module">
104 <param name="module" value="beans"/>
110 <antcall target="-compile-one-module">
111 <param name="module" value="base"/>
115 <!-- shared routine to compile one of the modules -->
116 <target name="-compile-one-module">
117 <mkdir dir="${build.dir}/classes/${module}"/>
118 <pathconvert pathsep=":" property="module.cp">
119 <path path="${depends}"/>
120 <mapper type="regexp" from=".*[/\\]([^/\\]*)" to="${build.dir}/\1.jar"/>
123 basedir="${build.dir}/classes/${module}"
124 destfile="${build.dir}/empty.jar"
130 bootclasspath="${build.dir}/empty.jar"
132 destdir="${build.dir}/classes/${module}"
133 includejavaruntime="false"
134 includeantruntime="false"
135 classpath="${module.cp}:${plugs}/jre/lib/rt-closed.jar"
137 <src refid="src.path"/>
138 <selector refid="${module}"/>
140 <copy todir="${build.dir}/classes/${module}">
141 <fileset dir="src/share/classes">
143 <selector refid="${module}"/>
145 <filename name="**/*.java"/>
152 basedir="${build.dir}/classes/${module}"
153 destfile="${build.dir}/${module}.jar"
158 <!-- clean everything -->
159 <target name="clean">
160 <delete dir="${build.dir}"/>