ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/build.xml
(Generate patch)

Comparing jsr166/build.xml (file contents):
Revision 1.56 by tim, Mon Sep 1 04:21:55 2003 UTC vs.
Revision 1.119 by jsr166, Mon Jan 21 02:31:40 2013 UTC

# Line 8 | Line 8
8  
9    User-specific settings are read from user.properties.
10    See user.properties.sample for an explanation of some useful settings.
11 +
12 +  The repository contains all dependencies except for ant and the JDK
13 +  itself.  Because the JDK version matters and because different
14 +  targets require different JDKs, we assume that users have created a
15 +  hierarchy containing:
16 +  $HOME/jdk/jdk6
17 +  $HOME/jdk/jdk7
18 +  $HOME/jdk/jdk8
19 +  where each of the above is a JDK or a symlink to same, and
20 +  $HOME/jdk/src/jdk6
21 +  $HOME/jdk/src/jdk7
22 +  $HOME/jdk/src/jdk8
23 +  where each of the above is a complete JDK source tree
24 +  (e.g. mercurial forest) or a symlink to same.
25   ------------------------------------------------------------------------------
26    </description>
27  
# Line 21 | Line 35
35  
36  
37    <!-- Compilation options -->
38 <  <property name="build.sourcelevel"    value="1.5"/>
25 <  <property name="build.docsourcelevel" value="1.4"/>
38 >  <property name="build.sourcelevel"    value="6"/>
39    <property name="build.debug"          value="true"/>
40    <property name="build.debuglevel"     value="source,lines,vars"/>
41    <property name="build.deprecation"    value="false"/>
42  
43    <!-- Build locations -->
44 <  <property name="build.dir"            location="build"/>
45 <  <property name="build.classes.dir"    location="${build.dir}/classes"/>
46 <  <property name="build.emulation.dir"  location="${build.dir}/emulation"/>
47 <  <property name="build.testcases.dir"  location="${build.dir}/testcases"/>
48 <  <property name="build.lib.dir"        location="${build.dir}/lib"/>
49 <  <property name="build.ant.dir"        location="${build.dir}/ant"/>
50 <  <property name="build.javadocs.dir"   location="${build.dir}/javadocs"/>
51 <  <property name="build.sinjdocs.dir"   location="${build.dir}/sinjdocs"/>
52 <  <property name="build.stripped.dir"   location="${build.dir}/stripped"/>
53 <  <property name="build.reports.dir"    location="${build.dir}/reports"/>
54 <  <property name="build.doccheck.dir"   location="${build.dir}/doccheck"/>
55 <  <property name="build.filter.src.dir" location="${build.dir}/filtersrc"/>
56 <  <property name="build.filter.doccheck.dir" location="${build.dir}/filterdocchk"/>
44 >  <property name="build.dir"                   location="build"/>
45 >  <property name="build.classes.dir"           location="${build.dir}/classes"/>
46 >  <property name="build.testcases.dir"         location="${build.dir}/testcases"/>
47 >  <property name="build.loops.dir"             location="${build.dir}/loops"/>
48 >  <property name="build.reports.dir"           location="${build.dir}/reports"/>
49 >
50 >  <property name="build.4jdk7.dir"             location="${build.dir}/jsr166-4jdk7"/>
51 >  <property name="build.4jdk7.classes.dir"     location="${build.4jdk7.dir}/classes"/>
52 >  <property name="build.4jdk7.tck.classes.dir" location="${build.4jdk7.dir}/tck-classes"/>
53 >  <property name="build.4jdk7.docs.dir"        location="${build.4jdk7.dir}/docs"/>
54 >
55 >  <property name="build.jsr166x.dir"           location="${build.dir}/jsr166x"/>
56 >  <property name="build.jsr166y.dir"           location="${build.dir}/jsr166y"/>
57 >  <property name="build.jsr166e.dir"           location="${build.dir}/jsr166e"/>
58 >  <property name="build.extra166y.dir"         location="${build.dir}/extra166y"/>
59 >
60 >  <property name="build.jsr166x.classes.dir"    location="${build.jsr166x.dir}/classes"/>
61 >  <property name="build.jsr166y.classes.dir"    location="${build.jsr166y.dir}/classes"/>
62 >  <property name="build.jsr166e.classes.dir"    location="${build.jsr166e.dir}/classes"/>
63 >  <property name="build.extra166y.classes.dir"  location="${build.extra166y.dir}/classes"/>
64 >
65 >  <!-- JDK locations -->
66 >  <property name="jdks.home"  location="${user.home}/jdk"/>
67 >
68 >  <macrodef name="defjdklocations">
69 >    <attribute name="v"/>
70 >    <sequential>
71 >    <property name="jdk@{v}.home"   location="${jdks.home}/jdk@{v}"/>
72 >    <property name="java@{v}"       location="${jdk@{v}.home}/bin/java"/>
73 >    <property name="javac@{v}"      location="${jdk@{v}.home}/bin/javac"/>
74 >    <property name="javadoc@{v}"    location="${jdk@{v}.home}/bin/javadoc"/>
75 >    <property name="jdk@{v}src.dir" location="${jdks.home}/src/jdk@{v}/jdk/src/share/classes"/>
76 >    <local name="boot.jar.dir"/>
77 >    <property name="boot.jar.dir"   location="${jdk@{v}.home}/jre/lib"/>
78 >    <path id="bootclasspath@{v}">
79 >      <pathelement path="${boot.jar.dir}/resources.jar"/>
80 >      <pathelement path="${boot.jar.dir}/rt.jar"/>
81 >      <pathelement path="${boot.jar.dir}/jsse.jar"/>
82 >      <pathelement path="${boot.jar.dir}/jce.jar"/>
83 >      <pathelement path="${boot.jar.dir}/charsets.jar"/>
84 >    </path>
85 >    <property name="bootclasspath@{v}" value="${toString:bootclasspath@{v}}"/>
86 >    </sequential>
87 >  </macrodef>
88 >
89 >  <defjdklocations v="6"/>
90 >  <defjdklocations v="7"/>
91 >  <defjdklocations v="8"/>
92  
93    <!-- Source locations -->
94    <property name="src.dir"              location="${basedir}/src/main"/>
47  <property name="emulation.src.dir"    location="${basedir}/src/emulation"/>
95    <property name="test.src.dir"         location="${basedir}/src/test"/>
96 <  <property name="ant.src.dir"          location="${basedir}/etc/ant"/>
97 <  <property name="stylesheet.dir"       location="${basedir}/etc/xsl"/>
96 >  <property name="loops.src.dir"        location="${basedir}/src/loops"/>
97 >  <property name="tck.src.dir"          location="${test.src.dir}/tck"/>
98 >  <property name="jtreg.src.dir"        location="${test.src.dir}/jtreg"/>
99    <property name="lib.dir"              location="${basedir}/lib"/>
100    <property name="dist.dir"             location="${basedir}/dist"/>
101 +  <property name="topsrc.dir"           location="${basedir}/src"/>
102 +  <property name="4jdk7src.dir"         location="${topsrc.dir}/jdk7"/>
103 +  <property name="jsr166xsrc.dir"       location="${topsrc.dir}/jsr166x"/>
104 +  <property name="jsr166ysrc.dir"       location="${topsrc.dir}/jsr166y"/>
105 +  <property name="jsr166esrc.dir"       location="${topsrc.dir}/jsr166e"/>
106 +  <property name="extra166ysrc.dir"     location="${topsrc.dir}/extra166y"/>
107  
108    <!-- Distribution locations -->
109 <  <property name="dist.javadocs.dir"    location="${dist.dir}/docs"/>
109 >  <property name="dist.javadocs.dir"          location="${dist.dir}/jsr166.docs"/>
110 >  <property name="dist.4jdk7.docs.dir"        location="${dist.dir}/jsr166-4jdk7.docs"/>
111 >  <property name="dist.jsr166xjavadocs.dir"   location="${dist.dir}/jsr166x.docs"/>
112 >  <property name="dist.jsr166yjavadocs.dir"   location="${dist.dir}/jsr166y.docs"/>
113 >  <property name="dist.jsr166ejavadocs.dir"   location="${dist.dir}/jsr166e.docs"/>
114 >  <property name="dist.extra166yjavadocs.dir" location="${dist.dir}/extra166y.docs"/>
115  
116    <!-- Jar locations -->
117 <  <property name="product.jar"          location="${build.lib.dir}/jsr166.jar"/>
118 <  <property name="junit.jar"            location="${lib.dir}/junit.jar"/>
119 <  <property name="rt.jar"               location="${java.home}/lib/rt.jar"/>
120 <  <property name="sinjdoc.jar"          location="${lib.dir}/sinjdoc.jar"/>
121 <
122 <
123 <  <!-- Files excluded from dist-docs and emulation jar -->
124 <  <patternset id="unsafe.exclusion">
125 <    <exclude name="java/util/Random.*"/>
126 <    <exclude name="sun/misc/Unsafe.*"/>
127 <  </patternset>
128 <
129 <  <!-- Files excludes from emulation jar -->
130 <  <patternset id="atomic.exclusion">
131 <    <exclude name="java/util/concurrent/atomic/AtomicBoolean*"/>
132 <    <exclude name="java/util/concurrent/atomic/AtomicInteger*"/>
133 <    <exclude name="java/util/concurrent/atomic/AtomicLong*"/>
134 <    <exclude name="java/util/concurrent/atomic/AtomicReference*"/>
135 <    <exclude name="java/util/concurrent/locks/LockSupport*"/>
136 <    <exclude name="java/util/concurrent/locks/ReentrantLock*"/>
137 <  </patternset>
117 >  <property name="product.jar"      location="${build.dir}/jsr166.jar"/>
118 >  <property name="4jdk7product.jar" location="${build.4jdk7.dir}/jsr166-4jdk7.jar"/>
119 >  <property name="jsr166x.jar"      location="${build.jsr166x.dir}/jsr166x.jar"/>
120 >  <property name="jsr166y.jar"      location="${build.jsr166y.dir}/jsr166y.jar"/>
121 >  <property name="jsr166e.jar"      location="${build.jsr166e.dir}/jsr166e.jar"/>
122 >  <property name="extra166y.jar"    location="${build.extra166y.dir}/extra166y.jar"/>
123 >  <property name="junit.jar"        location="${lib.dir}/junit.jar"/>
124 >
125 >  <!-- Canonical location of jdk API docs, to use with javadoc link attribute -->
126 >  <property name="jdkapi5docs.url"      value="http://docs.oracle.com/javase/1.5.0/docs/api/"/>
127 >  <property name="jdkapi6docs.url"      value="http://docs.oracle.com/javase/6/docs/api/"/>
128 >  <property name="jdkapi7docs.url"      value="http://docs.oracle.com/javase/7/docs/api/"/>
129 >
130 >  <property name="jdkapi8docs.url"      value="http://download.java.net/jdk8/docs/api/"/>
131 >  <!-- The below does not yet exist as of 2012-11 -->
132 >  <!-- <property name="jdkapi8docs.url" value="http://docs.oracle.com/javase/8/docs/api/"/> -->
133 >
134 >  <!-- Default jdk api doc location (latest stable release seems best) -->
135 >  <property name="jdkapidocs.url"       value="${jdkapi7docs.url}"/>
136 >
137 >  <!-- Define the "jtreg" task -->
138 >  <!-- See the docs in "jtreg -onlineHelp" -->
139 >  <taskdef name="jtreg" classname="com.sun.javatest.regtest.Main$$Ant"
140 >           classpath="${lib.dir}/jtreg.jar" />
141 >
142 >  <!-- Test classpath -->
143 >  <path id="test.classpath">
144 >    <pathelement location="${build.testcases.dir}"/>
145 >    <pathelement location="${junit.jar}"/>
146 >  </path>
147 >
148 >  <macrodef name="run-tck-tests">
149 >    <attribute name="target"/>
150 >    <attribute name="workdir"/>
151 >    <attribute name="product.jar" default="${product.jar}"/>
152 >    <attribute name="jvmflags" default=""/>
153 >    <sequential>
154 >
155 >    <mkdir dir="@{workdir}/tck-classes"/>
156 >
157 >    <javac srcdir="${tck.src.dir}"
158 >           destdir="@{workdir}/tck-classes"
159 >           debug="${build.debug}"
160 >           debuglevel="${build.debuglevel}"
161 >           deprecation="${build.deprecation}"
162 >           source="6"
163 >           classpath="${junit.jar}"
164 >           bootclasspath="@{product.jar}:${bootclasspath6}"
165 >           includeAntRuntime="false"
166 >           includeJavaRuntime="false"
167 >           executable="${javac@{target}}"
168 >           fork="true">
169 >
170 >      <include name="JSR166TestCase.java"/>
171 >      <compilerarg value="-XDignore.symbol.file=true"/>
172 >      <compilerarg value="-Xlint:all,-unchecked,-rawtypes,-serial,-deprecation"/>
173 >      <compilerarg line="${build.args}"/>
174  
175 +    </javac>
176  
177 +    <java classname="JSR166TestCase"
178 +          failonerror="true"
179 +          jvm="${java@{target}}"
180 +          fork="true">
181 +        <jvmarg value="-Xbootclasspath/p:@{product.jar}"/>
182 +        <jvmarg line="@{jvmflags}"/>
183 +        <classpath>
184 +          <pathelement location="${junit.jar}"/>
185 +          <pathelement location="@{workdir}/tck-classes"/>
186 +        </classpath>
187 +    </java>
188  
189 <  <!-- Main targets -->
189 >    </sequential>
190 >  </macrodef>
191  
192 <  <target name="compile"
193 <          depends="init, configure-compiler, prepare-src"
194 <          description="Compiles main sources to build folder">
192 >  <!-- ALoops classpath -->
193 >  <path id="loops.classpath">
194 >    <pathelement location="${build.loops.dir}"/>
195 >  </path>
196 >
197 >  <!-- Support @jls tag, used in jdk8+ javadoc -->
198 >  <!-- TODO: How do we get &trade to work? -->
199 >  <!-- TODO: Why isn't @jls a "standard" tag? -->
200 >  <!--   property name="javadoc.jls.cite" value="The Java&trade; Language Specification" -->
201 >  <property name="javadoc.jls.cite" value="The Java Language Specification"/>
202 >  <property name="javadoc.jls.option" value="jls:a:See &lt;cite&gt;${javadoc.jls.cite}&lt;/cite&gt;:"/>
203  
204 <    <property name="prepare.src.dir" value="${src.dir}"/>
204 >  <!-- Main targets -->
205  
206 <    <mkdir dir="${build.classes.dir}"/>
206 >  <target name="dists"
207 >          depends="dist, 4jdk7dist, jsr166edist, jsr166ydist, extra166ydist, jsr166xdist"
208 >          description="Builds all public jars and docs"/>
209  
210 < <!--
211 <    <echo>javac ${gjc.args}</echo>
212 <    <echo>bootclasspath=${compile.bootclasspath}</echo>
95 < -->
210 >  <target name="compile"
211 >          depends="configure-compiler"
212 >          description="Compiles src/main sources to build dir">
213  
214 <    <javac srcdir="${prepare.src.dir}"
98 <          destdir="${build.classes.dir}"
99 <            debug="${build.debug}"
100 <       debuglevel="${build.debuglevel}"
101 <      deprecation="${build.deprecation}"
102 <           source="${build.sourcelevel}"
103 <             fork="true">
214 >    <mkdir dir="${build.classes.dir}"/>
215  
216 <      <compilerarg    line="${gjc.args}"/>
217 < <!--
218 <      <bootclasspath refid="compile.bootclasspath"/>
219 < -->
216 >    <javac srcdir="${src.dir}"
217 >           destdir="${build.classes.dir}"
218 >           debug="${build.debug}"
219 >           debuglevel="${build.debuglevel}"
220 >           deprecation="${build.deprecation}"
221 >           classpath=""
222 >           includeAntRuntime="false"
223 >           includeJavaRuntime="false"
224 >           executable="${javac8}"
225 >           fork="true">
226 >
227 >      <include name="**/*.java"/>
228 >      <compilerarg value="-XDignore.symbol.file=true"/>
229 >      <compilerarg value="-Xlint:all"/>
230 >      <compilerarg line="${build.args}"/>
231  
232      </javac>
111
233    </target>
234  
235  
236    <target name="jar"
237 <          depends="configure-emulation, init-jar, native-jar, emulation-jar"
238 <          description="Builds library jar from compiled sources"/>
237 >          depends="compile"
238 >          description="Builds library jar from compiled sources">
239 >
240 >    <jar destfile="${product.jar}">
241 >      <fileset dir="${build.classes.dir}"/>
242 >    </jar>
243 >  </target>
244  
245  
246    <target name="test"
247 <          depends="init, configure-tests, report-tests"
247 >          depends="configure-tests, report-tests"
248            description="Runs all tests (requires JUnit 3.8.1 in ${ant.home}/lib)" />
249  
250  
251 <  <target name="checkstyle"
252 <          depends="filter-src"
127 <          description="Reports on style errors in Java source (verbose, mostly chaff)">
251 >  <target name="docs"
252 >          description="Builds javadocs for src/main to dist dir">
253  
254 <    <taskdef resource="checkstyletask.properties"
255 <            classpath="${lib.dir}/checkstyle-all-2.4.jar"/>
254 >    <delete dir="${dist.javadocs.dir}"/>
255 >    <mkdir dir="${dist.javadocs.dir}"/>
256  
257 <    <checkstyle>
258 <      <formatter type="plain"/>  <!-- also available: type="xml" -->
134 <      <fileset dir="${build.filter.src.dir}" includes="**/*.java"/>
135 <    </checkstyle>
257 >    <!-- the packagenames="none" hack below prevents scanning the -->
258 >    <!-- sourcepath for packages -->
259  
260 +    <javadoc destdir="${dist.javadocs.dir}"
261 +             packagenames="none"
262 +             link="${jdkapi8docs.url}"
263 +             overview="${src.dir}/intro.html"
264 +             sourcepath="${src.dir}:${jdk8src.dir}"
265 +             classpath=""
266 +             executable="${javadoc8}">
267 +      <fileset dir="${src.dir}" defaultexcludes="yes">
268 +        <include name="**/*.java"/>
269 +      </fileset>
270 +      <arg value="-XDignore.symbol.file=true"/>
271 +      <arg value="-tag"/>
272 +      <arg value="${javadoc.jls.option}"/>
273 +    </javadoc>
274    </target>
275  
276  
277 <  <target name="doccheck"
278 <          depends="filter-doccheck"
279 <          description="Reports on javadoc style errors">
277 >  <target name="dist"
278 >          depends="dist-clean, dist-jar, docs"
279 >          description="Puts all distributable products in single hierarchy"/>
280  
144    <delete dir="${build.doccheck.dir}"/>
145    <mkdir dir="${build.doccheck.dir}"/>
281  
282 <    <javadoc doclet="com.sun.tools.doclets.doccheck.DocCheck"
283 <         docletpath="${lib.dir}/doccheck.jar"
284 <            destdir="${build.doccheck.dir}">
150 <      <packageset dir="${build.filter.doccheck.dir}"/>
151 <    </javadoc>
282 >  <target name="release"
283 >          depends="dist"
284 >          description="Puts entire CVS tree, plus distribution productions, in a jar">
285  
286 <    <echo>DocCheck output is in ${build.doccheck.dir}</echo>
286 >    <property name="release.jar" value="dist/jsr166-${version}-dist.jar"/>
287  
288 +    <jar basedir="${basedir}" destfile="${release.jar}">
289 +      <!-- <exclude name="build/**"/> -->
290 +      <exclude name="${release.jar}"/>
291 +      <exclude name="user.properties"/>
292 +      <exclude name="etc/notes/**"/>
293 +      <exclude name="src/emulation/**"/>
294 +      <exclude name="**/SyntaxTest.java"/>
295 +      <exclude name="**/SuperfluousAbstract.java"/>
296 +    </jar>
297    </target>
298  
299  
300 <  <target name="docs"
301 <          depends="filter-src"
302 <          description="Builds javadocs with custom tags to build folder">
300 >  <target name="clean"
301 >          description="Removes all build products">
302 >
303 >    <delete dir="${build.dir}"/>
304  
305 <    <delete dir="${build.javadocs.dir}"/>
163 <    <mkdir dir="${build.javadocs.dir}"/>
305 >  </target>
306  
165    <javadoc destdir="${build.javadocs.dir}"
166                link="http://java.sun.com/j2se/1.4.1/docs/api"
167            overview="${src.dir}/intro.html"
168              source="${build.docsourcelevel}">
169
170      <tag name="revised" description="Last revised:"/>
171      <tag name="spec"    description="Specified by:"/>
172      <tag name="editor"  description="Last edited by:"/>
173      <tag name="fixme"   description="FIX ME:"/>
307  
308 <      <packageset dir="${build.filter.src.dir}"/>
308 >  <target name="dist-clean"
309 >          description="Removes all build and distribution products">
310  
311 <    </javadoc>
311 >    <delete dir="${dist.dir}"/>
312  
313    </target>
314  
315  
316 <  <target name="sinjdocs"
183 <          depends="configure-tests"
184 <          description="Builds javadocs with custom tags to build folder">
316 >  <!-- Internal targets -->
317  
186    <delete dir="${build.sinjdocs.dir}"/>
187    <mkdir dir="${build.sinjdocs.dir}"/>
318  
319 <    <java classname="net.cscott.sinjdoc.Main" fork="true">
319 >  <target name="dist-jar"
320 >          depends="clean, jar">
321  
322 <      <jvmarg value="-Xbootclasspath/p:${test.run.bootclasspath}"/>
322 >    <copy file="${product.jar}" todir="${dist.dir}"/>
323  
324 <      <classpath>
194 <        <pathelement location="${sinjdoc.jar}"/>
195 <        <pathelement location="${lib.dir}/jutil.jar"/>
196 <        <pathelement location="${lib.dir}/cup.jar"/>
197 <        <path refid="test.classpath"/>
198 <      </classpath>
324 >  </target>
325  
326  
327 <      <arg value="-d"/>          <arg value="${build.sinjdocs.dir}"/>
328 <      <arg value="-sourcepath"/> <arg value="${src.dir}"/>
203 <      <arg value="-overview"/>   <arg value="${src.dir}/intro.html"/>
204 <      <arg value="-source"/>     <arg value="${build.sourcelevel}"/>
205 <      <!-- <arg value="-verbose"/> -->
206 <      <!-- <arg value="-link"/>  <arg value="http://java.sun.com/j2se/1.4.1/docs/api"/> -->
207 <      <arg value="java.lang"/>
208 <      <arg value="java.util"/>
209 <      <arg value="java.util.concurrent"/>
210 <      <arg value="java.util.concurrent.atomic"/>
211 <      <arg value="java.util.concurrent.locks"/>
212 <
213 <      <!--
214 <      <arg value="-help"/>
215 <      -->
327 >  <target name="compile-tests"
328 >          depends="jar">
329  
330 <    </java>
330 >    <mkdir dir="${build.testcases.dir}"/>
331  
332 <  </target>
332 >    <javac srcdir="${tck.src.dir}"
333 >           destdir="${build.testcases.dir}"
334 >           debug="${build.debug}"
335 >           debuglevel="${build.debuglevel}"
336 >           deprecation="${build.deprecation}"
337 >           source="6"
338 >           classpath="${junit.jar}"
339 >           bootclasspath="@{product.jar}:${bootclasspath6}"
340 >           includeAntRuntime="false"
341 >           includeJavaRuntime="false"
342 >           executable="${javac8}"
343 >           fork="true">
344 >
345 >      <include name="**/*.java"/>
346 >      <compilerarg value="-XDignore.symbol.file=true"/>
347 >      <compilerarg value="-Xlint:all,-unchecked,-rawtypes,-serial,-deprecation"/>
348 >      <compilerarg line="${build.args}"/>
349  
350 +    </javac>
351  
352 <  <target name="strip"
353 <          depends="init, configure-compiler"
354 <          description="Strip generics from java source (not working yet)">
352 >    <javac srcdir="${test.src.dir}"
353 >           destdir="${build.testcases.dir}"
354 >           debug="${build.debug}"
355 >           debuglevel="${build.debuglevel}"
356 >           deprecation="${build.deprecation}"
357 >           source="6"
358 >           classpath=""
359 >           bootclasspath="@{product.jar}:${bootclasspath6}"
360 >           includeAntRuntime="false"
361 >           includeJavaRuntime="false"
362 >           executable="${javac8}"
363 >           fork="true">
364 >
365 >      <include name="jsr166/test/**/*.java"/>
366 >      <compilerarg value="-XDignore.symbol.file=true"/>
367 >      <compilerarg value="-Xlint:all,-unchecked,-rawtypes,-serial,-deprecation"/>
368 >      <compilerarg line="${build.args}"/>
369  
370 <    <mkdir dir="${build.stripped.dir}"/>
370 >    </javac>
371  
372 <    <!--
373 <     # javac -s doesn't reliably generate compilable code. It generates
374 <     # bridge methods (marked as "synthetic") that can have identical
231 <     # signatures to existing methods except for the return value.
232 <     -->
233 <    <javac srcdir="${src.dir}"
234 <          destdir="${build.stripped.dir}"
372 > <!--
373 >    <javac srcdir="${jtreg.src.dir}"
374 >          destdir="${build.testcases.dir}"
375              debug="${build.debug}"
376         debuglevel="${build.debuglevel}"
377        deprecation="${build.deprecation}"
378             source="${build.sourcelevel}"
379               fork="true">
380  
381 <      <compilerarg    line="${gjc.args} -s"/>
382 < <!--
383 <      <bootclasspath refid="compile.bootclasspath"/>
244 < -->
381 >      <compilerarg value="-Xbootclasspath/p:${product.jar}"/>
382 >      <compilerarg value="-XDignore.symbol.file=true"/>
383 >      <compilerarg line="${build.args}"/>
384  
385      </javac>
386 + -->
387  
388    </target>
389  
390  
391 <  <target name="dist"
392 <          depends="init, dist-clean, dist-jar, dist-docs"
253 <          description="Puts all distributable products in single hierarchy"/>
391 >  <target name="run-tests"
392 >          depends="compile-tests">
393  
394 <  <target name="release"
395 <          depends="dist"
257 <          description="Puts entire CVS tree, plus distribution productions, in a jar">
394 >    <!-- May be overridden by user.properties -->
395 >    <property name="testcase" value="*"/>
396  
397 < <!--
260 <    #keep build dir? - dl
261 <    <delete dir="${build.dir}"/>
262 < -->
263 <    <property name="release.jar" value="dist/jsr166-${version}-dist.jar"/>
397 >    <mkdir dir="${build.reports.dir}"/>
398  
399 <    <jar basedir="${basedir}" destfile="${release.jar}">
400 <      <exclude name="${release.jar}"/>
401 <      <exclude name="user.properties"/>
402 <      <exclude name="etc/notes/**"/>
403 <      <exclude name="lib/gjc/2.1/**"/>
404 <      <exclude name="**/SyntaxTest.java"/>
405 <    </jar>
399 >    <junit printsummary="true"
400 >             showoutput="true"
401 >          errorProperty="junit.failed"
402 >        failureProperty="junit.failed"
403 >                    dir="${build.reports.dir}"
404 >                    jvm="${java8}"
405 >                   fork="true">
406  
407 <  </target>
407 >      <jvmarg value="-Xbootclasspath/p:${product.jar}"/>
408 >      <jvmarg value="-server"/>
409 >      <jvmarg value="-showversion"/>
410  
411 <  <target name="clean"
276 <          description="Removes all build products">
411 >      <classpath refid="test.classpath"/>
412  
413 <    <delete dir="${build.dir}"/>
279 <    <delete dir="${build.classes.dir}"/>
280 <    <delete dir="${build.lib.dir}"/>
413 >      <formatter type="xml"/>
414  
415 <  </target>
415 >      <batchtest todir="${build.reports.dir}" unless="no.test.tck">
416 >        <fileset dir="${tck.src.dir}">
417 >          <include name="**/${testcase}Test.java"/>
418 >        </fileset>
419 >      </batchtest>
420  
421 +      <batchtest todir="${build.reports.dir}" if="do.test.old">
422 +        <fileset dir="${test.src.dir}">
423 +          <include name="jsr166/test/**/${testcase}Test.java"/>
424 +        </fileset>
425 +      </batchtest>
426  
427 <  <target name="dist-clean"
428 <          description="Removes all build and distribution products">
427 > <!--
428 >      <batchtest todir="${build.reports.dir}" if="do.test.jtreg">
429 >        <fileset dir="${jtreg.src.dir}">
430 >          <include name="**/${testcase}Test.java"/>
431 >        </fileset>
432 >      </batchtest>
433 > -->
434  
435 <    <delete dir="${dist.dir}"/>
435 >    </junit>
436  
437    </target>
438  
439  
440 <  <target name="dist-docs"
441 <          depends="filter-src"
295 <          description="Builds javadocs without custom tags to dist folder">
296 <
297 <    <delete dir="${dist.javadocs.dir}"/>
298 <    <mkdir dir="${dist.javadocs.dir}"/>
440 >  <target name="report-tests"
441 >          depends="run-tests">
442  
443 <    <javadoc destdir="${dist.javadocs.dir}"
444 <                link="http://java.sun.com/j2se/1.4.1/docs/api"
445 <            overview="${src.dir}/intro.html"
446 <              source="${build.docsourcelevel}">
443 >    <!-- Sets junit.report.format to frames if redirection is present,
444 >         otherwise sets it to noframes. -->
445 >    <available property="junit.report.format"
446 >                  value="frames"
447 >              classname="org.apache.xalan.lib.Redirect"
448 >    />
449 >    <property name="junit.report.format" value="noframes"/>
450  
451 <      <packageset dir="${build.filter.src.dir}"/>
451 >    <junitreport todir="${build.reports.dir}">
452 >      <fileset dir="${build.reports.dir}">
453 >        <include name="TEST-*.xml"/>
454 >      </fileset>
455 >      <report format="${junit.report.format}" todir="${build.reports.dir}"
456 >      />
457 >    </junitreport>
458  
459 <    </javadoc>
459 >    <fail message="Test Cases Failed" if="junit.failed"/>
460  
461    </target>
462  
463  
464 +  <target name="configure-compiler">
465 +
466 +    <property name="unchecked.option" value="-Xlint:unchecked"/>
467  
468 <  <!-- Internal targets -->
468 >    <condition property="warnunchecked.arg" value="${unchecked.option}">
469 >      <istrue value="${build.warnunchecked}"/>
470 >    </condition>
471  
472 +    <property name="warnunchecked.arg" value=""/>
473  
316  <target name="init">
474  
475 <    <!-- Version is kept in a separate file -->
476 <    <loadfile property="version" srcFile="version.properties"/>
320 <    <echo>Building JSR-166 version ${version}</echo>
321 <    <echo>java.home is ${java.home}</echo>
475 >    <!-- Common options in javac invocations -->
476 >    <property name="build.args" value="${warnunchecked.arg}"/>
477  
478    </target>
479  
480  
481 <  <target name="init-jar">
481 >  <target name="configure-tests"
482 >       depends="configure-compiler">
483  
484 <    <mkdir dir="${build.lib.dir}"/>
484 >    <!-- junit.framework.Protectable is in JUnit 3.8.1 but not in 3.7 -->
485 >    <available property="junit.available"
486 >               classname="junit.framework.Protectable"/>
487  
488 <  </target>
488 >    <!-- Xalan -->
489 >    <available property="xalan.available"
490 >               classname="org.apache.xalan.Version"/>
491  
492  
493 <  <target name="native-jar"
494 <          depends="compile"
495 <          unless="build.emulation.true">
493 >    <!-- Ant 1.6beta and later don't need or want this check -->
494 >    <!--
495 >    <fail message="Need JUnit 3.8.1 in ${ant.home}${file.separator}lib to run tests"
496 >          unless="junit.available"/>
497  
498 <    <jar destfile="${product.jar}">
499 <      <fileset dir="${build.classes.dir}"/>
500 <    </jar>
498 >    <fail message="Need Xalan 2.5.1 jar in ${ant.home}${file.separator}lib to run tests"
499 >          unless="xalan.available"/>
500 >    -->
501  
502    </target>
503  
504  
505 <  <target name="compile-emulation"
345 <          depends="init, configure-compiler"
346 <          if="build.emulation.true">
505 >  <!-- Various demos and test programs -->
506  
348    <mkdir dir="${build.emulation.dir}"/>
507  
508 <    <javac srcdir="${emulation.src.dir}"
509 <          destdir="${build.emulation.dir}"
508 >  <target name="loops" depends="configure-compiler"
509 >          description="Benchmark from Doug Lea's AQS paper">
510 >
511 >    <mkdir dir="${build.loops.dir}"/>
512 >
513 >    <javac srcdir="${loops.src.dir}"
514 >          destdir="${build.loops.dir}"
515              debug="${build.debug}"
516         debuglevel="${build.debuglevel}"
517        deprecation="${build.deprecation}"
518             source="${build.sourcelevel}"
519               fork="true">
520  
521 <      <compilerarg    line="${gjc.args}"/>
522 < <!--
523 <      <bootclasspath refid="compile.bootclasspath"/>
361 < -->
521 >      <compilerarg line="${build.args}"/>
522 >      <classpath refid="loops.classpath"/>
523 >      <compilerarg value="-XDignore.symbol.file=true"/>
524  
525      </javac>
526  
527 +    <java classname="ALoops" fork="true">
528 +      <classpath refid="loops.classpath"/>
529 +    </java>
530 +
531    </target>
532  
533  
534 <  <target name="emulation-jar"
369 <          depends="compile-emulation"
370 <          if="build.emulation.true">
534 >  <!-- jsr166 4jdk7 -->
535  
536 +  <target name="4jdk7compile"
537 +          depends="configure-compiler"
538 +          description="Compiles src/jdk7 sources, targeting jdk7">
539  
540 <    <jar destfile="${product.jar}" duplicate="add">
541 <      <fileset dir="${build.classes.dir}">
542 <        <patternset refid="atomic.exclusion"/>
543 <        <patternset refid="unsafe.exclusion"/>
544 <      </fileset>
545 <      <fileset dir="${build.emulation.dir}"/>
546 <    </jar>
540 >    <mkdir dir="${build.4jdk7.classes.dir}"/>
541 >
542 >    <javac srcdir="${4jdk7src.dir}"
543 >           destdir="${build.4jdk7.classes.dir}"
544 >           debug="${build.debug}"
545 >           debuglevel="${build.debuglevel}"
546 >           deprecation="${build.deprecation}"
547 >           source="6"
548 >           classpath=""
549 >           bootclasspath="${bootclasspath6}"
550 >           includeAntRuntime="false"
551 >           includeJavaRuntime="false"
552 >           executable="${javac7}"
553 >           fork="true">
554 >
555 >      <include name="**/*.java"/>
556 >      <compilerarg value="-XDignore.symbol.file=true"/>
557 >      <compilerarg value="-Xlint:all"/>
558 >      <compilerarg line="${build.args}"/>
559  
560 +    </javac>
561    </target>
562  
563  
564 <  <target name="dist-jar"
565 <          depends="clean, jar">
564 >  <target name="4jdk7-jar"
565 >          depends="4jdk7compile"
566 >          description="Builds library jar from compiled sources">
567  
568 <    <copy file="${product.jar}" todir="${dist.dir}"/>
568 >    <jar destfile="${4jdk7product.jar}">
569 >      <fileset dir="${build.4jdk7.classes.dir}"/>
570 >    </jar>
571  
572    </target>
573  
574  
575 <  <target name="compile-ant-filter"
576 <          depends="init">
575 >  <target name="4jdk7-test-tck"
576 >          depends="4jdk7-jar"
577 >          description="Runs tck tests for jsr166-4jdk7 directly">
578  
579 <    <mkdir dir="${build.ant.dir}"/>
579 >    <run-tck-tests
580 >      target="7"
581 >      workdir="${build.4jdk7.dir}"
582 >      product.jar="${4jdk7product.jar}"/>
583 >  </target>
584  
397    <javac srcdir="${ant.src.dir}"
398          destdir="${build.ant.dir}"
399           source="1.4"
400    />
585  
586 +  <target name="4jdk7-test-tck-junit"
587 +          depends="4jdk7compile"
588 +          description="Runs tck tests for jsr166-4jdk7 via junit task (experimental)">
589 +
590 +    <junit printsummary="true"
591 +           showoutput="true"
592 +           errorProperty="junit.failed"
593 +           failureProperty="junit.failed"
594 +           includeantruntime="true"
595 +           jvm="${java7}"
596 +           fork="true">
597 +
598 +      <jvmarg value="-Xbootclasspath/p:${4jdk7product.jar}"/>
599 +      <jvmarg value="-server"/>
600 +
601 +      <classpath>
602 +        <pathelement location="${junit.jar}"/>
603 +        <pathelement location="${build.4jdk7.tck.classes.dir}"/>
604 +      </classpath>
605 +
606 +      <formatter type="brief"/>
607 +
608 +      <test name="JSR166TestCase" haltonfailure="no">
609 +      </test>
610 +
611 +    </junit>
612    </target>
613  
614 +  <target name="4jdk7-test-jtreg"
615 +          depends="4jdk7compile"
616 +          description="Runs jtreg tests for jsr166-4jdk7 using the jtreg ant task">
617 +    <delete dir="${build.4jdk7.dir}/JTwork"   quiet="true"/>
618 +    <delete dir="${build.4jdk7.dir}/JTreport" quiet="true"/>
619 +    <mkdir dir="${build.4jdk7.dir}/JTwork/scratch"/>
620 +    <mkdir dir="${build.4jdk7.dir}/JTreport"/>
621 +    <jtreg dir="${jtreg.src.dir}"
622 +           jdk="${jdk7.home}"
623 +           workDir="${build.4jdk7.dir}/JTwork"
624 +           reportDir="${build.4jdk7.dir}/JTreport">
625 +
626 +      <arg value="-Xbootclasspath/p:${4jdk7product.jar}"/>
627 +      <arg value="-agentvm"/>
628 +      <arg value="-v:nopass,fail"/>
629 +      <arg value="-vmoptions:-esa -ea"/>
630 +      <arg value="-automatic"/>
631 +      <arg value="-k:!ignore"/>
632 +    </jtreg>
633 +  </target>
634  
405  <target name="filter-src"
406          depends="compile-ant-filter">
635  
636 <    <mkdir dir="${build.filter.src.dir}"/>
636 >  <target name="4jdk7-test"
637 >          depends="4jdk7-test-tck, 4jdk7-test-jtreg"
638 >          description="Runs tck and jtreg tests for jsr166-4jdk7">
639 >  </target>
640  
410    <copy todir="${build.filter.src.dir}">
411      <fileset dir="${src.dir}">
412        <include name="**/*.html"/>
413      </fileset>
414    </copy>
641  
642 <    <copy todir="${build.filter.src.dir}">
643 <      <fileset dir="${src.dir}">
644 <        <exclude name="**/*.html"/>
645 <        <patternset refid="unsafe.exclusion"/>
642 >  <target name="4jdk7docs"
643 >          description="Builds javadocs for src/jdk7 to dist dir">
644 >
645 >    <delete dir="${dist.4jdk7.docs.dir}"/>
646 >    <mkdir dir="${dist.4jdk7.docs.dir}"/>
647 >
648 >    <javadoc destdir="${dist.4jdk7.docs.dir}"
649 >             packagenames="none"
650 >             link="${jdkapi7docs.url}"
651 >             overview="${4jdk7src.dir}/intro.html"
652 >             sourcepath="${4jdk7src.dir}:${jdk7src.dir}"
653 >             classpath=""
654 >             executable="${javadoc7}">
655 >      <fileset dir="${4jdk7src.dir}" defaultexcludes="yes">
656 >        <include name="**/*.java"/>
657        </fileset>
658 <      <filterchain>
658 >      <arg value="-XDignore.symbol.file=true"/>
659 >    </javadoc>
660 >  </target>
661  
423        <!--
424         # This filter gets rid of angle-bracketed type parameters
425         # so that javadoc can run on the result. The following
426         # heuristic seems to work:
427         #
428         # For all lines not starting with space(s)-asterisk-space(s),
429         #   replace <something> with a space, where there may be more
430         #   than one right angle bracket at the end, and "something"
431         #   must not contain parens or pipes. (This may need some
432         #   tweaking.)
433         -->
662  
663 <        <filterreader classname="jsr166.ant.filters.ReplaceFilter"
664 <                      classpath="${build.ant.dir}">
665 <          <param name="notmatching" value="^\s+\*\s.*$"/>
438 <          <param name="pattern"     value="&lt;[^|>()]+?>+"/>
439 <          <param name="replacement" value=" "/>
440 <        </filterreader>
663 >  <target name="4jdk7dist"
664 >          depends="4jdk7dist-clean, 4jdk7dist-jar, 4jdk7docs"
665 >          description="Puts all distributable products in single hierarchy"/>
666  
667  
668 <        <!--
669 <         # This filter uncomments lines beginning with "//@" so that
445 <         # javadoc can see imports that are needed to resolve links
446 <         # but that shouldn't be in the compiled code.
447 <         -->
668 >  <target name="4jdk7clean"
669 >          description="Removes all 4jdk7 build products">
670  
671 <        <filterreader classname="jsr166.ant.filters.ReplaceFilter"
450 <                      classpath="${build.ant.dir}">
451 <          <param name="matching"    value="^//@.*$"/>
452 <          <param name="pattern"     value="^//@"/>
453 <          <param name="replacement" value=""/>
454 <        </filterreader>
455 <      </filterchain>
456 <    </copy>
671 >    <delete dir="${build.4jdk7.dir}"/>
672  
673    </target>
674  
675  
676 +  <target name="4jdk7dist-clean"
677 +          description="Removes all build and distribution products">
678  
679 +  </target>
680  
681 <  <target name="filter-doccheck"
682 <          depends="filter-src">
681 >  <target name="4jdk7dist-jar"
682 >          depends="4jdk7clean, 4jdk7-jar">
683  
684 <    <mkdir dir="${build.filter.doccheck.dir}"/>
684 >    <copy file="${4jdk7product.jar}" todir="${dist.dir}"/>
685  
686 <    <copy todir="${build.filter.doccheck.dir}">
469 <      <fileset dir="${build.filter.src.dir}">
470 <        <include name="**/*.html"/>
471 <      </fileset>
472 <    </copy>
686 >  </target>
687  
474    <property name="generic.declarations"
475             value="/** Fake type parameter. */ public interface E {} /** Fake type parameter. */ public interface T {} /** Fake type parameter. */ public interface K {} /** Fake type parameter. */ public interface V {}"
476    />
688  
689 <    <copy todir="${build.filter.doccheck.dir}">
690 <      <fileset dir="${build.filter.src.dir}">
691 <        <exclude name="**/*.html"/>
692 <      </fileset>
693 <      <filterchain>
694 <        <!--
695 <         # These two filters try to make the source look like
485 <         # something that doccheck can process. The first removes
486 <         # -source 1.4 assertions and the second adds in a bunch
487 <         # of single letter public nested marker interfaces so that
488 <         # the generic type parameters are recognized.
489 <         -->
490 <
491 <        <filterreader classname="jsr166.ant.filters.ReplaceFilter"
492 <                      classpath="${build.ant.dir}">
493 <          <param name="matching"    value="^\s*assert[\s ].*$"/>
494 <          <param name="pattern"     value="assert"/>
495 <          <param name="replacement" value="//assert"/>
496 <        </filterreader>
497 <
498 <        <filterreader classname="jsr166.ant.filters.ReplaceFilter"
499 <                      classpath="${build.ant.dir}">
500 <          <param name="matching"    value="^([^*]*(class|interface|implements) .*|)\{.*$"/>
501 <          <param name="pattern"     value="$"/>
502 <          <param name="replacement" value=" ${generic.declarations}"/>
503 <        </filterreader>
689 >  <!-- jsr166x -->
690 >
691 >  <target name="jsr166xcompile"
692 >          depends="configure-compiler"
693 >          description="Compiles jsr166x sources to build dir">
694 >
695 >    <mkdir dir="${build.jsr166x.classes.dir}"/>
696  
697 <      </filterchain>
698 <    </copy>
697 >    <javac srcdir="${topsrc.dir}"
698 >           destdir="${build.jsr166x.classes.dir}"
699 >           debug="${build.debug}"
700 >           debuglevel="${build.debuglevel}"
701 >           deprecation="${build.deprecation}"
702 >           classpath=""
703 >           bootclasspath="${bootclasspath6}"
704 >           source="5"
705 >           includeAntRuntime="false"
706 >           includeJavaRuntime="false"
707 >           executable="${javac7}"
708 >           fork="true">
709 >
710 >      <include name="jsr166x/**/*.java"/>
711 >      <compilerarg value="-XDignore.symbol.file=true"/>
712 >      <compilerarg value="-Xlint:all,-unchecked,-rawtypes"/>
713 >      <compilerarg line="${build.args}"/>
714  
715 +    </javac>
716    </target>
717  
718  
719 <  <target name="compile-tests"
720 <          depends="jar">
719 >  <target name="jsr166x-jar"
720 >          depends="jsr166xcompile"
721 >          description="Builds library jar from compiled sources">
722  
723 <    <mkdir dir="${build.testcases.dir}"/>
723 >    <jar destfile="${jsr166x.jar}">
724 >      <fileset dir="${build.jsr166x.classes.dir}"/>
725 >    </jar>
726  
727 < <!--
517 <    <echo>javac ${gjc.args}</echo>
518 <    <echo>bootclasspath=${test.compile.bootclasspath}</echo>
519 <    <echo>classpath="${test.classpath}"</echo>
520 < -->
727 >  </target>
728  
522    <javac srcdir="${test.src.dir}"
523          destdir="${build.testcases.dir}"
524            debug="${build.debug}"
525       debuglevel="${build.debuglevel}"
526      deprecation="${build.deprecation}"
527           source="${build.sourcelevel}"
528             fork="true">
729  
730 <      <compilerarg    line="${gjc.args}"/>
731 < <!--      
532 <      <bootclasspath refid="test.compile.bootclasspath"/>
533 < -->      
534 <      <classpath     refid="test.classpath"/>
535 <      
536 <      <include name="java/**"/>
537 <      <include name="jsr166/**"/>
730 >  <target name="jsr166xdocs"
731 >          description="Builds javadocs to dist dir">
732  
733 <    </javac>
733 >    <delete dir="${dist.jsr166xjavadocs.dir}"/>
734 >    <mkdir dir="${dist.jsr166xjavadocs.dir}"/>
735 >
736 >    <javadoc destdir="${dist.jsr166xjavadocs.dir}"
737 >             packagenames="jsr166x.*"
738 >             link="${jdkapidocs.url}"
739 >             sourcepath="${topsrc.dir}:${jdk6src.dir}"
740 >             bootclasspath="${bootclasspath6}"
741 >             source="5"
742 >             executable="${javadoc7}">
743 >      <arg value="-XDignore.symbol.file=true"/>
744  
745 +    </javadoc>
746    </target>
747  
748  
749 <  <target name="run-tests"
750 <          depends="compile-tests">
749 >  <target name="jsr166xdist"
750 >          depends="jsr166xdist-clean, jsr166xdist-jar, jsr166xdocs"
751 >          description="Puts all distributable products in single hierarchy"/>
752  
547    <!-- May be overridden by user.properties -->
548    <property name="testcase" value="*"/>
753  
754 <    <mkdir dir="${build.reports.dir}"/>
754 >  <target name="jsr166xclean"
755 >          description="Removes all jsr166x build products">
756  
757 <    <junit printsummary="true"
553 <             showoutput="true"
554 <          errorProperty="junit.failed"
555 <        failureProperty="junit.failed"
556 <                    dir="${build.reports.dir}"
557 <                   fork="true">
757 >    <delete dir="${build.jsr166x.dir}"/>
758  
759 <      <jvmarg value="-Xbootclasspath:${test.run.bootclasspath}"/>
759 >  </target>
760  
561      <formatter type="xml"/>
761  
762 <      <batchtest todir="${build.reports.dir}">
763 <        <fileset dir="${test.src.dir}">
764 <          <include name="java/**/${testcase}Test.java"/>
765 <          <include name="jsr166/**/${testcase}Test.java"/>
567 <        </fileset>
568 <      </batchtest>
762 >  <target name="jsr166xdist-clean"
763 >          description="Removes all build and distribution products">
764 >
765 >  </target>
766  
767 <    </junit>
767 >
768 >  <target name="jsr166xdist-jar"
769 >          depends="jsr166xclean, jsr166x-jar">
770 >
771 >    <copy file="${jsr166x.jar}" todir="${dist.dir}"/>
772  
773    </target>
774  
775 +  <!-- jsr166y -->
776  
575  <target name="report-tests"
576          depends="run-tests">
777  
778 <    <!-- Sets junit.report.format to frames if redirection is present,
779 <         otherwise sets it to noframes. -->
780 <    <available property="junit.report.format"
581 <                  value="frames"
582 <              classname="org.apache.xalan.lib.Redirect"
583 <    />
584 <    <property name="junit.report.format" value="noframes"/>
778 >  <target name="jsr166ycompile"
779 >          depends="configure-compiler"
780 >          description="Compiles jsr166y sources">
781  
782 <    <junitreport todir="${build.reports.dir}">
587 <      <fileset dir="${build.reports.dir}">
588 <        <include name="TEST-*.xml"/>
589 <      </fileset>
590 <      <report styledir="${stylesheet.dir}"
591 <                format="${junit.report.format}"
592 <                 todir="${build.reports.dir}"
593 <      />
594 <    </junitreport>
782 >    <mkdir dir="${build.jsr166y.classes.dir}"/>
783  
784 <    <fail message="Test Cases Failed" if="junit.failed"/>
784 >    <javac srcdir="${topsrc.dir}"
785 >           destdir="${build.jsr166y.classes.dir}"
786 >           debug="${build.debug}"
787 >           debuglevel="${build.debuglevel}"
788 >           deprecation="${build.deprecation}"
789 >           source="6"
790 >           classpath=""
791 >           bootclasspath="${bootclasspath6}"
792 >           includeAntRuntime="false"
793 >           includeJavaRuntime="false"
794 >           executable="${javac7}"
795 >           fork="true">
796 >
797 >      <include name="jsr166y/**/*.java"/>
798 >      <compilerarg value="-XDignore.symbol.file=true"/>
799 >      <compilerarg value="-Xlint:all"/>
800 >      <compilerarg line="${build.args}"/>
801  
802 +    </javac>
803    </target>
804  
805  
806 <  <target name="configure-compiler">
806 >  <target name="jsr166y-jar"
807 >          depends="jsr166ycompile"
808 >          description="Builds library jar from compiled sources">
809  
810 <    <property name="gjc.version"
811 <             value="2.2"/>
810 >    <jar destfile="${jsr166y.jar}" index="true">
811 >      <fileset dir="${build.jsr166y.classes.dir}"/>
812 >    </jar>
813  
814 <    <condition property="novariance.arg" value="-novariance">
607 <      <and>
608 <        <equals arg1="${gjc.version}" arg2="2.0"/>
609 <        <or>
610 <          <not><isset property="gjc.novariance"/></not>
611 <          <istrue value="${gjc.novariance}"/>
612 <        </or>
613 <      </and>
614 <    </condition>
814 >  </target>
815  
616    <property name="novariance.arg"
617             value=""/>
816  
817 <    <property name="gjc.dir"
818 <             value="${lib.dir}/gjc"/>
817 >  <target name="jsr166ydocs"
818 >          description="Builds javadocs to dist dir">
819  
820 <    <property name="javac.jar"
821 <          location="${gjc.dir}/${gjc.version}/javac.jar"/>
820 >    <delete dir="${dist.jsr166yjavadocs.dir}"/>
821 >    <mkdir dir="${dist.jsr166yjavadocs.dir}"/>
822  
823 <    <property name="collect.jar"
824 <          location="${gjc.dir}/${gjc.version}/collect${novariance.arg}.jar"/>
823 >    <javadoc destdir="${dist.jsr166yjavadocs.dir}"
824 >             packagenames="jsr166y.*"
825 >             link="${jdkapidocs.url}"
826 >             sourcepath="${topsrc.dir}:${jdk6src.dir}"
827 >             bootclasspath="${bootclasspath6}"
828 >             source="6"
829 >             executable="${javadoc7}">
830 >      <arg value="-XDignore.symbol.file=true"/>
831  
832 < <!--
833 <    <property name="unchecked.option" value="-warnunchecked"/>
630 < -->
832 >    </javadoc>
833 >  </target>
834  
632    <property name="unchecked.option" value="-Xlint:unchecked"/>
835  
836 <    <condition property="warnunchecked.arg" value="${unchecked.option}">
837 <      <istrue value="${gjc.warnunchecked}"/>
838 <    </condition>
836 >  <target name="jsr166ydist"
837 >          depends="jsr166ydist-clean, jsr166ydist-jar, jsr166ydocs"
838 >          description="Puts all distributable products in single hierarchy"/>
839  
638    <property name="warnunchecked.arg" value=""/>
639    
640    <condition property="prepare.src.dir" value="${build.dir}/prepare-src">
641      <istrue value="${build.nothreads}"/>
642    </condition>
840  
841 +  <target name="jsr166yclean"
842 +          description="Removes all jsr166y build products">
843  
844 <    <!--
646 <     ! Bootclasspath munging for source compilation.
647 <     -->
844 >    <delete dir="${build.jsr166y.dir}"/>
845  
846 <    <path id="pre.bootclasspath">
650 < <!--
651 <      <pathelement location="${javac.jar}"/>
652 < -->
653 <    </path>
846 >  </target>
847  
655    <path id="compile.bootclasspath">
656      <pathelement location="${build.classes.dir}"/>
657 <!--      
658      <pathelement location="${collect.jar}"/>
659 -->
660      <pathelement location="${rt.jar}"/>
661    </path>
848  
849 <    <!-- Flatten paths into platform-appropriate strings -->
850 <    <property name="pre.bootclasspath"     refid="pre.bootclasspath"/>
665 <    <property name="compile.bootclasspath" refid="compile.bootclasspath"/>
849 >  <target name="jsr166ydist-clean"
850 >          description="Removes all build and distribution products">
851  
852 +  </target>
853  
854 <    <!-- Common options in javac invocations -->
855 < <!--
856 <    <property name="gjc.args"
857 <             value="-J-Xbootclasspath/p:${pre.bootclasspath} ${warnunchecked.arg} ${novariance.arg}"
672 <    />
673 < -->
674 <    <property name="gjc.args" value="${warnunchecked.arg} ${novariance.arg}"/>
854 >  <target name="jsr166ydist-jar"
855 >          depends="jsr166yclean, jsr166y-jar">
856 >
857 >    <copy file="${jsr166y.jar}" todir="${dist.dir}"/>
858  
859    </target>
860  
861  
862 <  <target name="prepare-src"
680 <          depends="configure-compiler"
681 <          if="prepare.src.dir">
862 >  <!-- extra166y -->
863  
683    <mkdir dir="${prepare.src.dir}"/>
684    <copy todir="${prepare.src.dir}">
685      <fileset dir="${src.dir}">
686        <exclude name="java/lang/**"/>
687      </fileset>
688    </copy>
864  
865 +  <target name="extra166ycompile"
866 +          depends="configure-compiler, jsr166y-jar"
867 +          description="Compiles extra166y sources">
868 +
869 +    <mkdir dir="${build.extra166y.classes.dir}"/>
870 +
871 +    <javac srcdir="${topsrc.dir}"
872 +           destdir="${build.extra166y.classes.dir}"
873 +           debug="${build.debug}"
874 +           debuglevel="${build.debuglevel}"
875 +           deprecation="${build.deprecation}"
876 +           bootclasspath="@{jsr166y.jar}:${bootclasspath6}"
877 +           classpath=""
878 +           source="6"
879 +           includeAntRuntime="false"
880 +           includeJavaRuntime="false"
881 +           executable="${javac7}"
882 +           fork="true">
883 +
884 +      <include name="extra166y/**/*.java"/>
885 +      <compilerarg value="-XDignore.symbol.file=true"/>
886 +      <compilerarg value="-Xlint:all,-unchecked,-rawtypes,-serial"/>
887 +      <compilerarg line="${build.args}"/>
888 +
889 +    </javac>
890    </target>
891  
892  
893 <  <target name="configure-emulation">
893 >  <target name="extra166y-jar"
894 >          depends="extra166ycompile"
895 >          description="Builds library jar from compiled sources">
896  
897 <    <condition property="build.emulation.true">
898 <      <istrue value="${build.emulation}"/>
899 <    </condition>
897 >    <jar destfile="${extra166y.jar}" index="true">
898 >      <fileset dir="${build.extra166y.classes.dir}"/>
899 >    </jar>
900  
901    </target>
902  
903  
904 <  <target name="configure-tests"
905 <       depends="configure-compiler">
904 >  <target name="extra166ydocs"
905 >          description="Builds javadocs to build dir">
906  
907 <    <!-- junit.framework.Protectable is in JUnit 3.8.1 but not in 3.7 -->
908 <    <available property="junit.available"
707 <               classname="junit.framework.Protectable"/>
907 >    <delete dir="${dist.extra166yjavadocs.dir}"/>
908 >    <mkdir dir="${dist.extra166yjavadocs.dir}"/>
909  
910 <    <fail message="Need JUnit 3.8.1 in ${ant.home}${file.separator}lib to run tests"
911 <          unless="junit.available"/>
910 >    <javadoc destdir="${dist.extra166yjavadocs.dir}"
911 >             packagenames="extra166y.*"
912 >             link="${jdkapidocs.url}"
913 >             sourcepath="${topsrc.dir}:${jdk6src.dir}"
914 >             bootclasspath="${bootclasspath6}"
915 >             source="6"
916 >             executable="${javadoc7}">
917 >      <arg value="-XDignore.symbol.file=true"/>
918  
919 <    <!-- Xalan -->
920 <    <available property="xalan.available"
714 <               classname="org.apache.xalan.Version"/>
919 >    </javadoc>
920 >  </target>
921  
922 <    <fail message="Need Xalan 2.5.1 jar in ${ant.home}${file.separator}lib to run tests"
923 <          unless="xalan.available"/>
922 >
923 >  <target name="extra166ydist"
924 >          depends="extra166ydist-clean, extra166ydist-jar, extra166ydocs"
925 >          description="Puts all distributable products in single hierarchy"/>
926  
927  
928 <    <!--
929 <     ! Bootclasspath munging for testing, so JUnit can test our local
722 <     ! modifications to java.*.
723 <     -->
724 <
725 <    <path id="test.classpath">
726 <      <pathelement location="${product.jar}"/>
727 <      <pathelement location="${rt.jar}"/>
728 <      <pathelement location="${build.testcases.dir}"/>
729 <      <pathelement location="${junit.jar}"/>
730 <    </path>
928 >  <target name="extra166yclean"
929 >          description="Removes all extra166y build products">
930  
931 <    <path id="test.compile.bootclasspath">
733 <      <pathelement location="${javac.jar}"/>
734 <      <pathelement location="${collect.jar}"/>
735 <      <pathelement location="${rt.jar}"/>
736 <    </path>
931 >    <delete dir="${build.extra166y.dir}"/>
932  
933 <    <path id="test.run.bootclasspath">
934 < <!--    
935 <      <pathelement location="${javac.jar}"/>
936 < -->      
937 <      <path refid="test.classpath"/>
938 <    </path>
933 >  </target>
934 >
935 >
936 >  <target name="extra166ydist-clean"
937 >          description="Removes all build and distribution products">
938 >
939 >  </target>
940  
941 <    <!-- Flatten test classpaths into platform-appropriate strings -->
942 <    <property name="test.classpath"             refid="test.classpath"/>
943 <    <property name="test.compile.bootclasspath" refid="test.compile.bootclasspath"/>
944 <    <property name="test.run.bootclasspath"     refid="test.run.bootclasspath"/>
941 >  <target name="extra166ydist-jar"
942 >          depends="extra166yclean, extra166y-jar">
943 >
944 >    <copy file="${extra166y.jar}" todir="${dist.dir}"/>
945  
946    </target>
947  
948 +  <!-- jsr166e -->
949 +
950 +  <target name="jsr166ecompile"
951 +          depends="configure-compiler"
952 +          description="Compiles jsr166e sources">
953  
954 +    <mkdir dir="${build.jsr166e.classes.dir}"/>
955  
956 <  <!-- Anthill targets -->
956 >    <javac srcdir="${topsrc.dir}"
957 >           destdir="${build.jsr166e.classes.dir}"
958 >           debug="${build.debug}"
959 >           debuglevel="${build.debuglevel}"
960 >           deprecation="${build.deprecation}"
961 >           source="7"
962 >           classpath=""
963 >           includeAntRuntime="false"
964 >           includeJavaRuntime="false"
965 >           executable="${javac7}"
966 >           fork="true">
967 >
968 >      <include name="jsr166e/**/*.java"/>
969 >      <compilerarg value="-XDignore.symbol.file=true"/>
970 >      <compilerarg value="-Xlint:all"/>
971 >      <compilerarg line="${build.args}"/>
972  
973 <  <target name="anthill-build">
757 <  
758 <    <!-- Override this in user.properties -->
759 <    <property name="tiger.home" location="e:/j2sdk1.5.0"/>
760 <    
761 <    <exec resultproperty="result.property" dir="${basedir}" executable="${tiger.home}/bin/java">
762 <      <arg value="-Xmx256000000"/>
763 <      <!-- classpath of new JVM -->
764 <      <arg value="-classpath"/> <arg path="${java.class.path}"/>
765 <      <!-- location of Ant home directory -->
766 <      <arg value="-Dant.home=${ant.home}"/>
767 <      <!-- the Ant main class -->
768 <      <arg value="org.apache.tools.ant.Main"/>
769 <      <!-- The build file -->
770 <      <arg value="-buildfile"/>  <arg value="build.xml"/>
771 <      <!-- the target to build on the new Ant instance -->
772 <      <arg value="-DJAVA_HOME=${tiger.home}"/>
773 <      <arg value="do-anthill-build"/>
774 <    </exec>
973 >    </javac>
974    </target>
776  
777  <target name="do-anthill-build"
778          depends="jar, test, docs, dist-docs"/>
975  
780  <target name="anthill-publish">
976  
977 <    <copy todir="${deployDir}/docs/private">
978 <      <fileset dir="${build.javadocs.dir}"/>
979 <    </copy>
977 >  <target name="jsr166e-jar"
978 >          depends="jsr166ecompile"
979 >          description="Builds library jar from compiled sources">
980  
981 <    <copy todir="${deployDir}/docs/public">
982 <      <fileset dir="${dist.javadocs.dir}"/>
983 <    </copy>
981 >    <jar destfile="${jsr166e.jar}" index="true">
982 >      <fileset dir="${build.jsr166e.classes.dir}"/>
983 >    </jar>
984  
985 <    <copy tofile="${deployDir}/index.html"
791 <          file="${basedir}/etc/anthill-index.html"/>
985 >  </target>
986  
793    <copy todir="${deployDir}/notes">
794      <fileset dir="${basedir}/etc/notes"/>
795    </copy>
987  
988 +  <target name="jsr166edocs"
989 +          description="Builds javadocs to build dir">
990 +
991 +    <delete dir="${dist.jsr166ejavadocs.dir}"/>
992 +    <mkdir dir="${dist.jsr166ejavadocs.dir}"/>
993 +
994 +    <javadoc destdir="${dist.jsr166ejavadocs.dir}"
995 +             packagenames="jsr166e.*"
996 +             link="${jdkapidocs.url}"
997 +             sourcepath="${topsrc.dir}:${jdk7src.dir}"
998 +             source="7"
999 +             executable="${javadoc7}">
1000 +      <arg value="-XDignore.symbol.file=true"/>
1001 +
1002 +    </javadoc>
1003    </target>
1004  
1005  
1006 <  <target name="ng" depends="test">
1007 <    <java classname="SuperfluousAbstract" fork="true">
1006 >  <target name="jsr166edist"
1007 >          depends="jsr166edist-clean, jsr166edist-jar, jsr166edocs"
1008 >          description="Puts all distributable products in single hierarchy"/>
1009 >
1010  
1011 <      <jvmarg value="-Xbootclasspath/p:${test.run.bootclasspath}"/>
1011 >  <target name="jsr166eclean"
1012 >          description="Removes all jsr166e build products">
1013 >
1014 >    <delete dir="${build.jsr166e.dir}"/>
1015  
805    </java>
1016    </target>
1017  
1018  
1019 +  <target name="jsr166edist-clean"
1020 +          description="Removes all build and distribution products">
1021 +
1022 +  </target>
1023 +
1024 +  <target name="jsr166edist-jar"
1025 +          depends="jsr166eclean, jsr166e-jar">
1026 +
1027 +    <copy file="${jsr166e.jar}" todir="${dist.dir}"/>
1028 +
1029 +  </target>
1030 +
1031   </project>

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines