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.55 by tim, Mon Sep 1 04:14:47 2003 UTC vs.
Revision 1.66 by jsr166, Sun Apr 11 01:37:41 2004 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.sinjdocs.dir"   location="${build.dir}/sinjdocs"/>
39  <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  
44    <!-- Source locations -->
45    <property name="src.dir"              location="${basedir}/src/main"/>
47  <property name="emulation.src.dir"    location="${basedir}/src/emulation"/>
46    <property name="test.src.dir"         location="${basedir}/src/test"/>
47 +  <property name="j1.src.dir"           location="${basedir}/src/javaone"/>
48 +  <property name="loops.src.dir"        location="${basedir}/src/loops"/>
49 +  <property name="tck.src.dir"          location="${test.src.dir}/tck"/>
50 +  <property name="jtreg.src.dir"        location="${test.src.dir}/jtreg"/>
51    <property name="ant.src.dir"          location="${basedir}/etc/ant"/>
52    <property name="stylesheet.dir"       location="${basedir}/etc/xsl"/>
53    <property name="lib.dir"              location="${basedir}/lib"/>
# Line 57 | Line 59
59    <!-- Jar locations -->
60    <property name="product.jar"          location="${build.lib.dir}/jsr166.jar"/>
61    <property name="junit.jar"            location="${lib.dir}/junit.jar"/>
62 <  <property name="rt.jar"               location="${java.home}/lib/rt.jar"/>
61 <  <property name="sinjdoc.jar"          location="${lib.dir}/sinjdoc.jar"/>
62 >  <property name="concurrent.jar"       location="${lib.dir}/concurrent.jar"/>
63  
64 +  <!-- Bootclasspath argument -->
65 +  <property name="bootclasspath.args"   value="-Xbootclasspath/p:${product.jar}"/>
66  
67 <  <!-- Files excluded from dist-docs and emulation jar -->
68 <  <patternset id="unsafe.exclusion">
69 <    <exclude name="java/util/Random.*"/>
70 <    <exclude name="sun/misc/Unsafe.*"/>
71 <  </patternset>
72 <
73 <  <!-- Files excludes from emulation jar -->
74 <  <patternset id="atomic.exclusion">
75 <    <exclude name="java/util/concurrent/atomic/AtomicBoolean*"/>
76 <    <exclude name="java/util/concurrent/atomic/AtomicInteger*"/>
77 <    <exclude name="java/util/concurrent/atomic/AtomicLong*"/>
78 <    <exclude name="java/util/concurrent/atomic/AtomicReference*"/>
79 <    <exclude name="java/util/concurrent/locks/LockSupport*"/>
80 <    <exclude name="java/util/concurrent/locks/ReentrantLock*"/>
81 <  </patternset>
82 <
67 >  <!-- Test classpath -->
68 >  <path id="test.classpath">
69 >    <pathelement location="${build.testcases.dir}"/>
70 >    <pathelement location="${junit.jar}"/>
71 >  </path>
72 >
73 >  <!-- ALoops classpath -->
74 >  <path id="loops.classpath">
75 >    <pathelement location="${build.loops.dir}"/>
76 >  </path>
77 >
78 >  <!-- J1 classpath -->
79 >  <path id="j1.classpath">
80 >    <pathelement location="${build.j1.dir}"/>
81 >    <pathelement location="${junit.jar}"/>
82 >    <pathelement location="${concurrent.jar}"/>
83 >  </path>
84  
85  
86    <!-- Main targets -->
87  
88 +
89    <target name="compile"
90 <          depends="init, configure-compiler, prepare-src"
90 >          depends="init, configure-compiler"
91            description="Compiles main sources to build folder">
92  
88    <property name="prepare.src.dir" value="${src.dir}"/>
89
93      <mkdir dir="${build.classes.dir}"/>
94  
95 < <!--
93 <    <echo>javac ${gjc.args}</echo>
94 <    <echo>bootclasspath=${compile.bootclasspath}</echo>
95 < -->
96 <
97 <    <javac srcdir="${prepare.src.dir}"
95 >    <javac srcdir="${src.dir}"
96            destdir="${build.classes.dir}"
97              debug="${build.debug}"
98         debuglevel="${build.debuglevel}"
# Line 102 | Line 100
100             source="${build.sourcelevel}"
101               fork="true">
102  
103 <      <compilerarg    line="${gjc.args}"/>
106 < <!--
107 <      <bootclasspath refid="compile.bootclasspath"/>
108 < -->
103 >      <compilerarg line="${build.args}"/>
104  
105      </javac>
106  
107    </target>
108  
109  
115  <target name="jar"
116          depends="configure-emulation, init-jar, native-jar, emulation-jar"
117          description="Builds library jar from compiled sources"/>
118
119
120  <target name="test"
121          depends="init, configure-tests, report-tests"
122          description="Runs all tests (requires JUnit 3.8.1 in ${ant.home}/lib)" />
123
110  
111 <  <target name="checkstyle"
112 <          depends="filter-src"
113 <          description="Reports on style errors in Java source (verbose, mostly chaff)">
111 >  <target name="jar"
112 >          depends="compile"
113 >          description="Builds library jar from compiled sources">
114  
115 <    <taskdef resource="checkstyletask.properties"
130 <            classpath="${lib.dir}/checkstyle-all-2.4.jar"/>
115 >    <mkdir dir="${build.lib.dir}"/>
116  
117 <    <checkstyle>
118 <      <formatter type="plain"/>  <!-- also available: type="xml" -->
119 <      <fileset dir="${build.filter.src.dir}" includes="**/*.java"/>
135 <    </checkstyle>
117 >    <jar destfile="${product.jar}">
118 >      <fileset dir="${build.classes.dir}"/>
119 >    </jar>
120  
121    </target>
122  
123  
140  <target name="doccheck"
141          depends="filter-doccheck"
142          description="Reports on javadoc style errors">
124  
125 <    <delete dir="${build.doccheck.dir}"/>
126 <    <mkdir dir="${build.doccheck.dir}"/>
127 <
147 <    <javadoc doclet="com.sun.tools.doclets.doccheck.DocCheck"
148 <         docletpath="${lib.dir}/doccheck.jar"
149 <            destdir="${build.doccheck.dir}">
150 <      <packageset dir="${build.filter.doccheck.dir}"/>
151 <    </javadoc>
152 <
153 <    <echo>DocCheck output is in ${build.doccheck.dir}</echo>
125 >  <target name="test"
126 >          depends="init, configure-tests, report-tests"
127 >          description="Runs all tests (requires JUnit 3.8.1 in ${ant.home}/lib)" />
128  
155  </target>
129  
130  
131    <target name="docs"
159          depends="filter-src"
132            description="Builds javadocs with custom tags to build folder">
133  
134      <delete dir="${build.javadocs.dir}"/>
# Line 165 | Line 137
137      <javadoc destdir="${build.javadocs.dir}"
138                  link="http://java.sun.com/j2se/1.4.1/docs/api"
139              overview="${src.dir}/intro.html"
140 <              source="${build.docsourcelevel}">
140 >              source="${build.sourcelevel}">
141  
142        <tag name="revised" description="Last revised:"/>
143        <tag name="spec"    description="Specified by:"/>
172      <tag name="editor"  description="Last edited by:"/>
173      <tag name="fixme"   description="FIX ME:"/>
144  
145 <      <packageset dir="${build.filter.src.dir}"/>
145 >      <packageset dir="${src.dir}"/>
146  
147      </javadoc>
148  
149    </target>
150  
151  
182  <target name="sinjdocs"
183          depends="configure-tests"
184          description="Builds javadocs with custom tags to build folder">
185
186    <delete dir="${build.sinjdocs.dir}"/>
187    <mkdir dir="${build.sinjdocs.dir}"/>
188
189    <java classname="net.cscott.sinjdoc.Main" fork="true">
152  
153 <      <jvmarg value="-Xbootclasspath/p:${test.run.bootclasspath}"/>
153 >  <target name="doccheck"
154 >          depends="filter-doccheck"
155 >          description="Reports on javadoc style errors">
156  
157 <      <classpath>
158 <        <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>
199 <
200 <
201 <      <arg value="-d"/>          <arg value="${build.sinjdocs.dir}"/>
202 <      <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"/>
157 >    <delete dir="${build.doccheck.dir}"/>
158 >    <mkdir dir="${build.doccheck.dir}"/>
159  
160 <      <!--
161 <      <arg value="-help"/>
162 <      -->
160 >    <javadoc doclet="com.sun.tools.doclets.doccheck.DocCheck"
161 >         docletpath="${lib.dir}/doccheck.jar"
162 >            destdir="${build.doccheck.dir}">
163 >      <packageset dir="${build.dc-filter.dir}"/>
164 >    </javadoc>
165  
166 <    </java>
166 >    <echo>DocCheck output is in ${build.doccheck.dir}</echo>
167  
168    </target>
169  
170  
222  <target name="strip"
223          depends="init, configure-compiler"
224          description="Strip generics from java source (not working yet)">
171  
172 <    <mkdir dir="${build.stripped.dir}"/>
172 >  <target name="checkstyle"
173 >          depends="filter-src"
174 >          description="Reports on style errors in Java source (verbose, mostly chaff)">
175  
176 <    <!--
177 <     # javac -s doesn't reliably generate compilable code. It generates
230 <     # 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}"
235 <            debug="${build.debug}"
236 <       debuglevel="${build.debuglevel}"
237 <      deprecation="${build.deprecation}"
238 <           source="${build.sourcelevel}"
239 <             fork="true">
176 >    <taskdef resource="checkstyletask.properties"
177 >            classpath="${lib.dir}/checkstyle-all-3.1.jar"/>
178  
179 <      <compilerarg    line="${gjc.args} -s"/>
242 < <!--
243 <      <bootclasspath refid="compile.bootclasspath"/>
244 < -->
179 >    <mkdir dir="${build.checkstyle.dir}"/>
180  
181 <    </javac>
181 >    <checkstyle config="etc/checkstyle/sun_checks.xml"
182 >       failOnViolation="false">
183 >      <formatter type="xml" toFile="${build.checkstyle.dir}/checkstyle-report.xml"/>
184 >      <fileset dir="${build.filter.src.dir}" includes="**/*.java"/>
185 >    </checkstyle>
186 >
187 >    <style in="${build.checkstyle.dir}/checkstyle-report.xml"
188 >          out="${build.checkstyle.dir}/checkstyle-report.html"
189 >        style="${stylesheet.dir}/checkstyle-frames.xsl"/>
190  
191    </target>
192  
193  
194 +
195    <target name="dist"
196            depends="init, dist-clean, dist-jar, dist-docs"
197            description="Puts all distributable products in single hierarchy"/>
198  
199 +
200 +
201    <target name="release"
202            depends="dist"
203            description="Puts entire CVS tree, plus distribution productions, in a jar">
204  
259 <!--
260    #keep build dir? - dl
261    <delete dir="${build.dir}"/>
262 -->
205      <property name="release.jar" value="dist/jsr166-${version}-dist.jar"/>
206  
207      <jar basedir="${basedir}" destfile="${release.jar}">
208 +      <!-- <exclude name="build/**"/> -->
209        <exclude name="${release.jar}"/>
210        <exclude name="user.properties"/>
211        <exclude name="etc/notes/**"/>
212 <      <exclude name="lib/gjc/2.1/**"/>
212 >      <exclude name="src/emulation/**"/>
213        <exclude name="**/SyntaxTest.java"/>
214 +      <exclude name="**/SuperfluousAbstract.java"/>
215      </jar>
216  
217    </target>
218  
219 +
220 +
221    <target name="clean"
222            description="Removes all build products">
223  
# Line 282 | Line 228
228    </target>
229  
230  
231 +
232    <target name="dist-clean"
233            description="Removes all build and distribution products">
234  
# Line 290 | Line 237
237    </target>
238  
239  
240 +
241    <target name="dist-docs"
294          depends="filter-src"
242            description="Builds javadocs without custom tags to dist folder">
243  
244      <delete dir="${dist.javadocs.dir}"/>
245      <mkdir dir="${dist.javadocs.dir}"/>
246  
247      <javadoc destdir="${dist.javadocs.dir}"
248 <                link="http://java.sun.com/j2se/1.4.1/docs/api"
248 >                link="http://java.sun.com/j2se/1.4.2/docs/api"
249              overview="${src.dir}/intro.html"
250 <              source="${build.docsourcelevel}">
250 >              source="${build.sourcelevel}">
251  
252 <      <packageset dir="${build.filter.src.dir}"/>
252 >      <packageset dir="${src.dir}"/>
253  
254      </javadoc>
255  
# Line 323 | Line 270
270    </target>
271  
272  
326  <target name="init-jar">
327
328    <mkdir dir="${build.lib.dir}"/>
329
330  </target>
331
332
333  <target name="native-jar"
334          depends="compile"
335          unless="build.emulation.true">
336
337    <jar destfile="${product.jar}">
338      <fileset dir="${build.classes.dir}"/>
339    </jar>
340
341  </target>
342
343
344  <target name="compile-emulation"
345          depends="init, configure-compiler"
346          if="build.emulation.true">
347
348    <mkdir dir="${build.emulation.dir}"/>
349
350    <javac srcdir="${emulation.src.dir}"
351          destdir="${build.emulation.dir}"
352            debug="${build.debug}"
353       debuglevel="${build.debuglevel}"
354      deprecation="${build.deprecation}"
355           source="${build.sourcelevel}"
356             fork="true">
357
358      <compilerarg    line="${gjc.args}"/>
359 <!--
360      <bootclasspath refid="compile.bootclasspath"/>
361 -->
362
363    </javac>
364
365  </target>
366
367
368  <target name="emulation-jar"
369          depends="compile-emulation"
370          if="build.emulation.true">
371
372
373    <jar destfile="${product.jar}" duplicate="add">
374      <fileset dir="${build.classes.dir}">
375        <patternset refid="atomic.exclusion"/>
376        <patternset refid="unsafe.exclusion"/>
377      </fileset>
378      <fileset dir="${build.emulation.dir}"/>
379    </jar>
380
381  </target>
382
383
273    <target name="dist-jar"
274            depends="clean, jar">
275  
# Line 396 | Line 285
285  
286      <javac srcdir="${ant.src.dir}"
287            destdir="${build.ant.dir}"
288 <           source="1.4"
400 <    />
288 >           source="1.4"/>
289  
290    </target>
291  
# Line 416 | Line 304
304      <copy todir="${build.filter.src.dir}">
305        <fileset dir="${src.dir}">
306          <exclude name="**/*.html"/>
307 <        <patternset refid="unsafe.exclusion"/>
307 >        <!-- Files excluded from dist-docs -->
308 >        <exclude name="java/util/Random.*"/>
309 >        <exclude name="sun/misc/Unsafe.*"/>
310        </fileset>
311 +      <!--
312        <filterchain>
313 +      -->
314  
315          <!--
316           # This filter gets rid of angle-bracketed type parameters
# Line 432 | Line 324
324           #   tweaking.)
325           -->
326  
327 +        <!--
328          <filterreader classname="jsr166.ant.filters.ReplaceFilter"
329                        classpath="${build.ant.dir}">
330            <param name="notmatching" value="^\s+\*\s.*$"/>
331            <param name="pattern"     value="&lt;[^|>()]+?>+"/>
332            <param name="replacement" value=" "/>
333          </filterreader>
334 +        -->
335  
336 <
443 <        <!--
444 <         # 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 <         -->
448 <
449 <        <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>
336 >      <!--
337        </filterchain>
338 +      -->
339      </copy>
340  
341    </target>
342  
343  
461
462
344    <target name="filter-doccheck"
345            depends="filter-src">
346  
347 <    <mkdir dir="${build.filter.doccheck.dir}"/>
347 >    <mkdir dir="${build.dc-filter.dir}"/>
348  
349 <    <copy todir="${build.filter.doccheck.dir}">
349 >    <copy todir="${build.dc-filter.dir}">
350        <fileset dir="${build.filter.src.dir}">
351          <include name="**/*.html"/>
352        </fileset>
# Line 475 | Line 356
356               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 {}"
357      />
358  
359 <    <copy todir="${build.filter.doccheck.dir}">
359 >    <copy todir="${build.dc-filter.dir}">
360        <fileset dir="${build.filter.src.dir}">
361          <exclude name="**/*.html"/>
362        </fileset>
# Line 513 | Line 394
394  
395      <mkdir dir="${build.testcases.dir}"/>
396  
397 < <!--
398 <    <echo>javac ${gjc.args}</echo>
399 <    <echo>bootclasspath=${test.compile.bootclasspath}</echo>
400 <    <echo>classpath="${test.classpath}"</echo>
401 < -->
397 >    <javac srcdir="${tck.src.dir}"
398 >          destdir="${build.testcases.dir}"
399 >            debug="${build.debug}"
400 >       debuglevel="${build.debuglevel}"
401 >      deprecation="${build.deprecation}"
402 >           source="${build.sourcelevel}"
403 >             fork="true">
404 >
405 >      <compilerarg value="${bootclasspath.args}"/>
406 >      <compilerarg line="${build.args}"/>
407 >
408 >      <classpath refid="test.classpath"/>
409 >
410 >    </javac>
411  
412      <javac srcdir="${test.src.dir}"
413            destdir="${build.testcases.dir}"
# Line 527 | Line 417
417             source="${build.sourcelevel}"
418               fork="true">
419  
420 <      <compilerarg    line="${gjc.args}"/>
421 < <!--      
422 <      <bootclasspath refid="test.compile.bootclasspath"/>
423 < -->      
424 <      <classpath     refid="test.classpath"/>
425 <      
536 <      <include name="java/**"/>
537 <      <include name="jsr166/**"/>
420 >      <include name="jsr166/test/**"/>
421 >
422 >      <compilerarg value="${bootclasspath.args}"/>
423 >      <compilerarg line="${build.args}"/>
424 >
425 >      <classpath refid="test.classpath"/>
426  
427      </javac>
428  
429 + <!--
430 +    <javac srcdir="${jtreg.src.dir}"
431 +          destdir="${build.testcases.dir}"
432 +            debug="${build.debug}"
433 +       debuglevel="${build.debuglevel}"
434 +      deprecation="${build.deprecation}"
435 +           source="${build.sourcelevel}"
436 +             fork="true">
437 +
438 +      <compilerarg value="${bootclasspath.args}"/>
439 +      <compilerarg line="${build.args}"/>
440 +
441 +      <classpath refid="test.classpath"/>
442 +
443 +    </javac>
444 + -->
445 +
446    </target>
447  
448  
# Line 556 | Line 461
461                      dir="${build.reports.dir}"
462                     fork="true">
463  
464 <      <jvmarg value="-Xbootclasspath:${test.run.bootclasspath}"/>
464 >      <jvmarg value="${bootclasspath.args}"/>
465 >      <jvmarg value="-server"/>
466 >      <jvmarg value="-showversion"/>
467 >
468 >      <classpath refid="test.classpath"/>
469  
470        <formatter type="xml"/>
471  
472 <      <batchtest todir="${build.reports.dir}">
472 >      <batchtest todir="${build.reports.dir}" unless="no.test.tck">
473 >        <fileset dir="${tck.src.dir}">
474 >          <include name="**/${testcase}Test.java"/>
475 >        </fileset>
476 >      </batchtest>
477 >
478 >      <batchtest todir="${build.reports.dir}" if="do.test.old">
479          <fileset dir="${test.src.dir}">
480 <          <include name="java/**/${testcase}Test.java"/>
566 <          <include name="jsr166/**/${testcase}Test.java"/>
480 >          <include name="jsr166/test/**/${testcase}Test.java"/>
481          </fileset>
482        </batchtest>
483  
484 + <!--
485 +      <batchtest todir="${build.reports.dir}" if="do.test.jtreg">
486 +        <fileset dir="${jtreg.src.dir}">
487 +          <include name="**/${testcase}Test.java"/>
488 +        </fileset>
489 +      </batchtest>
490 + -->
491 +
492      </junit>
493  
494    </target>
# Line 600 | Line 522
522  
523    <target name="configure-compiler">
524  
603    <property name="gjc.version"
604             value="2.2"/>
605
606    <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>
615
616    <property name="novariance.arg"
617             value=""/>
618
619    <property name="gjc.dir"
620             value="${lib.dir}/gjc"/>
621
622    <property name="javac.jar"
623          location="${gjc.dir}/${gjc.version}/javac.jar"/>
624
625    <property name="collect.jar"
626          location="${gjc.dir}/${gjc.version}/collect${novariance.arg}.jar"/>
627
628 <!--
629    <property name="unchecked.option" value="-warnunchecked"/>
630 -->
631
525      <property name="unchecked.option" value="-Xlint:unchecked"/>
526  
527      <condition property="warnunchecked.arg" value="${unchecked.option}">
528 <      <istrue value="${gjc.warnunchecked}"/>
528 >      <istrue value="${build.warnunchecked}"/>
529      </condition>
530  
531      <property name="warnunchecked.arg" value=""/>
639    
640    <condition property="prepare.src.dir" value="${build.dir}/prepare-src">
641      <istrue value="${build.nothreads}"/>
642    </condition>
643
644
645    <!--
646     ! Bootclasspath munging for source compilation.
647     -->
648
649    <path id="pre.bootclasspath">
650 <!--
651      <pathelement location="${javac.jar}"/>
652 -->
653    </path>
654
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>
662
663    <!-- Flatten paths into platform-appropriate strings -->
664    <property name="pre.bootclasspath"     refid="pre.bootclasspath"/>
665    <property name="compile.bootclasspath" refid="compile.bootclasspath"/>
532  
533  
534      <!-- Common options in javac invocations -->
535 < <!--
670 <    <property name="gjc.args"
671 <             value="-J-Xbootclasspath/p:${pre.bootclasspath} ${warnunchecked.arg} ${novariance.arg}"
672 <    />
673 < -->
674 <    <property name="gjc.args" value="${warnunchecked.arg} ${novariance.arg}"/>
675 <
676 <  </target>
677 <
678 <
679 <  <target name="prepare-src"
680 <          depends="configure-compiler"
681 <          if="prepare.src.dir">
682 <
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>
689 <
690 <  </target>
691 <
692 <
693 <  <target name="configure-emulation">
694 <
695 <    <condition property="build.emulation.true">
696 <      <or>
697 <        <and>
698 <          <os family="windows"/>
699 <          <not>
700 <            <isset property="build.emulation"/>
701 <          </not>
702 <        </and>
703 <        <istrue value="${build.emulation}"/>
704 <      </or>
705 <    </condition>
535 >    <property name="build.args" value="${warnunchecked.arg}"/>
536  
537    </target>
538  
# Line 714 | Line 544
544      <available property="junit.available"
545                 classname="junit.framework.Protectable"/>
546  
717    <fail message="Need JUnit 3.8.1 in ${ant.home}${file.separator}lib to run tests"
718          unless="junit.available"/>
719
547      <!-- Xalan -->
548      <available property="xalan.available"
549                 classname="org.apache.xalan.Version"/>
550  
724    <fail message="Need Xalan 2.5.1 jar in ${ant.home}${file.separator}lib to run tests"
725          unless="xalan.available"/>
726
551  
552 +    <!-- Ant 1.6beta and later don't need or want this check -->
553      <!--
554 <     ! Bootclasspath munging for testing, so JUnit can test our local
555 <     ! modifications to java.*.
731 <     -->
732 <
733 <    <path id="test.classpath">
734 <      <pathelement location="${product.jar}"/>
735 <      <pathelement location="${rt.jar}"/>
736 <      <pathelement location="${build.testcases.dir}"/>
737 <      <pathelement location="${junit.jar}"/>
738 <    </path>
739 <
740 <    <path id="test.compile.bootclasspath">
741 <      <pathelement location="${javac.jar}"/>
742 <      <pathelement location="${collect.jar}"/>
743 <      <pathelement location="${rt.jar}"/>
744 <    </path>
745 <
746 <    <path id="test.run.bootclasspath">
747 < <!--    
748 <      <pathelement location="${javac.jar}"/>
749 < -->      
750 <      <path refid="test.classpath"/>
751 <    </path>
554 >    <fail message="Need JUnit 3.8.1 in ${ant.home}${file.separator}lib to run tests"
555 >          unless="junit.available"/>
556  
557 <    <!-- Flatten test classpaths into platform-appropriate strings -->
558 <    <property name="test.classpath"             refid="test.classpath"/>
559 <    <property name="test.compile.bootclasspath" refid="test.compile.bootclasspath"/>
756 <    <property name="test.run.bootclasspath"     refid="test.run.bootclasspath"/>
557 >    <fail message="Need Xalan 2.5.1 jar in ${ant.home}${file.separator}lib to run tests"
558 >          unless="xalan.available"/>
559 >    -->
560  
561    </target>
562  
# Line 762 | Line 565
565    <!-- Anthill targets -->
566  
567    <target name="anthill-build">
568 <  
568 >
569      <!-- Override this in user.properties -->
570      <property name="tiger.home" location="e:/j2sdk1.5.0"/>
571 <    
571 >
572      <exec resultproperty="result.property" dir="${basedir}" executable="${tiger.home}/bin/java">
573        <arg value="-Xmx256000000"/>
574        <!-- classpath of new JVM -->
# Line 781 | Line 584
584        <arg value="do-anthill-build"/>
585      </exec>
586    </target>
587 <  
587 >
588    <target name="do-anthill-build"
589            depends="jar, test, docs, dist-docs"/>
590  
# Line 805 | Line 608
608    </target>
609  
610  
808  <target name="ng" depends="test">
809    <java classname="SuperfluousAbstract" fork="true">
611  
612 <      <jvmarg value="-Xbootclasspath/p:${test.run.bootclasspath}"/>
612 >  <!-- Various demos and test programs -->
613 >
614 >
615 >  <target name="sample" depends="init, configure-compiler"
616 >          description="Standalone demo program">
617 >
618 >    <mkdir dir="${build.testcases.dir}"/>
619 >
620 >    <javac srcdir="${test.src.dir}"
621 >          destdir="${build.testcases.dir}"
622 >            debug="${build.debug}"
623 >       debuglevel="${build.debuglevel}"
624 >      deprecation="${build.deprecation}"
625 >           source="${build.sourcelevel}"
626 >             fork="true">
627 >
628 >      <include name="jsr166/test/Sample.java"/>
629  
630 +    </javac>
631 +
632 +    <copy todir="${build.testcases.dir}">
633 +      <fileset dir="${test.src.dir}">
634 +        <include name="**/*.properties"/>
635 +      </fileset>
636 +    </copy>
637 +
638 +
639 +    <java classname="jsr166.test.Sample" fork="true">
640 +      <classpath refid="test.classpath"/>
641 +      <!-- <jvmarg value="-ea"/> -->
642 +      <!-- <jvmarg value="-server"/> -->
643 +      <!-- <arg value="1000"/> -->
644 +    </java>
645 +  </target>
646 +
647 +
648 +  <target name="loops" depends="init, configure-compiler"
649 +          description="Benchmark from Doug Lea's AQS paper">
650 +
651 +    <mkdir dir="${build.loops.dir}"/>
652 +
653 +    <javac srcdir="${loops.src.dir}"
654 +          destdir="${build.loops.dir}"
655 +            debug="${build.debug}"
656 +       debuglevel="${build.debuglevel}"
657 +      deprecation="${build.deprecation}"
658 +           source="${build.sourcelevel}"
659 +             fork="true">
660 +
661 +      <compilerarg line="${build.args}"/>
662 +      <classpath refid="loops.classpath"/>
663 +
664 +    </javac>
665 +
666 +    <java classname="ALoops" fork="true">
667 +      <classpath refid="loops.classpath"/>
668 +    </java>
669 +
670 +  </target>
671 +
672 +
673 +  <target name="compile-j1" depends="init, configure-compiler">
674 +
675 +    <mkdir dir="${build.j1.dir}"/>
676 +
677 +    <javac srcdir="${j1.src.dir}"
678 +          destdir="${build.j1.dir}"
679 +            debug="${build.debug}"
680 +       debuglevel="${build.debuglevel}"
681 +      deprecation="${build.deprecation}"
682 +           source="${build.sourcelevel}" >
683 +
684 +      <include name="**/*.java"/>
685 +      <exclude name="**/dijkstra/**"/>
686 +
687 +      <compilerarg line="${build.args}"/>
688 +      <classpath refid="j1.classpath"/>
689 +
690 +    </javac>
691 +
692 +  </target>
693 +
694 +
695 +  <target name="sw" depends="compile-j1"
696 +          description="Runs the SwingWorker demo">
697 +
698 +    <!--
699 +    <java classname="jsr166.swing.SwingWorkerDemo" fork="true">
700 +      <classpath refid="j1.classpath"/>
701 +    </java>
702 +    -->
703 +
704 +    <copy todir="${build.j1.dir}" file="${j1.src.dir}/jsr166/swing/SwingWorker.html"/>
705 +
706 +    <exec dir="${build.j1.dir}" executable="appletviewer.exe">
707 +      <arg value="${build.j1.dir}/SwingWorker.html"/>
708 +    </exec>
709 +
710 +  </target>
711 +
712 +  <target name="j1" depends="compile-j1"
713 +          description="Runs a standalone JavaOne program">
714 +
715 +    <java classname="jsr166.bbuf.BoundedBufferDemo" fork="true">
716 +      <classpath refid="j1.classpath"/>
717 +      <jvmarg value="-server"/>
718 +      <arg value="http://www.perl.com/"/>
719 +      <arg value="1"/>
720      </java>
721 +
722    </target>
723  
724  
725 +  <target name="test-j1" depends="compile-j1"
726 +          description="Runs testcases from the JavaOne source directories">
727 +
728 +    <junit printsummary="true"
729 +             showoutput="true"
730 +          errorProperty="junit.failed"
731 +        failureProperty="junit.failed"
732 +                    dir="${build.j1.dir}"
733 +                   fork="true">
734 +
735 +      <!-- <jvmarg value="-server"/> -->
736 +      <classpath refid="j1.classpath"/>
737 +      <formatter type="xml"/>
738 +
739 +      <batchtest todir="${build.j1.dir}">
740 +        <fileset dir="${j1.src.dir}">
741 +          <include name="**/*Test.java"/>
742 +        </fileset>
743 +      </batchtest>
744 +
745 +    </junit>
746 +
747 +    <available property="junit.report.format"
748 +                  value="frames"
749 +              classname="org.apache.xalan.lib.Redirect"/>
750 +    <property name="junit.report.format" value="noframes"/>
751 +
752 +    <junitreport todir="${build.j1.dir}">
753 +      <fileset dir="${build.j1.dir}">
754 +        <include name="TEST-*.xml"/>
755 +      </fileset>
756 +      <report styledir="${stylesheet.dir}"
757 +                format="${junit.report.format}"
758 +                 todir="${build.j1.dir}"
759 +      />
760 +    </junitreport>
761 +
762 +    <fail message="Test Cases Failed" if="junit.failed"/>
763 +
764 +  </target>
765 +
766 +
767 +
768 +  <!-- C++ and JNI definitions and demos -->
769 +
770 +  <target name="configure-cpp">
771 +
772 +    <!-- Define tasks and types -->
773 +
774 +    <path id="cpptasks.path">
775 +      <pathelement location="${lib.dir}/cpptasks.jar"/>
776 +    </path>
777 +    <taskdef resource="cpptasks.tasks" classpathref="cpptasks.path"/>
778 +    <typedef resource="cpptasks.types" classpathref="cpptasks.path"/>
779 +
780 +    <!-- Set platform property for JNI includes -->
781 +
782 +    <condition property="platform" value="linux">
783 +      <os name="Linux"/>
784 +    </condition>
785 +    <condition property="platform" value="win32">
786 +      <os family="windows"/>
787 +    </condition>
788 +    <condition property="platform" value="solaris">
789 +      <os name="SunOS"/>
790 +    </condition>
791 +
792 +  </target>
793 +
794 +
795 +  <target name="cppdemo" depends="configure-cpp">
796 +
797 +    <mkdir dir="${build.dir}"/>
798 +
799 +    <cc multithreaded="true"
800 +                 name="g++"
801 +               objdir="${build.dir}"
802 +              outfile="${build.dir}/CppDemo">
803 +      <fileset dir="${test.src.dir}" includes="CppDemo.cpp"/>
804 +      <libset libs="stdc++"/>
805 +    </cc>
806 +
807 +    <exec executable="${build.dir}/CppDemo">
808 +      <arg line="count in word frequency of word in command line count"/>
809 +    </exec>
810 +
811 +  </target>
812 +
813 +
814 +  <target name="jnidemo" depends="init, configure-compiler, configure-cpp">
815 +
816 +    <mkdir dir="${build.testcases.dir}"/>
817 +
818 +    <javac srcdir="${test.src.dir}"
819 +          destdir="${build.testcases.dir}"
820 +            debug="${build.debug}"
821 +       debuglevel="${build.debuglevel}"
822 +      deprecation="${build.deprecation}"
823 +           source="${build.sourcelevel}"
824 +             fork="true">
825 +      <compilerarg value="${bootclasspath.args}"/>
826 +      <compilerarg line="${build.args}"/>
827 +      <classpath refid="test.classpath"/>
828 +      <include name="JniDemo.java"/>
829 +    </javac>
830 +
831 +    <javah destdir="${build.testcases.dir}"
832 +      classpathref="test.classpath">
833 +      <class name="JniDemo"/>
834 +    </javah>
835 +
836 +    <cc multithreaded="true"
837 +                 name="g++"
838 +               objdir="${build.dir}"
839 +              outfile="${build.dir}/JniDemo"
840 +              outtype="shared">
841 +
842 +      <compiler>
843 +        <defineset>
844 +          <define name="__int64" value="long long"/>
845 +        </defineset>
846 +        <includepath location="${java.home}/../include"/>
847 +        <includepath location="${java.home}/../include/${platform}"/>
848 +        <compilerarg value="-mno-cygwin"/>
849 +      </compiler>
850 +
851 +      <linker>
852 +        <linkerarg value="--add-stdcall-alias"/>
853 +      </linker>
854 +
855 +      <includepath location="${build.testcases.dir}"/>
856 +
857 +      <fileset dir="${test.src.dir}" includes="JniDemo.cpp"/>
858 +
859 +      <libset libs="stdc++"/>
860 +
861 +    </cc>
862 +
863 +    <!-- Necessary if windows, harmless if not -->
864 +    <copy file="${build.dir}/libJniDemo.so" tofile="${build.dir}/JniDemo.dll"/>
865 +
866 +    <java classname="JniDemo" fork="true">
867 +      <!-- Watch out: path separator hardwired to semicolon here! -->
868 +      <sysproperty key="java.library.path" path="${java.library.path};${build.dir}"/>
869 +      <classpath refid="test.classpath"/>
870 +      <arg line="count in word frequency of word in command line count"/>
871 +    </java>
872 +
873 +  </target>
874 +
875 +
876 +
877 +  <!-- Backward compatibility, work in progress (some files not checked in) -->
878 +
879 +
880 +
881 +  <property name="pretiger.src.dir"     location="${build.dir}/pretiger/src"/>
882 +  <property name="build.pretiger.dir"   location="${build.dir}/pretiger/classes"/>
883 +  <property name="pretiger.jar"         location="${build.lib.dir}/jsr166-pretiger.jar"/>
884 +  <property name="pretiger.sourcelevel" value="1.4"/>
885 +
886 +  <target name="defang"
887 +       depends="init"
888 +   description="Generates pre-Tiger compatible source">
889 +
890 +    <delete dir="${pretiger.src.dir}"/>
891 +    <mkdir dir="${pretiger.src.dir}"/>
892 +
893 +    <exec executable="perl">
894 +      <arg file="etc/defang.pl"/>
895 +      <!-- <arg value="-v"/> -->
896 +      <arg value="-s"/> <arg file="${src.dir}"/>
897 +      <arg value="-t"/> <arg file="${pretiger.src.dir}"/>
898 +    </exec>
899 +
900 +  </target>
901 +
902 +  <target name="compile-pretiger"
903 +          depends="init, configure-compiler, defang"
904 +          description="Compiles pre-Tiger sources to build folder">
905 +
906 +    <mkdir dir="${build.pretiger.dir}"/>
907 +
908 +    <javac srcdir="${pretiger.src.dir}"
909 +          destdir="${build.pretiger.dir}"
910 +            debug="${build.debug}"
911 +       debuglevel="${build.debuglevel}"
912 +      deprecation="${build.deprecation}"
913 +           source="${pretiger.sourcelevel}"
914 +             fork="true">
915 +
916 +      <compilerarg line="${build.args}"/>
917 +      <exclude name="**/Thread.java"/>
918 +
919 +    </javac>
920 +
921 +  </target>
922 +
923 +  <target name="pretiger" depends="compile-pretiger">
924 +
925 +    <mkdir dir="${build.lib.dir}"/>
926 +
927 +    <jar destfile="${pretiger.jar}">
928 +      <fileset dir="${build.pretiger.dir}">
929 +      </fileset>
930 +    </jar>
931 +
932 +  </target>
933 +
934   </project>

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines