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.51 by tim, Thu Aug 7 03:49:48 2003 UTC vs.
Revision 1.73 by dl, Tue Nov 8 00:13:41 2005 UTC

# Line 22 | Line 22
22  
23    <!-- Compilation options -->
24    <property name="build.sourcelevel"    value="1.5"/>
25  <property name="build.docsourcelevel" value="1.4"/>
25    <property name="build.debug"          value="true"/>
26    <property name="build.debuglevel"     value="source,lines,vars"/>
27    <property name="build.deprecation"    value="false"/>
# Line 30 | Line 29
29    <!-- Build locations -->
30    <property name="build.dir"            location="build"/>
31    <property name="build.classes.dir"    location="${build.dir}/classes"/>
33  <property name="build.emulation.dir"  location="${build.dir}/emulation"/>
32    <property name="build.testcases.dir"  location="${build.dir}/testcases"/>
33 +  <property name="build.j1.dir"         location="${build.dir}/j1"/>
34 +  <property name="build.loops.dir"      location="${build.dir}/loops"/>
35    <property name="build.lib.dir"        location="${build.dir}/lib"/>
36    <property name="build.ant.dir"        location="${build.dir}/ant"/>
37    <property name="build.javadocs.dir"   location="${build.dir}/javadocs"/>
38  <property name="build.stripped.dir"   location="${build.dir}/stripped"/>
38    <property name="build.reports.dir"    location="${build.dir}/reports"/>
39 +  <property name="build.checkstyle.dir" location="${build.dir}/checkstyle"/>
40    <property name="build.doccheck.dir"   location="${build.dir}/doccheck"/>
41    <property name="build.filter.src.dir" location="${build.dir}/filtersrc"/>
42 <  <property name="build.filter.doccheck.dir" location="${build.dir}/filterdocchk"/>
42 >  <property name="build.dc-filter.dir"  location="${build.dir}/filterdocchk"/>
43 >  <property name="build.jsr166x.dir"    location="${build.dir}/jsr166x"/>
44 >  <property name="build.jsr166xlib.dir"        location="${build.dir}/jsr166xlib"/>
45 >  <property name="build.jsr166xjavadocs.dir"   location="${build.dir}/jsr166xjavadocs"/>
46  
47    <!-- Source locations -->
48    <property name="src.dir"              location="${basedir}/src/main"/>
46  <property name="emulation.src.dir"    location="${basedir}/src/emulation"/>
49    <property name="test.src.dir"         location="${basedir}/src/test"/>
50 +  <property name="j1.src.dir"           location="${basedir}/src/javaone"/>
51 +  <property name="loops.src.dir"        location="${basedir}/src/loops"/>
52 +  <property name="tck.src.dir"          location="${test.src.dir}/tck"/>
53 +  <property name="jtreg.src.dir"        location="${test.src.dir}/jtreg"/>
54    <property name="ant.src.dir"          location="${basedir}/etc/ant"/>
55    <property name="stylesheet.dir"       location="${basedir}/etc/xsl"/>
56    <property name="lib.dir"              location="${basedir}/lib"/>
57    <property name="dist.dir"             location="${basedir}/dist"/>
58 +  <property name="topsrc.dir"           location="${basedir}/src"/>
59 +  <property name="jsr166xsrc.dir"       location="${basedir}/src/jsr166x"/>
60  
61    <!-- Distribution locations -->
62    <property name="dist.javadocs.dir"    location="${dist.dir}/docs"/>
63 +  <property name="dist.jsr166xjavadocs.dir"    location="${dist.dir}/jsr166xdocs"/>
64  
65    <!-- Jar locations -->
66    <property name="product.jar"          location="${build.lib.dir}/jsr166.jar"/>
67 +  <property name="jsr166xproduct.jar"   location="${build.jsr166xlib.dir}/jsr166x.jar"/>
68    <property name="junit.jar"            location="${lib.dir}/junit.jar"/>
69 <  <property name="rt.jar"               location="${java.home}/lib/rt.jar"/>
60 <  <property name="sinjdoc.jar"          location="${lib.dir}/sinjdoc.jar"/>
69 >  <property name="concurrent.jar"       location="${lib.dir}/concurrent.jar"/>
70  
71 +  <!-- Bootclasspath argument -->
72 +  <property name="bootclasspath.args"   value="-Xbootclasspath/p:${product.jar}"/>
73  
74 <  <!-- Files excluded from dist-docs and emulation jar -->
75 <  <patternset id="unsafe.exclusion">
76 <    <exclude name="java/util/Random.*"/>
77 <    <exclude name="sun/misc/Unsafe.*"/>
78 <  </patternset>
79 <
80 <  <!-- Files excludes from emulation jar -->
81 <  <patternset id="atomic.exclusion">
82 <    <exclude name="java/util/concurrent/atomic/AtomicBoolean*"/>
83 <    <exclude name="java/util/concurrent/atomic/AtomicInteger*"/>
84 <    <exclude name="java/util/concurrent/atomic/AtomicLong*"/>
85 <    <exclude name="java/util/concurrent/atomic/AtomicReference*"/>
86 <    <exclude name="java/util/concurrent/locks/LockSupport*"/>
87 <    <exclude name="java/util/concurrent/locks/ReentrantLock*"/>
88 <  </patternset>
89 <
74 >  <!-- Test classpath -->
75 >  <path id="test.classpath">
76 >    <pathelement location="${build.testcases.dir}"/>
77 >    <pathelement location="${junit.jar}"/>
78 >  </path>
79 >
80 >  <!-- ALoops classpath -->
81 >  <path id="loops.classpath">
82 >    <pathelement location="${build.loops.dir}"/>
83 >  </path>
84 >
85 >  <!-- J1 classpath -->
86 >  <path id="j1.classpath">
87 >    <pathelement location="${build.classes.dir}"/>
88 >    <pathelement location="${build.j1.dir}"/>
89 >    <pathelement location="${junit.jar}"/>
90 >
91 >    <!-- Include dl.u.c for BoundedBuffer comparison -->
92 >    <pathelement location="${concurrent.jar}"/>
93 >  </path>
94  
95  
96    <!-- Main targets -->
97  
98 +
99    <target name="compile"
100 <          depends="init, configure-compiler, prepare-src"
100 >          depends="init, configure-compiler"
101            description="Compiles main sources to build folder">
102  
87    <property name="prepare.src.dir" value="${src.dir}"/>
88
103      <mkdir dir="${build.classes.dir}"/>
104  
105 < <!--
92 <    <echo>javac ${gjc.args}</echo>
93 <    <echo>bootclasspath=${compile.bootclasspath}</echo>
94 < -->
95 <
96 <    <javac srcdir="${prepare.src.dir}"
105 >    <javac srcdir="${src.dir}"
106            destdir="${build.classes.dir}"
107              debug="${build.debug}"
108         debuglevel="${build.debuglevel}"
# Line 101 | Line 110
110             source="${build.sourcelevel}"
111               fork="true">
112  
113 <      <compilerarg    line="${gjc.args}"/>
114 <      <bootclasspath refid="compile.bootclasspath"/>
113 >      <include name="**/*.java"/>
114 > <!--
115 >      <exclude name="java/lang/**"/>
116 >      <compilerarg line="${build.args}"/>
117 >      <compilerarg line="-Xlint -Xmaxwarns 1000"/>
118 > -->
119  
120      </javac>
121  
122    </target>
123  
124  
112  <target name="jar"
113          depends="configure-emulation, init-jar, native-jar, emulation-jar"
114          description="Builds library jar from compiled sources"/>
115
116
117  <target name="test"
118          depends="init, configure-tests, report-tests"
119          description="Runs all tests (requires JUnit 3.8.1 in ${ant.home}/lib)" />
120
125  
126 <  <target name="checkstyle"
127 <          depends="filter-src"
128 <          description="Reports on style errors in Java source (verbose, mostly chaff)">
126 >  <target name="jar"
127 >          depends="compile"
128 >          description="Builds library jar from compiled sources">
129  
130 <    <taskdef resource="checkstyletask.properties"
127 <            classpath="${lib.dir}/checkstyle-all-2.4.jar"/>
130 >    <mkdir dir="${build.lib.dir}"/>
131  
132 <    <checkstyle>
133 <      <formatter type="plain"/>  <!-- also available: type="xml" -->
134 <      <fileset dir="${build.filter.src.dir}" includes="**/*.java"/>
132 <    </checkstyle>
132 >    <jar destfile="${product.jar}">
133 >      <fileset dir="${build.classes.dir}"/>
134 >    </jar>
135  
136    </target>
137  
138  
137  <target name="doccheck"
138          depends="filter-doccheck"
139          description="Reports on javadoc style errors">
140
141    <delete dir="${build.doccheck.dir}"/>
142    <mkdir dir="${build.doccheck.dir}"/>
143
144    <javadoc doclet="com.sun.tools.doclets.doccheck.DocCheck"
145         docletpath="${lib.dir}/doccheck.jar"
146            destdir="${build.doccheck.dir}">
147      <packageset dir="${build.filter.doccheck.dir}"/>
148    </javadoc>
139  
140 <    <echo>DocCheck output is in ${build.doccheck.dir}</echo>
140 >  <target name="test"
141 >          depends="init, configure-tests, report-tests"
142 >          description="Runs all tests (requires JUnit 3.8.1 in ${ant.home}/lib)" />
143  
152  </target>
144  
145  
146    <target name="docs"
156          depends="filter-src"
147            description="Builds javadocs with custom tags to build folder">
148  
149      <delete dir="${build.javadocs.dir}"/>
150      <mkdir dir="${build.javadocs.dir}"/>
151  
152      <javadoc destdir="${build.javadocs.dir}"
153 <                link="http://java.sun.com/j2se/1.4.1/docs/api"
153 >                link="http://java.sun.com/j2se/1.5.0/docs/api"
154              overview="${src.dir}/intro.html"
155 <              source="${build.docsourcelevel}">
155 >            sourcepath="${src.dir}:/home/dl/1.6.0/j2se/martin/j2se/src/share/classes"
156 >    >          
157  
158 <      <tag name="revised" description="Last revised:"/>
168 <      <tag name="spec"    description="Specified by:"/>
169 <      <tag name="editor"  description="Last edited by:"/>
170 <      <tag name="fixme"   description="FIX ME:"/>
171 <
172 <      <packageset dir="${build.filter.src.dir}"/>
158 >      <packageset dir="${src.dir}"/>
159  
160      </javadoc>
161  
162    </target>
163  
164  
179  <target name="sinjdocs"
180          depends="configure-tests"
181          description="Builds javadocs with custom tags to build folder">
182
183    <delete dir="${build.javadocs.dir}"/>
184    <mkdir dir="${build.javadocs.dir}"/>
185
186    <java classname="net.cscott.sinjdoc.Main" fork="true">
165  
166 <      <jvmarg value="-Xbootclasspath/p:${test.run.bootclasspath}"/>
166 >  <target name="doccheck"
167 >          depends="filter-doccheck"
168 >          description="Reports on javadoc style errors">
169  
170 <      <classpath>
171 <        <pathelement location="${sinjdoc.jar}"/>
192 <        <pathelement location="${lib.dir}/jutil.jar"/>
193 <        <pathelement location="${lib.dir}/cup.jar"/>
194 <        <path refid="test.classpath"/>
195 <      </classpath>
196 <
197 <
198 <      <arg value="-d"/>          <arg value="${build.javadocs.dir}"/>
199 <      <arg value="-sourcepath"/> <arg value="${src.dir}"/>
200 <      <arg value="-overview"/>   <arg value="${src.dir}/intro.html"/>
201 <      <arg value="-source"/>     <arg value="${build.sourcelevel}"/>
202 <      <!-- <arg value="-verbose"/> -->
203 <      <!-- <arg value="-link"/>  <arg value="http://java.sun.com/j2se/1.4.1/docs/api"/> -->
204 <      <arg value="java.lang"/>
205 <      <arg value="java.util"/>
206 <      <arg value="java.util.concurrent"/>
207 <      <arg value="java.util.concurrent.atomic"/>
208 <      <arg value="java.util.concurrent.locks"/>
170 >    <delete dir="${build.doccheck.dir}"/>
171 >    <mkdir dir="${build.doccheck.dir}"/>
172  
173 <      <!--
174 <      <arg value="-help"/>
175 <      -->
173 >    <javadoc doclet="com.sun.tools.doclets.doccheck.DocCheck"
174 >         docletpath="${lib.dir}/doccheck.jar"
175 >            destdir="${build.doccheck.dir}">
176 >      <packageset dir="${build.dc-filter.dir}"/>
177 >    </javadoc>
178  
179 <    </java>
179 >    <echo>DocCheck output is in ${build.doccheck.dir}</echo>
180  
181    </target>
182  
183  
219  <target name="strip"
220          depends="init, configure-compiler"
221          description="Strip generics from java source (not working yet)">
184  
185 <    <mkdir dir="${build.stripped.dir}"/>
185 >  <target name="checkstyle"
186 >          depends="filter-src"
187 >          description="Reports on style errors in Java source (verbose, mostly chaff)">
188  
189 <    <!--
190 <     # javac -s doesn't reliably generate compilable code. It generates
227 <     # bridge methods (marked as "synthetic") that can have identical
228 <     # signatures to existing methods except for the return value.
229 <     -->
230 <    <javac srcdir="${src.dir}"
231 <          destdir="${build.stripped.dir}"
232 <            debug="${build.debug}"
233 <       debuglevel="${build.debuglevel}"
234 <      deprecation="${build.deprecation}"
235 <           source="${build.sourcelevel}"
236 <             fork="true">
189 >    <taskdef resource="checkstyletask.properties"
190 >            classpath="${lib.dir}/checkstyle-all-3.1.jar"/>
191  
192 <      <compilerarg    line="${gjc.args} -s"/>
239 <      <bootclasspath refid="compile.bootclasspath"/>
192 >    <mkdir dir="${build.checkstyle.dir}"/>
193  
194 <    </javac>
194 >    <checkstyle config="etc/checkstyle/sun_checks.xml"
195 >       failOnViolation="false">
196 >      <formatter type="xml" toFile="${build.checkstyle.dir}/checkstyle-report.xml"/>
197 >      <fileset dir="${build.filter.src.dir}" includes="**/*.java"/>
198 >    </checkstyle>
199 >
200 >    <style in="${build.checkstyle.dir}/checkstyle-report.xml"
201 >          out="${build.checkstyle.dir}/checkstyle-report.html"
202 >        style="${stylesheet.dir}/checkstyle-frames.xsl"/>
203  
204    </target>
205  
206  
207 +
208    <target name="dist"
209            depends="init, dist-clean, dist-jar, dist-docs"
210            description="Puts all distributable products in single hierarchy"/>
211  
212 +
213 +
214    <target name="release"
215            depends="dist"
216            description="Puts entire CVS tree, plus distribution productions, in a jar">
217  
254 <!--
255    #keep build dir? - dl
256    <delete dir="${build.dir}"/>
257 -->
218      <property name="release.jar" value="dist/jsr166-${version}-dist.jar"/>
219  
220      <jar basedir="${basedir}" destfile="${release.jar}">
221 +      <!-- <exclude name="build/**"/> -->
222        <exclude name="${release.jar}"/>
223        <exclude name="user.properties"/>
224        <exclude name="etc/notes/**"/>
225 <      <exclude name="lib/gjc/2.1/**"/>
225 >      <exclude name="src/emulation/**"/>
226        <exclude name="**/SyntaxTest.java"/>
227 +      <exclude name="**/SuperfluousAbstract.java"/>
228      </jar>
229  
230    </target>
231  
232 +
233 +
234    <target name="clean"
235            description="Removes all build products">
236  
# Line 277 | Line 241
241    </target>
242  
243  
244 +
245    <target name="dist-clean"
246            description="Removes all build and distribution products">
247  
# Line 285 | Line 250
250    </target>
251  
252  
253 +
254    <target name="dist-docs"
289          depends="filter-src"
255            description="Builds javadocs without custom tags to dist folder">
256  
257      <delete dir="${dist.javadocs.dir}"/>
258      <mkdir dir="${dist.javadocs.dir}"/>
259  
260      <javadoc destdir="${dist.javadocs.dir}"
261 <                link="http://java.sun.com/j2se/1.4.1/docs/api"
261 >              link="http://java.sun.com/j2se/1.5.0/docs/api"
262              overview="${src.dir}/intro.html"
298              source="${build.docsourcelevel}">
299
300      <packageset dir="${build.filter.src.dir}"/>
263  
264 +            sourcepath="${src.dir}:/home/dl/1.6.0/j2se/martin/j2se/src/share/classes"
265 +     >
266 +      <packageset dir="${src.dir}" defaultexcludes="yes">
267 +      <include name="java/util/concurrent"/>
268 +      <include name="java/util/concurrent/atomic"/>
269 +      <include name="java/util/concurrent/locks"/>
270 +      </packageset>
271 +      <fileset dir="${topsrc.dir}" defaultexcludes="yes">
272 +      <include name="main/java/util/*.java"/>
273 +      <include name="main/java/util/*.html"/>
274 + <!--      <include name="jsr166x/*.java"/> -->
275 +      </fileset>
276      </javadoc>
277  
278    </target>
# Line 313 | Line 287
287      <!-- Version is kept in a separate file -->
288      <loadfile property="version" srcFile="version.properties"/>
289      <echo>Building JSR-166 version ${version}</echo>
290 <
317 <  </target>
318 <
319 <
320 <  <target name="init-jar">
321 <
322 <    <mkdir dir="${build.lib.dir}"/>
323 <
324 <  </target>
325 <
326 <
327 <  <target name="native-jar"
328 <          depends="compile"
329 <          unless="build.emulation.true">
330 <
331 <    <jar destfile="${product.jar}">
332 <      <fileset dir="${build.classes.dir}"/>
333 <    </jar>
334 <
335 <  </target>
336 <
337 <
338 <  <target name="compile-emulation"
339 <          depends="init, configure-compiler"
340 <          if="build.emulation.true">
341 <
342 <    <mkdir dir="${build.emulation.dir}"/>
343 <
344 <    <javac srcdir="${emulation.src.dir}"
345 <          destdir="${build.emulation.dir}"
346 <            debug="${build.debug}"
347 <       debuglevel="${build.debuglevel}"
348 <      deprecation="${build.deprecation}"
349 <           source="${build.sourcelevel}"
350 <             fork="true">
351 <
352 <      <compilerarg    line="${gjc.args}"/>
353 <      <bootclasspath refid="compile.bootclasspath"/>
354 <
355 <    </javac>
356 <
357 <  </target>
358 <
359 <
360 <  <target name="emulation-jar"
361 <          depends="compile-emulation"
362 <          if="build.emulation.true">
363 <
364 <
365 <    <jar destfile="${product.jar}" duplicate="add">
366 <      <fileset dir="${build.classes.dir}">
367 <        <patternset refid="atomic.exclusion"/>
368 <        <patternset refid="unsafe.exclusion"/>
369 <      </fileset>
370 <      <fileset dir="${build.emulation.dir}"/>
371 <    </jar>
290 >    <echo>java.home is ${java.home}</echo>
291  
292    </target>
293  
# Line 388 | Line 307
307  
308      <javac srcdir="${ant.src.dir}"
309            destdir="${build.ant.dir}"
310 <           source="1.4"
392 <    />
310 >           source="1.4"/>
311  
312    </target>
313  
# Line 408 | Line 326
326      <copy todir="${build.filter.src.dir}">
327        <fileset dir="${src.dir}">
328          <exclude name="**/*.html"/>
329 <        <patternset refid="unsafe.exclusion"/>
329 >        <!-- Files excluded from dist-docs -->
330 >        <exclude name="java/util/Random.*"/>
331 >        <exclude name="sun/misc/Unsafe.*"/>
332        </fileset>
333 +      <!--
334        <filterchain>
335 +      -->
336  
337          <!--
338           # This filter gets rid of angle-bracketed type parameters
# Line 424 | Line 346
346           #   tweaking.)
347           -->
348  
349 +        <!--
350          <filterreader classname="jsr166.ant.filters.ReplaceFilter"
351                        classpath="${build.ant.dir}">
352            <param name="notmatching" value="^\s+\*\s.*$"/>
353            <param name="pattern"     value="&lt;[^|>()]+?>+"/>
354            <param name="replacement" value=" "/>
355          </filterreader>
356 +        -->
357  
358 <
435 <        <!--
436 <         # This filter uncomments lines beginning with "//@" so that
437 <         # javadoc can see imports that are needed to resolve links
438 <         # but that shouldn't be in the compiled code.
439 <         -->
440 <
441 <        <filterreader classname="jsr166.ant.filters.ReplaceFilter"
442 <                      classpath="${build.ant.dir}">
443 <          <param name="matching"    value="^//@.*$"/>
444 <          <param name="pattern"     value="^//@"/>
445 <          <param name="replacement" value=""/>
446 <        </filterreader>
358 >      <!--
359        </filterchain>
360 +      -->
361      </copy>
362  
363    </target>
364  
365  
453
454
366    <target name="filter-doccheck"
367            depends="filter-src">
368  
369 <    <mkdir dir="${build.filter.doccheck.dir}"/>
369 >    <mkdir dir="${build.dc-filter.dir}"/>
370  
371 <    <copy todir="${build.filter.doccheck.dir}">
371 >    <copy todir="${build.dc-filter.dir}">
372        <fileset dir="${build.filter.src.dir}">
373          <include name="**/*.html"/>
374        </fileset>
# Line 467 | Line 378
378               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 {}"
379      />
380  
381 <    <copy todir="${build.filter.doccheck.dir}">
381 >    <copy todir="${build.dc-filter.dir}">
382        <fileset dir="${build.filter.src.dir}">
383          <exclude name="**/*.html"/>
384        </fileset>
# Line 505 | Line 416
416  
417      <mkdir dir="${build.testcases.dir}"/>
418  
419 < <!--
420 <    <echo>javac ${gjc.args}</echo>
421 <    <echo>bootclasspath=${test.compile.bootclasspath}</echo>
422 <    <echo>classpath="${test.classpath}"</echo>
423 < -->
419 >    <javac srcdir="${tck.src.dir}"
420 >          destdir="${build.testcases.dir}"
421 >            debug="${build.debug}"
422 >       debuglevel="${build.debuglevel}"
423 >      deprecation="${build.deprecation}"
424 >           source="${build.sourcelevel}"
425 >             fork="true">
426 >
427 >      <compilerarg value="${bootclasspath.args}"/>
428 >      <compilerarg line="${build.args}"/>
429 >
430 >      <classpath refid="test.classpath"/>
431 >
432 >    </javac>
433  
434      <javac srcdir="${test.src.dir}"
435            destdir="${build.testcases.dir}"
# Line 519 | Line 439
439             source="${build.sourcelevel}"
440               fork="true">
441  
442 <      <compilerarg    line="${gjc.args}"/>
443 <      <bootclasspath refid="test.compile.bootclasspath"/>
444 <      <classpath     refid="test.classpath"/>
442 >      <include name="jsr166/test/**"/>
443 >
444 >      <compilerarg value="${bootclasspath.args}"/>
445 >      <compilerarg line="${build.args}"/>
446 >
447 >      <classpath refid="test.classpath"/>
448 >
449 >    </javac>
450 >
451 > <!--
452 >    <javac srcdir="${jtreg.src.dir}"
453 >          destdir="${build.testcases.dir}"
454 >            debug="${build.debug}"
455 >       debuglevel="${build.debuglevel}"
456 >      deprecation="${build.deprecation}"
457 >           source="${build.sourcelevel}"
458 >             fork="true">
459 >
460 >      <compilerarg value="${bootclasspath.args}"/>
461 >      <compilerarg line="${build.args}"/>
462 >
463 >      <classpath refid="test.classpath"/>
464  
465      </javac>
466 + -->
467  
468    </target>
469  
# Line 543 | Line 483
483                      dir="${build.reports.dir}"
484                     fork="true">
485  
486 <      <jvmarg value="-Xbootclasspath/p:${test.run.bootclasspath}"/>
486 >      <jvmarg value="${bootclasspath.args}"/>
487 >      <jvmarg value="-server"/>
488 >      <jvmarg value="-showversion"/>
489 >
490 >      <classpath refid="test.classpath"/>
491  
492        <formatter type="xml"/>
493  
494 <      <batchtest todir="${build.reports.dir}">
494 >      <batchtest todir="${build.reports.dir}" unless="no.test.tck">
495 >        <fileset dir="${tck.src.dir}">
496 >          <include name="**/${testcase}Test.java"/>
497 >        </fileset>
498 >      </batchtest>
499 >
500 >      <batchtest todir="${build.reports.dir}" if="do.test.old">
501          <fileset dir="${test.src.dir}">
502 +          <include name="jsr166/test/**/${testcase}Test.java"/>
503 +        </fileset>
504 +      </batchtest>
505 +
506 + <!--
507 +      <batchtest todir="${build.reports.dir}" if="do.test.jtreg">
508 +        <fileset dir="${jtreg.src.dir}">
509            <include name="**/${testcase}Test.java"/>
510          </fileset>
511        </batchtest>
512 + -->
513  
514      </junit>
515  
# Line 561 | Line 519
519    <target name="report-tests"
520            depends="run-tests">
521  
522 <    <!-- Sets junit.report.format to frames if Xalan is present,
522 >    <!-- Sets junit.report.format to frames if redirection is present,
523           otherwise sets it to noframes. -->
524      <available property="junit.report.format"
525                    value="frames"
# Line 586 | Line 544
544  
545    <target name="configure-compiler">
546  
547 <    <property name="gjc.version"
590 <             value="2.2"/>
547 >    <property name="unchecked.option" value="-Xlint:unchecked"/>
548  
549 <    <condition property="novariance.arg" value="-novariance">
550 <      <and>
594 <        <equals arg1="${gjc.version}" arg2="2.0"/>
595 <        <or>
596 <          <not><isset property="gjc.novariance"/></not>
597 <          <istrue value="${gjc.novariance}"/>
598 <        </or>
599 <      </and>
549 >    <condition property="warnunchecked.arg" value="${unchecked.option}">
550 >      <istrue value="${build.warnunchecked}"/>
551      </condition>
552  
553 <    <property name="novariance.arg"
603 <             value=""/>
553 >    <property name="warnunchecked.arg" value=""/>
554  
605    <property name="gjc.dir"
606             value="${lib.dir}/gjc"/>
555  
556 <    <property name="javac.jar"
557 <          location="${gjc.dir}/${gjc.version}/javac.jar"/>
556 >    <!-- Common options in javac invocations -->
557 >    <property name="build.args" value="${warnunchecked.arg}"/>
558  
559 <    <property name="collect.jar"
612 <          location="${gjc.dir}/${gjc.version}/collect${novariance.arg}.jar"/>
559 >  </target>
560  
561  
562 <    <condition property="warnunchecked.arg" value="-warnunchecked">
563 <      <istrue value="${gjc.warnunchecked}"/>
617 <    </condition>
562 >  <target name="configure-tests"
563 >       depends="configure-compiler">
564  
565 <    <property name="warnunchecked.arg" value=""/>
565 >    <!-- junit.framework.Protectable is in JUnit 3.8.1 but not in 3.7 -->
566 >    <available property="junit.available"
567 >               classname="junit.framework.Protectable"/>
568  
569 <    <condition property="prepare.src.dir" value="${build.dir}/prepare-src">
570 <      <istrue value="${build.nothreads}"/>
571 <    </condition>
569 >    <!-- Xalan -->
570 >    <available property="xalan.available"
571 >               classname="org.apache.xalan.Version"/>
572  
573  
574 +    <!-- Ant 1.6beta and later don't need or want this check -->
575      <!--
576 <     ! Bootclasspath munging for source compilation.
577 <     -->
576 >    <fail message="Need JUnit 3.8.1 in ${ant.home}${file.separator}lib to run tests"
577 >          unless="junit.available"/>
578  
579 <    <path id="pre.bootclasspath">
580 <      <pathelement location="${javac.jar}"/>
581 <    </path>
579 >    <fail message="Need Xalan 2.5.1 jar in ${ant.home}${file.separator}lib to run tests"
580 >          unless="xalan.available"/>
581 >    -->
582  
583 <    <path id="compile.bootclasspath">
635 <      <pathelement location="${build.classes.dir}"/>
636 <      <pathelement location="${collect.jar}"/>
637 <      <pathelement location="${rt.jar}"/>
638 <    </path>
583 >  </target>
584  
640    <!-- Flatten paths into platform-appropriate strings -->
641    <property name="pre.bootclasspath"     refid="pre.bootclasspath"/>
642    <property name="compile.bootclasspath" refid="compile.bootclasspath"/>
585  
586  
587 <    <!-- Common options in javac invocations -->
646 <    <property name="gjc.args"
647 <             value="-J-Xbootclasspath/p:${pre.bootclasspath} ${warnunchecked.arg} ${novariance.arg}"
648 <    />
587 >  <!-- Anthill targets -->
588  
589 +  <target name="anthill-build">
590 +
591 +    <!-- Override this in user.properties -->
592 +    <property name="tiger.home" location="e:/j2sdk1.5.0"/>
593 +
594 +    <exec resultproperty="result.property" dir="${basedir}" executable="${tiger.home}/bin/java">
595 +      <arg value="-Xmx256000000"/>
596 +      <!-- classpath of new JVM -->
597 +      <arg value="-classpath"/> <arg path="${java.class.path}"/>
598 +      <!-- location of Ant home directory -->
599 +      <arg value="-Dant.home=${ant.home}"/>
600 +      <!-- the Ant main class -->
601 +      <arg value="org.apache.tools.ant.Main"/>
602 +      <!-- The build file -->
603 +      <arg value="-buildfile"/>  <arg value="build.xml"/>
604 +      <!-- the target to build on the new Ant instance -->
605 +      <arg value="-DJAVA_HOME=${tiger.home}"/>
606 +      <arg value="do-anthill-build"/>
607 +    </exec>
608    </target>
609  
610 +  <target name="do-anthill-build"
611 +          depends="jar, test, docs, dist-docs"/>
612  
613 <  <target name="prepare-src"
654 <          depends="configure-compiler"
655 <          if="prepare.src.dir">
613 >  <target name="anthill-publish">
614  
615 <    <mkdir dir="${prepare.src.dir}"/>
616 <    <copy todir="${prepare.src.dir}">
617 <      <fileset dir="${src.dir}">
618 <        <exclude name="java/lang/**"/>
615 >    <copy todir="${deployDir}/docs/private">
616 >      <fileset dir="${build.javadocs.dir}"/>
617 >    </copy>
618 >
619 >    <copy todir="${deployDir}/docs/public">
620 >      <fileset dir="${dist.javadocs.dir}"/>
621 >    </copy>
622 >
623 >    <copy tofile="${deployDir}/index.html"
624 >          file="${basedir}/etc/anthill-index.html"/>
625 >
626 >    <copy todir="${deployDir}/notes">
627 >      <fileset dir="${basedir}/etc/notes"/>
628 >    </copy>
629 >
630 >  </target>
631 >
632 >
633 >
634 >  <!-- Various demos and test programs -->
635 >
636 >
637 >  <target name="sample" depends="init, configure-compiler"
638 >          description="Standalone demo program">
639 >
640 >    <mkdir dir="${build.testcases.dir}"/>
641 >
642 >    <javac srcdir="${test.src.dir}"
643 >          destdir="${build.testcases.dir}"
644 >            debug="${build.debug}"
645 >       debuglevel="${build.debuglevel}"
646 >      deprecation="${build.deprecation}"
647 >           source="${build.sourcelevel}"
648 >             fork="true">
649 >
650 >      <include name="jsr166/test/Sample.java"/>
651 >
652 >    </javac>
653 >
654 >    <copy todir="${build.testcases.dir}">
655 >      <fileset dir="${test.src.dir}">
656 >        <include name="**/*.properties"/>
657        </fileset>
658      </copy>
659  
660 +
661 +    <java classname="jsr166.test.Sample" fork="true">
662 +      <classpath refid="test.classpath"/>
663 +      <!-- <jvmarg value="-ea"/> -->
664 +      <!-- <jvmarg value="-server"/> -->
665 +      <!-- <arg value="1000"/> -->
666 +    </java>
667    </target>
668  
669  
670 <  <target name="configure-emulation">
670 >  <target name="loops" depends="init, configure-compiler"
671 >          description="Benchmark from Doug Lea's AQS paper">
672  
673 <    <condition property="build.emulation.true">
674 <      <or>
675 <        <and>
676 <          <os family="windows"/>
677 <          <not>
678 <            <isset property="build.emulation"/>
679 <          </not>
680 <        </and>
681 <        <istrue value="${build.emulation}"/>
682 <      </or>
683 <    </condition>
673 >    <mkdir dir="${build.loops.dir}"/>
674 >
675 >    <javac srcdir="${loops.src.dir}"
676 >          destdir="${build.loops.dir}"
677 >            debug="${build.debug}"
678 >       debuglevel="${build.debuglevel}"
679 >      deprecation="${build.deprecation}"
680 >           source="${build.sourcelevel}"
681 >             fork="true">
682 >
683 >      <compilerarg line="${build.args}"/>
684 >      <classpath refid="loops.classpath"/>
685 >
686 >    </javac>
687 >
688 >    <java classname="ALoops" fork="true">
689 >      <classpath refid="loops.classpath"/>
690 >    </java>
691  
692    </target>
693  
694  
695 <  <target name="configure-tests"
685 <       depends="configure-compiler">
695 >  <target name="compile-j1" depends="init, configure-compiler, compile">
696  
697 <    <!-- junit.framework.Protectable is in JUnit 3.8.1 but not in 3.7 -->
688 <    <available property="junit.available"
689 <               classname="junit.framework.Protectable"/>
697 >    <mkdir dir="${build.j1.dir}"/>
698  
699 <    <fail message="Need JUnit 3.8.1 in ${ant.home}${file.separator}lib to run tests"
700 <          unless="junit.available"/>
699 >    <javac srcdir="${j1.src.dir}"
700 >          destdir="${build.j1.dir}"
701 >            debug="${build.debug}"
702 >       debuglevel="${build.debuglevel}"
703 >      deprecation="${build.deprecation}"
704 >           source="${build.sourcelevel}" >
705 >
706 >      <include name="**/*.java"/>
707 >      <exclude name="**/dijkstra/**"/>
708 >
709 >      <compilerarg line="${build.args}"/>
710 >      <classpath refid="j1.classpath"/>
711 >
712 >    </javac>
713 >
714 >  </target>
715  
716  
717 +  <target name="sw" depends="compile-j1"
718 +          description="Runs the SwingWorker demo">
719 +
720      <!--
721 <     ! Bootclasspath munging for testing, so JUnit can test our local
722 <     ! modifications to java.*.
723 <     -->
724 <
700 <    <path id="test.classpath">
701 <      <pathelement location="${product.jar}"/>
702 <      <pathelement location="${build.testcases.dir}"/>
703 <      <pathelement location="${junit.jar}"/>
704 <    </path>
721 >    <java classname="jsr166.swing.SwingWorkerDemo" fork="true">
722 >      <classpath refid="j1.classpath"/>
723 >    </java>
724 >    -->
725  
726 <    <path id="test.compile.bootclasspath">
707 <      <pathelement location="${javac.jar}"/>
708 <      <pathelement location="${collect.jar}"/>
709 <      <pathelement location="${rt.jar}"/>
710 <    </path>
726 >    <copy todir="${build.j1.dir}" file="${j1.src.dir}/jsr166/swing/SwingWorker.html"/>
727  
728 <    <path id="test.run.bootclasspath">
729 <      <pathelement location="${javac.jar}"/>
730 <      <path refid="test.classpath"/>
731 <    </path>
728 >    <exec dir="${build.j1.dir}" executable="appletviewer.exe">
729 >      <arg value="${build.j1.dir}/SwingWorker.html"/>
730 >    </exec>
731 >
732 >  </target>
733  
734 <    <!-- Flatten test classpaths into platform-appropriate strings -->
735 <    <property name="test.classpath"             refid="test.classpath"/>
736 <    <property name="test.compile.bootclasspath" refid="test.compile.bootclasspath"/>
737 <    <property name="test.run.bootclasspath"     refid="test.run.bootclasspath"/>
734 >  <target name="j1" depends="compile-j1"
735 >          description="Runs a standalone JavaOne program">
736 >
737 >    <java classname="${j1.test}" fork="true">
738 >      <classpath refid="j1.classpath"/>
739 >      <jvmarg value="-client"/>
740 >
741 >      <!-- TestPseudoRandom args -->
742 >      <arg value="2"/>
743 >      <arg value="25"/>
744 >      <arg value="100000"/>
745 >
746 >      <!-- WebCrawler args -->
747 >      <!--
748 >      <arg value="jsr166.webcrawler.WebCrawler3"/>
749 >      <arg value="http://www.priorartisans.com"/>
750 >      <arg value="25"/>
751 >      -->
752 >
753 >    </java>
754  
755    </target>
756  
757  
758 +  <target name="test-j1" depends="compile-j1"
759 +          description="Runs testcases from the JavaOne source directories">
760  
761 <  <!-- Anthill targets -->
761 >    <junit printsummary="true"
762 >             showoutput="true"
763 >          errorProperty="junit.failed"
764 >        failureProperty="junit.failed"
765 >                    dir="${build.j1.dir}"
766 >                   fork="true">
767  
768 <  <target name="anthill-build"
769 <          depends="jar, test, docs, dist-docs"/>
768 >      <!-- <jvmarg value="-server"/> -->
769 >      <classpath refid="j1.classpath"/>
770 >      <formatter type="xml"/>
771  
772 <  <target name="anthill-publish">
772 >      <batchtest todir="${build.j1.dir}">
773 >        <fileset dir="${j1.src.dir}">
774 >          <include name="**/*Test.java"/>
775 >        </fileset>
776 >      </batchtest>
777  
778 <    <copy todir="${deployDir}/docs/private">
734 <      <fileset dir="${build.javadocs.dir}"/>
735 <    </copy>
778 >    </junit>
779  
780 <    <copy todir="${deployDir}/docs/public">
781 <      <fileset dir="${dist.javadocs.dir}"/>
782 <    </copy>
780 >    <available property="junit.report.format"
781 >                  value="frames"
782 >              classname="org.apache.xalan.lib.Redirect"/>
783 >    <property name="junit.report.format" value="noframes"/>
784  
785 <    <copy tofile="${deployDir}/index.html"
786 <          file="${basedir}/etc/anthill-index.html"/>
785 >    <junitreport todir="${build.j1.dir}">
786 >      <fileset dir="${build.j1.dir}">
787 >        <include name="TEST-*.xml"/>
788 >      </fileset>
789 >      <report styledir="${stylesheet.dir}"
790 >                format="${junit.report.format}"
791 >                 todir="${build.j1.dir}"
792 >      />
793 >    </junitreport>
794  
795 <    <copy todir="${deployDir}/notes">
796 <      <fileset dir="${basedir}/etc/notes"/>
797 <    </copy>
795 >    <fail message="Test Cases Failed" if="junit.failed"/>
796 >
797 >  </target>
798 >
799 >
800 >
801 >  <!-- C++ and JNI definitions and demos -->
802 >
803 >  <target name="configure-cpp">
804 >
805 >    <!-- Define tasks and types -->
806 >
807 >    <path id="cpptasks.path">
808 >      <pathelement location="${lib.dir}/cpptasks.jar"/>
809 >    </path>
810 >    <taskdef resource="cpptasks.tasks" classpathref="cpptasks.path"/>
811 >    <typedef resource="cpptasks.types" classpathref="cpptasks.path"/>
812 >
813 >    <!-- Set platform property for JNI includes -->
814 >
815 >    <condition property="platform" value="linux">
816 >      <os name="Linux"/>
817 >    </condition>
818 >    <condition property="platform" value="win32">
819 >      <os family="windows"/>
820 >    </condition>
821 >    <condition property="platform" value="solaris">
822 >      <os name="SunOS"/>
823 >    </condition>
824  
825    </target>
826  
827  
828 <  <target name="ng" depends="test">
829 <    <java classname="SuperfluousAbstract" fork="true">
828 >  <target name="cppdemo" depends="configure-cpp">
829 >
830 >    <mkdir dir="${build.dir}"/>
831 >
832 >    <cc multithreaded="true"
833 >                 name="g++"
834 >               objdir="${build.dir}"
835 >              outfile="${build.dir}/CppDemo">
836 >      <fileset dir="${test.src.dir}" includes="CppDemo.cpp"/>
837 >      <libset libs="stdc++"/>
838 >    </cc>
839  
840 <      <jvmarg value="-Xbootclasspath/p:${test.run.bootclasspath}"/>
840 >    <exec executable="${build.dir}/CppDemo">
841 >      <arg line="count in word frequency of word in command line count"/>
842 >    </exec>
843  
844 +  </target>
845 +
846 +
847 +  <target name="jnidemo" depends="init, configure-compiler, configure-cpp">
848 +
849 +    <mkdir dir="${build.testcases.dir}"/>
850 +
851 +    <javac srcdir="${test.src.dir}"
852 +          destdir="${build.testcases.dir}"
853 +            debug="${build.debug}"
854 +       debuglevel="${build.debuglevel}"
855 +      deprecation="${build.deprecation}"
856 +           source="${build.sourcelevel}"
857 +             fork="true">
858 +      <compilerarg value="${bootclasspath.args}"/>
859 +      <compilerarg line="${build.args}"/>
860 +      <classpath refid="test.classpath"/>
861 +      <include name="JniDemo.java"/>
862 +    </javac>
863 +
864 +    <javah destdir="${build.testcases.dir}"
865 +      classpathref="test.classpath">
866 +      <class name="JniDemo"/>
867 +    </javah>
868 +
869 +    <cc multithreaded="true"
870 +                 name="g++"
871 +               objdir="${build.dir}"
872 +              outfile="${build.dir}/JniDemo"
873 +              outtype="shared">
874 +
875 +      <compiler>
876 +        <defineset>
877 +          <define name="__int64" value="long long"/>
878 +        </defineset>
879 +        <includepath location="${java.home}/../include"/>
880 +        <includepath location="${java.home}/../include/${platform}"/>
881 +        <compilerarg value="-mno-cygwin"/>
882 +      </compiler>
883 +
884 +      <linker>
885 +        <linkerarg value="--add-stdcall-alias"/>
886 +      </linker>
887 +
888 +      <includepath location="${build.testcases.dir}"/>
889 +
890 +      <fileset dir="${test.src.dir}" includes="JniDemo.cpp"/>
891 +
892 +      <libset libs="stdc++"/>
893 +
894 +    </cc>
895 +
896 +    <!-- Necessary if windows, harmless if not -->
897 +    <copy file="${build.dir}/libJniDemo.so" tofile="${build.dir}/JniDemo.dll"/>
898 +
899 +    <java classname="JniDemo" fork="true">
900 +      <!-- Watch out: path separator hardwired to semicolon here! -->
901 +      <sysproperty key="java.library.path" path="${java.library.path};${build.dir}"/>
902 +      <classpath refid="test.classpath"/>
903 +      <arg line="count in word frequency of word in command line count"/>
904      </java>
905 +
906 +  </target>
907 +
908 +
909 +
910 +  <!-- Backward compatibility, work in progress (some files not checked in) -->
911 +
912 +
913 +
914 +  <property name="pretiger.src.dir"     location="${build.dir}/pretiger/src"/>
915 +  <property name="build.pretiger.dir"   location="${build.dir}/pretiger/classes"/>
916 +  <property name="pretiger.jar"         location="${build.lib.dir}/jsr166-pretiger.jar"/>
917 +  <property name="pretiger.sourcelevel" value="1.4"/>
918 +
919 +  <target name="defang"
920 +       depends="init"
921 +   description="Generates pre-Tiger compatible source">
922 +
923 +    <delete dir="${pretiger.src.dir}"/>
924 +    <mkdir dir="${pretiger.src.dir}"/>
925 +
926 +    <exec executable="perl">
927 +      <arg file="etc/defang.pl"/>
928 +      <!-- <arg value="-v"/> -->
929 +      <arg value="-s"/> <arg file="${src.dir}"/>
930 +      <arg value="-t"/> <arg file="${pretiger.src.dir}"/>
931 +    </exec>
932 +
933 +  </target>
934 +
935 +  <target name="compile-pretiger"
936 +          depends="init, configure-compiler, defang"
937 +          description="Compiles pre-Tiger sources to build folder">
938 +
939 +    <mkdir dir="${build.pretiger.dir}"/>
940 +
941 +    <javac srcdir="${pretiger.src.dir}"
942 +          destdir="${build.pretiger.dir}"
943 +            debug="${build.debug}"
944 +       debuglevel="${build.debuglevel}"
945 +      deprecation="${build.deprecation}"
946 +           source="${pretiger.sourcelevel}"
947 +             fork="true">
948 +
949 +      <compilerarg line="${build.args}"/>
950 +      <exclude name="**/Thread.java"/>
951 +
952 +    </javac>
953 +
954 +  </target>
955 +
956 +  <target name="pretiger" depends="compile-pretiger">
957 +
958 +    <mkdir dir="${build.lib.dir}"/>
959 +
960 +    <jar destfile="${pretiger.jar}">
961 +      <fileset dir="${build.pretiger.dir}">
962 +      </fileset>
963 +    </jar>
964 +
965    </target>
966  
967 +  <!-- jsr166x -->
968 +
969 +
970 +  <target name="jsr166xcompile"
971 +          depends="init, configure-compiler"
972 +          description="Compiles jsr166x sources">
973 +
974 +    <mkdir dir="${build.jsr166x.dir}"/>
975 +
976 +    <javac srcdir="${jsr166xsrc.dir}"
977 +          destdir="${build.jsr166x.dir}"
978 +            debug="${build.debug}"
979 +       debuglevel="${build.debuglevel}"
980 +      deprecation="${build.deprecation}"
981 +           source="${build.sourcelevel}"
982 +             fork="true">
983 +
984 +      <include name="**/*.java"/>
985 +      <compilerarg line="${build.args}"/>
986 +
987 +    </javac>
988 +
989 +  </target>
990 +
991 +
992 +
993 +  <target name="jsr166xjar"
994 +          depends="jsr166xcompile"
995 +          description="Builds library jar from compiled sources">
996 +
997 +    <mkdir dir="${build.jsr166xlib.dir}"/>
998 +
999 +    <jar destfile="${jsr166xproduct.jar}">
1000 +      <fileset dir="${build.jsr166x.dir}"/>
1001 +    </jar>
1002 +
1003 +  </target>
1004 +
1005 +
1006 +
1007 +  <target name="jsr166xdocs"
1008 +          description="Builds javadocs with custom tags to build folder">
1009 +
1010 +    <delete dir="${build.jsr166xjavadocs.dir}"/>
1011 +    <mkdir dir="${build.jsr166xjavadocs.dir}"/>
1012 +
1013 +    <javadoc destdir="${build.jsr166xjavadocs.dir}"
1014 +                link="http://java.sun.com/j2se/1.5.0/docs/api/"
1015 +            sourcepath="${jsr166xsrc.dir}:/home/dl/1.5.0/j2se/martin/j2se/src/share/classes"
1016 +
1017 +    >
1018 +      <packageset dir="${topsrc.dir}" defaultexcludes="yes">
1019 +      <include name="jsr166x"/>
1020 +      </packageset>
1021 +
1022 +
1023 +    </javadoc>
1024 +
1025 +  </target>
1026 +
1027 +
1028 +  <target name="jsr166xdist"
1029 +          depends="jsr166xdist-clean, jsr166xdist-jar, jsr166xdist-docs"
1030 +          description="Puts all distributable products in single hierarchy"/>
1031 +
1032 +
1033 +
1034 +  <target name="jsr166xclean"
1035 +          description="Removes all build products">
1036 +
1037 +    <delete dir="${build.jsr166x.dir}"/>
1038 +    <delete dir="${build.jsr166xlib.dir}"/>
1039 +
1040 +  </target>
1041 +
1042 +
1043 +
1044 +  <target name="jsr166xdist-clean"
1045 +          description="Removes all build and distribution products">
1046 +
1047 +  </target>
1048 +
1049 +
1050 +
1051 +  <target name="jsr166xdist-docs"
1052 +          description="Builds javadocs without custom tags to dist folder">
1053 +
1054 +    <delete dir="${dist.jsr166xjavadocs.dir}"/>
1055 +    <mkdir dir="${dist.jsr166xjavadocs.dir}"/>
1056 +
1057 +    <javadoc destdir="${dist.jsr166xjavadocs.dir}"
1058 +                link="http://java.sun.com/j2se/1.5.0/docs/api/"
1059 +              source="${build.sourcelevel}">
1060 +
1061 +      <packageset dir="${topsrc.dir}" defaultexcludes="yes">
1062 +      <include name="jsr166x"/>
1063 +      </packageset>
1064 +
1065 +    </javadoc>
1066 +
1067 +  </target>
1068 +
1069 +  <target name="jsr166xdist-jar"
1070 +          depends="jsr166xclean, jsr166xjar">
1071 +
1072 +    <copy file="${jsr166xproduct.jar}" todir="${dist.dir}"/>
1073 +
1074 +  </target>
1075  
1076   </project>

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines