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.64 by tim, Wed Mar 24 20:32:33 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.lib.dir"        location="${build.dir}/lib"/>
35    <property name="build.ant.dir"        location="${build.dir}/ant"/>
36    <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"/>
37    <property name="build.reports.dir"    location="${build.dir}/reports"/>
38 +  <property name="build.checkstyle.dir" location="${build.dir}/checkstyle"/>
39    <property name="build.doccheck.dir"   location="${build.dir}/doccheck"/>
40    <property name="build.filter.src.dir" location="${build.dir}/filtersrc"/>
41 <  <property name="build.filter.doccheck.dir" location="${build.dir}/filterdocchk"/>
41 >  <property name="build.dc-filter.dir"  location="${build.dir}/filterdocchk"/>
42  
43    <!-- Source locations -->
44    <property name="src.dir"              location="${basedir}/src/main"/>
47  <property name="emulation.src.dir"    location="${basedir}/src/emulation"/>
45    <property name="test.src.dir"         location="${basedir}/src/test"/>
46 +  <property name="j1.src.dir"           location="${basedir}/src/javaone"/>
47 +  <property name="tck.src.dir"          location="${test.src.dir}/tck"/>
48 +  <property name="jtreg.src.dir"        location="${test.src.dir}/jtreg"/>
49    <property name="ant.src.dir"          location="${basedir}/etc/ant"/>
50    <property name="stylesheet.dir"       location="${basedir}/etc/xsl"/>
51    <property name="lib.dir"              location="${basedir}/lib"/>
# Line 57 | Line 57
57    <!-- Jar locations -->
58    <property name="product.jar"          location="${build.lib.dir}/jsr166.jar"/>
59    <property name="junit.jar"            location="${lib.dir}/junit.jar"/>
60 <  <property name="rt.jar"               location="${java.home}/lib/rt.jar"/>
61 <  <property name="sinjdoc.jar"          location="${lib.dir}/sinjdoc.jar"/>
62 <
63 <
64 <  <!-- Files excluded from dist-docs and emulation jar -->
65 <  <patternset id="unsafe.exclusion">
66 <    <exclude name="java/util/Random.*"/>
67 <    <exclude name="sun/misc/Unsafe.*"/>
68 <  </patternset>
69 <
70 <  <!-- Files excludes from emulation jar -->
71 <  <patternset id="atomic.exclusion">
72 <    <exclude name="java/util/concurrent/atomic/AtomicBoolean*"/>
73 <    <exclude name="java/util/concurrent/atomic/AtomicInteger*"/>
74 <    <exclude name="java/util/concurrent/atomic/AtomicLong*"/>
75 <    <exclude name="java/util/concurrent/atomic/AtomicReference*"/>
76 <    <exclude name="java/util/concurrent/locks/LockSupport*"/>
77 <    <exclude name="java/util/concurrent/locks/ReentrantLock*"/>
78 <  </patternset>
60 >  
61 >  <!-- Bootclasspath argument -->
62 >  <property name="bootclasspath.args"   value="-Xbootclasspath/p:${product.jar}"/>
63  
64 +  <!-- Test classpath -->
65 +  <path id="test.classpath">
66 +    <pathelement location="${build.testcases.dir}"/>
67 +    <pathelement location="${junit.jar}"/>
68 +  </path>
69 +
70 +  <!-- Test classpath -->
71 +  <path id="j1.classpath">
72 +    <pathelement location="${build.j1.dir}"/>
73 +    <pathelement location="${junit.jar}"/>
74 +  </path>
75  
76  
77    <!-- Main targets -->
78  
79 +
80    <target name="compile"
81 <          depends="init, configure-compiler, prepare-src"
81 >          depends="init, configure-compiler"
82            description="Compiles main sources to build folder">
83  
88    <property name="prepare.src.dir" value="${src.dir}"/>
89
84      <mkdir dir="${build.classes.dir}"/>
85  
86 < <!--
93 <    <echo>javac ${gjc.args}</echo>
94 <    <echo>bootclasspath=${compile.bootclasspath}</echo>
95 < -->
96 <
97 <    <javac srcdir="${prepare.src.dir}"
86 >    <javac srcdir="${src.dir}"
87            destdir="${build.classes.dir}"
88              debug="${build.debug}"
89         debuglevel="${build.debuglevel}"
# Line 102 | Line 91
91             source="${build.sourcelevel}"
92               fork="true">
93  
94 <      <compilerarg    line="${gjc.args}"/>
106 < <!--
107 <      <bootclasspath refid="compile.bootclasspath"/>
108 < -->
94 >      <compilerarg line="${build.args}"/>
95  
96      </javac>
97  
98    </target>
99  
100  
115  <target name="jar"
116          depends="configure-emulation, init-jar, native-jar, emulation-jar"
117          description="Builds library jar from compiled sources"/>
101  
102 +  <target name="jar"
103 +          depends="compile"
104 +          description="Builds library jar from compiled sources">
105  
106 <  <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 <
124 <
125 <  <target name="checkstyle"
126 <          depends="filter-src"
127 <          description="Reports on style errors in Java source (verbose, mostly chaff)">
128 <
129 <    <taskdef resource="checkstyletask.properties"
130 <            classpath="${lib.dir}/checkstyle-all-2.4.jar"/>
106 >    <mkdir dir="${build.lib.dir}"/>
107  
108 <    <checkstyle>
109 <      <formatter type="plain"/>  <!-- also available: type="xml" -->
110 <      <fileset dir="${build.filter.src.dir}" includes="**/*.java"/>
135 <    </checkstyle>
108 >    <jar destfile="${product.jar}">
109 >      <fileset dir="${build.classes.dir}"/>
110 >    </jar>
111  
112    </target>
113  
114  
140  <target name="doccheck"
141          depends="filter-doccheck"
142          description="Reports on javadoc style errors">
143
144    <delete dir="${build.doccheck.dir}"/>
145    <mkdir dir="${build.doccheck.dir}"/>
146
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>
115  
116 <    <echo>DocCheck output is in ${build.doccheck.dir}</echo>
116 >  <target name="test"
117 >          depends="init, configure-tests, report-tests"
118 >          description="Runs all tests (requires JUnit 3.8.1 in ${ant.home}/lib)" />
119  
155  </target>
120  
121  
122    <target name="docs"
159          depends="filter-src"
123            description="Builds javadocs with custom tags to build folder">
124  
125      <delete dir="${build.javadocs.dir}"/>
# Line 165 | Line 128
128      <javadoc destdir="${build.javadocs.dir}"
129                  link="http://java.sun.com/j2se/1.4.1/docs/api"
130              overview="${src.dir}/intro.html"
131 <              source="${build.docsourcelevel}">
131 >              source="${build.sourcelevel}">
132  
133        <tag name="revised" description="Last revised:"/>
134        <tag name="spec"    description="Specified by:"/>
172      <tag name="editor"  description="Last edited by:"/>
173      <tag name="fixme"   description="FIX ME:"/>
135  
136 <      <packageset dir="${build.filter.src.dir}"/>
136 >      <packageset dir="${src.dir}"/>
137  
138      </javadoc>
139  
140    </target>
141  
142  
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">
143  
144 <      <jvmarg value="-Xbootclasspath/p:${test.run.bootclasspath}"/>
144 >  <target name="doccheck"
145 >          depends="filter-doccheck"
146 >          description="Reports on javadoc style errors">
147  
148 <      <classpath>
149 <        <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"/>
148 >    <delete dir="${build.doccheck.dir}"/>
149 >    <mkdir dir="${build.doccheck.dir}"/>
150  
151 <      <!--
152 <      <arg value="-help"/>
153 <      -->
151 >    <javadoc doclet="com.sun.tools.doclets.doccheck.DocCheck"
152 >         docletpath="${lib.dir}/doccheck.jar"
153 >            destdir="${build.doccheck.dir}">
154 >      <packageset dir="${build.dc-filter.dir}"/>
155 >    </javadoc>
156  
157 <    </java>
157 >    <echo>DocCheck output is in ${build.doccheck.dir}</echo>
158  
159    </target>
160  
161  
222  <target name="strip"
223          depends="init, configure-compiler"
224          description="Strip generics from java source (not working yet)">
225
226    <mkdir dir="${build.stripped.dir}"/>
162  
163 <    <!--
164 <     # javac -s doesn't reliably generate compilable code. It generates
165 <     # 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">
163 >  <target name="checkstyle"
164 >          depends="filter-src"
165 >          description="Reports on style errors in Java source (verbose, mostly chaff)">
166  
167 <      <compilerarg    line="${gjc.args} -s"/>
168 < <!--
243 <      <bootclasspath refid="compile.bootclasspath"/>
244 < -->
167 >    <taskdef resource="checkstyletask.properties"
168 >            classpath="${lib.dir}/checkstyle-all-3.1.jar"/>
169  
170 <    </javac>
170 >    <mkdir dir="${build.checkstyle.dir}"/>
171 >    
172 >    <checkstyle config="etc/checkstyle/sun_checks.xml"
173 >       failOnViolation="false">
174 >      <formatter type="xml" toFile="${build.checkstyle.dir}/checkstyle-report.xml"/>
175 >      <fileset dir="${build.filter.src.dir}" includes="**/*.java"/>
176 >    </checkstyle>
177 >    
178 >    <style in="${build.checkstyle.dir}/checkstyle-report.xml"
179 >          out="${build.checkstyle.dir}/checkstyle-report.html"
180 >        style="${stylesheet.dir}/checkstyle-frames.xsl"/>
181  
182    </target>
183  
184 +  
185  
186    <target name="dist"
187            depends="init, dist-clean, dist-jar, dist-docs"
188            description="Puts all distributable products in single hierarchy"/>
189  
190 +
191 +
192    <target name="release"
193            depends="dist"
194            description="Puts entire CVS tree, plus distribution productions, in a jar">
195  
259 <!--
260    #keep build dir? - dl
261    <delete dir="${build.dir}"/>
262 -->
196      <property name="release.jar" value="dist/jsr166-${version}-dist.jar"/>
197  
198      <jar basedir="${basedir}" destfile="${release.jar}">
199 +      <!-- <exclude name="build/**"/> -->
200        <exclude name="${release.jar}"/>
201        <exclude name="user.properties"/>
202        <exclude name="etc/notes/**"/>
203 <      <exclude name="lib/gjc/2.1/**"/>
203 >      <exclude name="src/emulation/**"/>
204        <exclude name="**/SyntaxTest.java"/>
205 +      <exclude name="**/SuperfluousAbstract.java"/>
206      </jar>
207  
208    </target>
209  
210 +
211 +
212    <target name="clean"
213            description="Removes all build products">
214  
# Line 282 | Line 219
219    </target>
220  
221  
222 +
223    <target name="dist-clean"
224            description="Removes all build and distribution products">
225  
# Line 290 | Line 228
228    </target>
229  
230  
231 +
232    <target name="dist-docs"
294          depends="filter-src"
233            description="Builds javadocs without custom tags to dist folder">
234  
235      <delete dir="${dist.javadocs.dir}"/>
236      <mkdir dir="${dist.javadocs.dir}"/>
237  
238      <javadoc destdir="${dist.javadocs.dir}"
239 <                link="http://java.sun.com/j2se/1.4.1/docs/api"
239 >                link="http://java.sun.com/j2se/1.4.2/docs/api"
240              overview="${src.dir}/intro.html"
241 <              source="${build.docsourcelevel}">
241 >              source="${build.sourcelevel}">
242  
243 <      <packageset dir="${build.filter.src.dir}"/>
243 >      <packageset dir="${src.dir}"/>
244  
245      </javadoc>
246  
# Line 321 | Line 259
259      <echo>java.home is ${java.home}</echo>
260  
261    </target>
262 <
263 <
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 <
262 >  
263 >  
264    <target name="dist-jar"
265            depends="clean, jar">
266  
# Line 416 | Line 296
296      <copy todir="${build.filter.src.dir}">
297        <fileset dir="${src.dir}">
298          <exclude name="**/*.html"/>
299 <        <patternset refid="unsafe.exclusion"/>
299 >        <!-- Files excluded from dist-docs -->
300 >        <exclude name="java/util/Random.*"/>
301 >        <exclude name="sun/misc/Unsafe.*"/>
302        </fileset>
303 +      <!--
304        <filterchain>
305 +      -->
306  
307          <!--
308           # This filter gets rid of angle-bracketed type parameters
# Line 432 | Line 316
316           #   tweaking.)
317           -->
318  
319 +        <!--
320          <filterreader classname="jsr166.ant.filters.ReplaceFilter"
321                        classpath="${build.ant.dir}">
322            <param name="notmatching" value="^\s+\*\s.*$"/>
323            <param name="pattern"     value="&lt;[^|>()]+?>+"/>
324            <param name="replacement" value=" "/>
325          </filterreader>
326 +        -->
327  
328 <
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>
328 >      <!--
329        </filterchain>
330 +      -->
331      </copy>
332  
333    </target>
334  
335  
461
462
336    <target name="filter-doccheck"
337            depends="filter-src">
338  
339 <    <mkdir dir="${build.filter.doccheck.dir}"/>
339 >    <mkdir dir="${build.dc-filter.dir}"/>
340  
341 <    <copy todir="${build.filter.doccheck.dir}">
341 >    <copy todir="${build.dc-filter.dir}">
342        <fileset dir="${build.filter.src.dir}">
343          <include name="**/*.html"/>
344        </fileset>
# Line 475 | Line 348
348               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 {}"
349      />
350  
351 <    <copy todir="${build.filter.doccheck.dir}">
351 >    <copy todir="${build.dc-filter.dir}">
352        <fileset dir="${build.filter.src.dir}">
353          <exclude name="**/*.html"/>
354        </fileset>
# Line 513 | Line 386
386  
387      <mkdir dir="${build.testcases.dir}"/>
388  
389 < <!--
390 <    <echo>javac ${gjc.args}</echo>
391 <    <echo>bootclasspath=${test.compile.bootclasspath}</echo>
392 <    <echo>classpath="${test.classpath}"</echo>
393 < -->
389 >    <javac srcdir="${tck.src.dir}"
390 >          destdir="${build.testcases.dir}"
391 >            debug="${build.debug}"
392 >       debuglevel="${build.debuglevel}"
393 >      deprecation="${build.deprecation}"
394 >           source="${build.sourcelevel}"
395 >             fork="true">
396 >
397 >      <compilerarg value="${bootclasspath.args}"/>
398 >      <compilerarg line="${build.args}"/>
399 >      
400 >      <classpath refid="test.classpath"/>
401 >
402 >    </javac>
403  
404      <javac srcdir="${test.src.dir}"
405            destdir="${build.testcases.dir}"
# Line 527 | Line 409
409             source="${build.sourcelevel}"
410               fork="true">
411  
412 <      <compilerarg    line="${gjc.args}"/>
413 < <!--      
414 <      <bootclasspath refid="test.compile.bootclasspath"/>
415 < -->      
416 <      <classpath     refid="test.classpath"/>
412 >      <include name="jsr166/test/**"/>
413 >      
414 >      <compilerarg value="${bootclasspath.args}"/>
415 >      <compilerarg line="${build.args}"/>
416 >      
417 >      <classpath refid="test.classpath"/>
418 >
419 >    </javac>
420 >
421 > <!--
422 >    <javac srcdir="${jtreg.src.dir}"
423 >          destdir="${build.testcases.dir}"
424 >            debug="${build.debug}"
425 >       debuglevel="${build.debuglevel}"
426 >      deprecation="${build.deprecation}"
427 >           source="${build.sourcelevel}"
428 >             fork="true">
429 >
430 >      <compilerarg value="${bootclasspath.args}"/>
431 >      <compilerarg line="${build.args}"/>
432        
433 <      <include name="java/**"/>
537 <      <include name="jsr166/**"/>
433 >      <classpath refid="test.classpath"/>
434  
435      </javac>
436 + -->
437  
438    </target>
439  
# Line 556 | Line 453
453                      dir="${build.reports.dir}"
454                     fork="true">
455  
456 <      <jvmarg value="-Xbootclasspath:${test.run.bootclasspath}"/>
456 >      <jvmarg value="${bootclasspath.args}"/>
457 >      <jvmarg value="-server"/>
458 >      <jvmarg value="-showversion"/>
459 >      
460 >      <classpath refid="test.classpath"/>
461  
462        <formatter type="xml"/>
463  
464 <      <batchtest todir="${build.reports.dir}">
464 >      <batchtest todir="${build.reports.dir}" unless="no.test.tck">
465 >        <fileset dir="${tck.src.dir}">
466 >          <include name="**/${testcase}Test.java"/>
467 >        </fileset>
468 >      </batchtest>
469 >      
470 >      <batchtest todir="${build.reports.dir}" if="do.test.old">
471          <fileset dir="${test.src.dir}">
472 <          <include name="java/**/${testcase}Test.java"/>
473 <          <include name="jsr166/**/${testcase}Test.java"/>
472 >          <include name="jsr166/test/**/${testcase}Test.java"/>
473 >        </fileset>
474 >      </batchtest>
475 >
476 > <!--      
477 >      <batchtest todir="${build.reports.dir}" if="do.test.jtreg">
478 >        <fileset dir="${jtreg.src.dir}">
479 >          <include name="**/${testcase}Test.java"/>
480          </fileset>
481        </batchtest>
482 + -->
483  
484      </junit>
485  
# Line 600 | Line 514
514  
515    <target name="configure-compiler">
516  
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
517      <property name="unchecked.option" value="-Xlint:unchecked"/>
518  
519      <condition property="warnunchecked.arg" value="${unchecked.option}">
520 <      <istrue value="${gjc.warnunchecked}"/>
520 >      <istrue value="${build.warnunchecked}"/>
521      </condition>
522  
523      <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"/>
524  
525  
526      <!-- Common options in javac invocations -->
527 < <!--
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 <      <istrue value="${build.emulation}"/>
697 <    </condition>
527 >    <property name="build.args" value="${warnunchecked.arg}"/>
528  
529    </target>
530  
# Line 706 | Line 536
536      <available property="junit.available"
537                 classname="junit.framework.Protectable"/>
538  
709    <fail message="Need JUnit 3.8.1 in ${ant.home}${file.separator}lib to run tests"
710          unless="junit.available"/>
711
539      <!-- Xalan -->
540      <available property="xalan.available"
541                 classname="org.apache.xalan.Version"/>
542  
543 +              
544 +    <!-- Ant 1.6beta and later don't need or want this check -->
545 +    <!--    
546 +    <fail message="Need JUnit 3.8.1 in ${ant.home}${file.separator}lib to run tests"
547 +          unless="junit.available"/>
548 +
549      <fail message="Need Xalan 2.5.1 jar in ${ant.home}${file.separator}lib to run tests"
550            unless="xalan.available"/>
551 <
719 <
720 <    <!--
721 <     ! 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>
731 <
732 <    <path id="test.compile.bootclasspath">
733 <      <pathelement location="${javac.jar}"/>
734 <      <pathelement location="${collect.jar}"/>
735 <      <pathelement location="${rt.jar}"/>
736 <    </path>
737 <
738 <    <path id="test.run.bootclasspath">
739 < <!--    
740 <      <pathelement location="${javac.jar}"/>
741 < -->      
742 <      <path refid="test.classpath"/>
743 <    </path>
744 <
745 <    <!-- Flatten test classpaths into platform-appropriate strings -->
746 <    <property name="test.classpath"             refid="test.classpath"/>
747 <    <property name="test.compile.bootclasspath" refid="test.compile.bootclasspath"/>
748 <    <property name="test.run.bootclasspath"     refid="test.run.bootclasspath"/>
551 >    -->
552  
553    </target>
554  
# Line 797 | Line 600
600    </target>
601  
602  
603 <  <target name="ng" depends="test">
604 <    <java classname="SuperfluousAbstract" fork="true">
603 >  <!-- Standalone sample program -->
604 >  
605 >  <target name="sample" depends="">
606 >  
607 >    <mkdir dir="${build.testcases.dir}"/>
608 >    
609 >    <javac srcdir="${test.src.dir}"
610 >          destdir="${build.testcases.dir}"
611 >            debug="${build.debug}"
612 >       debuglevel="${build.debuglevel}"
613 >      deprecation="${build.deprecation}"
614 >           source="${build.sourcelevel}"
615 >             fork="true">
616 >      
617 >      <!--
618 >      <compilerarg value="${bootclasspath.args}"/>
619 >      <compilerarg line="${build.args}"/>
620 >      
621 >      <classpath refid="test.classpath"/>
622 >      -->
623 >      
624 >      <include name="jsr166/test/Sample.java"/>
625 >      
626 >    </javac>
627 >    
628 >    <copy todir="${build.testcases.dir}">
629 >      <fileset dir="${test.src.dir}">
630 >        <include name="**/*.properties"/>
631 >      </fileset>
632 >    </copy>
633 >  
634 >            
635 >    <java classname="jsr166.test.Sample" fork="true">
636 >      <jvmarg value="${bootclasspath.args}"/>
637 >      <!-- <jvmarg value="-server"/> -->
638 >      <!-- <jvmarg value="-ea"/> -->
639 >      <classpath refid="test.classpath"/>
640 >      <!-- <arg value="1000"/> -->
641 >    </java>
642 >  </target>
643  
803      <jvmarg value="-Xbootclasspath/p:${test.run.bootclasspath}"/>
644  
645 +  <!-- BoF demos -->
646 +  
647 +  <target name="j1" depends="jar">
648 +  
649 +    <mkdir dir="${build.j1.dir}"/>
650 +    
651 +    <javac srcdir="${j1.src.dir}"
652 +          destdir="${build.j1.dir}"
653 +            debug="${build.debug}"
654 +       debuglevel="${build.debuglevel}"
655 +      deprecation="${build.deprecation}"
656 +           source="${build.sourcelevel}"
657 +             fork="true">
658 +            
659 +      <compilerarg value="${bootclasspath.args}"/>
660 +      <compilerarg line="${build.args}"/>
661 +      
662 +      <classpath refid="j1.classpath"/>
663 +      
664 +    </javac>
665 +    
666 + <!--
667 +    <java classname="MainClass" fork="true">
668 +      <jvmarg value="${bootclasspath.args}"/>
669 +      <classpath refid="j1.classpath"/>
670      </java>
671 + -->
672 +
673 +    <junit printsummary="true"
674 +             showoutput="true"
675 +          errorProperty="junit.failed"
676 +        failureProperty="junit.failed"
677 +                    dir="${build.j1.dir}"
678 +                   fork="true">
679 +
680 +      <jvmarg value="${bootclasspath.args}"/>
681 +      <jvmarg value="-server"/>
682 +      
683 +      <classpath refid="j1.classpath"/>
684 +
685 +      <formatter type="xml"/>
686 +
687 +      <batchtest todir="${build.j1.dir}">
688 +        <fileset dir="${j1.src.dir}">
689 +          <include name="**/*Test.java"/>
690 +        </fileset>
691 +      </batchtest>
692 +
693 +    </junit>
694 +
695 +    <!-- Sets junit.report.format to frames if redirection is present,
696 +         otherwise sets it to noframes. -->
697 +    <available property="junit.report.format"
698 +                  value="frames"
699 +              classname="org.apache.xalan.lib.Redirect"
700 +    />
701 +    <property name="junit.report.format" value="noframes"/>
702 +
703 +    <junitreport todir="${build.j1.dir}">
704 +      <fileset dir="${build.j1.dir}">
705 +        <include name="TEST-*.xml"/>
706 +      </fileset>
707 +      <report styledir="${stylesheet.dir}"
708 +                format="${junit.report.format}"
709 +                 todir="${build.j1.dir}"
710 +      />
711 +    </junitreport>
712 +
713 +    <fail message="Test Cases Failed" if="junit.failed"/>
714 +
715    </target>
716  
717 +  
718 +  
719 +  <!-- C++ and JNI definitions and demos -->
720 +  
721 +  <target name="configure-cpp">
722 +
723 +    <!-- Define tasks and types -->
724 +    
725 +    <path id="cpptasks.path">
726 +      <pathelement location="${lib.dir}/cpptasks.jar"/>
727 +    </path>
728 +    <taskdef resource="cpptasks.tasks" classpathref="cpptasks.path"/>
729 +    <typedef resource="cpptasks.types" classpathref="cpptasks.path"/>
730 +    
731 +    <!-- Set platform property for JNI includes -->
732 +    
733 +    <condition property="platform" value="linux">
734 +      <os name="Linux"/>
735 +    </condition>
736 +    <condition property="platform" value="win32">
737 +      <os family="windows"/>
738 +    </condition>
739 +    <condition property="platform" value="solaris">
740 +      <os name="SunOS"/>
741 +    </condition>
742 +    
743 +  </target>
744 +  
745 +  
746 +  <target name="cppdemo" depends="configure-cpp">
747 +  
748 +    <mkdir dir="${build.dir}"/>
749 +    
750 +    <cc multithreaded="true"
751 +                 name="g++"
752 +               objdir="${build.dir}"
753 +              outfile="${build.dir}/CppDemo">
754 +      <fileset dir="${test.src.dir}" includes="CppDemo.cpp"/>
755 +      <libset libs="stdc++"/>
756 +    </cc>
757 +    
758 +    <exec executable="${build.dir}/CppDemo">
759 +      <arg line="count in word frequency of word in command line count"/>
760 +    </exec>
761 +    
762 +  </target>
763 +  
764 +  
765 +  <target name="jnidemo" depends="init, configure-compiler, configure-cpp">
766 +  
767 +    <mkdir dir="${build.testcases.dir}"/>
768 +    
769 +    <javac srcdir="${test.src.dir}"
770 +          destdir="${build.testcases.dir}"
771 +            debug="${build.debug}"
772 +       debuglevel="${build.debuglevel}"
773 +      deprecation="${build.deprecation}"
774 +           source="${build.sourcelevel}"
775 +             fork="true">
776 +      <compilerarg value="${bootclasspath.args}"/>
777 +      <compilerarg line="${build.args}"/>
778 +      <classpath refid="test.classpath"/>
779 +      <include name="JniDemo.java"/>
780 +    </javac>
781 +    
782 +    <javah destdir="${build.testcases.dir}"
783 +      classpathref="test.classpath">
784 +      <class name="JniDemo"/>
785 +    </javah>
786 +    
787 +    <cc multithreaded="true"
788 +                 name="g++"
789 +               objdir="${build.dir}"
790 +              outfile="${build.dir}/JniDemo"
791 +              outtype="shared">
792 +              
793 +      <compiler>
794 +        <defineset>
795 +          <define name="__int64" value="long long"/>
796 +        </defineset>
797 +        <includepath location="${java.home}/../include"/>
798 +        <includepath location="${java.home}/../include/${platform}"/>
799 +        <compilerarg value="-mno-cygwin"/>
800 +      </compiler>
801 +      
802 +      <linker>
803 +        <linkerarg value="--add-stdcall-alias"/>
804 +      </linker>
805 +      
806 +      <includepath location="${build.testcases.dir}"/>
807 +      
808 +      <fileset dir="${test.src.dir}" includes="JniDemo.cpp"/>
809 +      
810 +      <libset libs="stdc++"/>
811 +      
812 +    </cc>
813 +    
814 +    <!-- Necessary if windows, harmless if not -->
815 +    <copy file="${build.dir}/libJniDemo.so" tofile="${build.dir}/JniDemo.dll"/>
816 +    
817 +    <java classname="JniDemo" fork="true">
818 +      <!-- Watch out: path separator hardwired to semicolon here! -->
819 +      <sysproperty key="java.library.path" path="${java.library.path};${build.dir}"/>
820 +      <classpath refid="test.classpath"/>
821 +      <arg line="count in word frequency of word in command line count"/>
822 +    </java>
823 +    
824 +  </target>
825 +
826 +
827 +
828 +  <!-- Backward compatibility, work in progress (some files not checked in) -->
829 +
830 +
831 +
832 +  <property name="pretiger.src.dir"     location="${build.dir}/pretiger/src"/>
833 +  <property name="build.pretiger.dir"   location="${build.dir}/pretiger/classes"/>
834 +  <property name="pretiger.jar"         location="${build.lib.dir}/jsr166-pretiger.jar"/>
835 +  <property name="pretiger.sourcelevel" value="1.4"/>
836 +  
837 +  <target name="defang"
838 +       depends="init"
839 +   description="Generates pre-Tiger compatible source">
840 +  
841 +    <delete dir="${pretiger.src.dir}"/>
842 +    <mkdir dir="${pretiger.src.dir}"/>
843 +  
844 +    <exec executable="perl">
845 +      <arg file="etc/defang.pl"/>
846 +      <!-- <arg value="-v"/> -->
847 +      <arg value="-s"/> <arg file="${src.dir}"/>
848 +      <arg value="-t"/> <arg file="${pretiger.src.dir}"/>
849 +    </exec>
850 +    
851 +  </target>
852 +
853 +  <target name="compile-pretiger"
854 +          depends="init, configure-compiler, defang"
855 +          description="Compiles pre-Tiger sources to build folder">
856 +
857 +    <mkdir dir="${build.pretiger.dir}"/>
858 +
859 +    <javac srcdir="${pretiger.src.dir}"
860 +          destdir="${build.pretiger.dir}"
861 +            debug="${build.debug}"
862 +       debuglevel="${build.debuglevel}"
863 +      deprecation="${build.deprecation}"
864 +           source="${pretiger.sourcelevel}"
865 +             fork="true">
866 +
867 +      <compilerarg line="${build.args}"/>
868 +      <exclude name="**/Thread.java"/>
869 +
870 +    </javac>
871 +
872 +  </target>
873 +  
874 +  <target name="pretiger" depends="compile-pretiger">
875 +
876 +    <mkdir dir="${build.lib.dir}"/>
877 +    
878 +    <jar destfile="${pretiger.jar}">
879 +      <fileset dir="${build.pretiger.dir}">
880 +      </fileset>
881 +    </jar>
882 +    
883 +  </target>
884  
885   </project>

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines