ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/build.xml
Revision: 1.66
Committed: Sun Apr 11 01:37:41 2004 UTC (20 years ago) by jsr166
Content type: text/xml
Branch: MAIN
Changes since 1.65: +10 -3 lines
Log Message:
Added ArrayBlockingQueue mode for BoundedBufferDemo,
and updated comments with new timings.

File Contents

# User Rev Content
1 tim 1.18 <project name="jsr166" default="usage">
2 tim 1.1
3     <description>
4 tim 1.29 ------------------------------------------------------------------------------
5     Build file for JSR-166
6 tim 1.18
7 tim 1.29 Usage: ant [target]
8    
9     User-specific settings are read from user.properties.
10 tim 1.32 See user.properties.sample for an explanation of some useful settings.
11 tim 1.29 ------------------------------------------------------------------------------
12 tim 1.18 </description>
13 tim 1.11
14 tim 1.29 <target name="usage" description="Advises user to run with -projecthelp">
15     <echo>Run "ant -projecthelp" for full usage information.</echo>
16     </target>
17 tim 1.3
18 tim 1.11
19 tim 1.27 <!-- User-specific settings -->
20 tim 1.23 <property file="user.properties"/>
21 tim 1.27
22 tim 1.1
23     <!-- Compilation options -->
24 tim 1.11 <property name="build.sourcelevel" value="1.5"/>
25 tim 1.1 <property name="build.debug" value="true"/>
26     <property name="build.debuglevel" value="source,lines,vars"/>
27 tim 1.13 <property name="build.deprecation" value="false"/>
28 tim 1.1
29     <!-- Build locations -->
30     <property name="build.dir" location="build"/>
31     <property name="build.classes.dir" location="${build.dir}/classes"/>
32     <property name="build.testcases.dir" location="${build.dir}/testcases"/>
33 tim 1.64 <property name="build.j1.dir" location="${build.dir}/j1"/>
34 jsr166 1.65 <property name="build.loops.dir" location="${build.dir}/loops"/>
35 tim 1.1 <property name="build.lib.dir" location="${build.dir}/lib"/>
36     <property name="build.ant.dir" location="${build.dir}/ant"/>
37 tim 1.9 <property name="build.javadocs.dir" location="${build.dir}/javadocs"/>
38 tim 1.1 <property name="build.reports.dir" location="${build.dir}/reports"/>
39 tim 1.59 <property name="build.checkstyle.dir" location="${build.dir}/checkstyle"/>
40 tim 1.16 <property name="build.doccheck.dir" location="${build.dir}/doccheck"/>
41 tim 1.1 <property name="build.filter.src.dir" location="${build.dir}/filtersrc"/>
42 tim 1.58 <property name="build.dc-filter.dir" location="${build.dir}/filterdocchk"/>
43 tim 1.1
44     <!-- Source locations -->
45 tim 1.22 <property name="src.dir" location="${basedir}/src/main"/>
46     <property name="test.src.dir" location="${basedir}/src/test"/>
47 tim 1.64 <property name="j1.src.dir" location="${basedir}/src/javaone"/>
48 jsr166 1.65 <property name="loops.src.dir" location="${basedir}/src/loops"/>
49 tim 1.60 <property name="tck.src.dir" location="${test.src.dir}/tck"/>
50 tim 1.62 <property name="jtreg.src.dir" location="${test.src.dir}/jtreg"/>
51 tim 1.1 <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"/>
54 tim 1.9 <property name="dist.dir" location="${basedir}/dist"/>
55    
56     <!-- Distribution locations -->
57     <property name="dist.javadocs.dir" location="${dist.dir}/docs"/>
58 tim 1.1
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 jsr166 1.66 <property name="concurrent.jar" location="${lib.dir}/concurrent.jar"/>
63 jsr166 1.65
64 tim 1.59 <!-- Bootclasspath argument -->
65     <property name="bootclasspath.args" value="-Xbootclasspath/p:${product.jar}"/>
66 tim 1.27
67 tim 1.59 <!-- Test classpath -->
68     <path id="test.classpath">
69     <pathelement location="${build.testcases.dir}"/>
70     <pathelement location="${junit.jar}"/>
71     </path>
72 tim 1.28
73 jsr166 1.65 <!-- ALoops classpath -->
74     <path id="loops.classpath">
75     <pathelement location="${build.loops.dir}"/>
76     </path>
77    
78     <!-- J1 classpath -->
79 tim 1.64 <path id="j1.classpath">
80     <pathelement location="${build.j1.dir}"/>
81     <pathelement location="${junit.jar}"/>
82 jsr166 1.66 <pathelement location="${concurrent.jar}"/>
83 tim 1.64 </path>
84    
85 tim 1.28
86 tim 1.59 <!-- Main targets -->
87 tim 1.28
88 tim 1.11
89 tim 1.28 <target name="compile"
90 tim 1.60 depends="init, configure-compiler"
91 tim 1.27 description="Compiles main sources to build folder">
92    
93 tim 1.1 <mkdir dir="${build.classes.dir}"/>
94 tim 1.27
95 tim 1.60 <javac srcdir="${src.dir}"
96 tim 1.1 destdir="${build.classes.dir}"
97     debug="${build.debug}"
98     debuglevel="${build.debuglevel}"
99     deprecation="${build.deprecation}"
100     source="${build.sourcelevel}"
101     fork="true">
102    
103 tim 1.58 <compilerarg line="${build.args}"/>
104 tim 1.1
105     </javac>
106 tim 1.27
107 tim 1.1 </target>
108    
109    
110 tim 1.59
111 tim 1.28 <target name="jar"
112 tim 1.59 depends="compile"
113     description="Builds library jar from compiled sources">
114    
115     <mkdir dir="${build.lib.dir}"/>
116    
117     <jar destfile="${product.jar}">
118     <fileset dir="${build.classes.dir}"/>
119     </jar>
120    
121     </target>
122    
123 tim 1.1
124    
125 tim 1.28 <target name="test"
126 tim 1.32 depends="init, configure-tests, report-tests"
127 tim 1.29 description="Runs all tests (requires JUnit 3.8.1 in ${ant.home}/lib)" />
128 tim 1.1
129    
130 tim 1.59
131     <target name="docs"
132     description="Builds javadocs with custom tags to build folder">
133    
134     <delete dir="${build.javadocs.dir}"/>
135     <mkdir dir="${build.javadocs.dir}"/>
136    
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.sourcelevel}">
141    
142     <tag name="revised" description="Last revised:"/>
143     <tag name="spec" description="Specified by:"/>
144    
145     <packageset dir="${src.dir}"/>
146    
147     </javadoc>
148    
149     </target>
150    
151    
152    
153 tim 1.60 <target name="doccheck"
154     depends="filter-doccheck"
155     description="Reports on javadoc style errors">
156    
157     <delete dir="${build.doccheck.dir}"/>
158     <mkdir dir="${build.doccheck.dir}"/>
159    
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     <echo>DocCheck output is in ${build.doccheck.dir}</echo>
167    
168     </target>
169    
170    
171    
172 tim 1.28 <target name="checkstyle"
173     depends="filter-src"
174 tim 1.18 description="Reports on style errors in Java source (verbose, mostly chaff)">
175 tim 1.27
176 tim 1.15 <taskdef resource="checkstyletask.properties"
177 tim 1.58 classpath="${lib.dir}/checkstyle-all-3.1.jar"/>
178 tim 1.15
179 tim 1.58 <mkdir dir="${build.checkstyle.dir}"/>
180 jsr166 1.65
181 tim 1.58 <checkstyle config="etc/checkstyle/sun_checks.xml"
182     failOnViolation="false">
183 jsr166 1.65 <formatter type="xml" toFile="${build.checkstyle.dir}/checkstyle-report.xml"/>
184 tim 1.15 <fileset dir="${build.filter.src.dir}" includes="**/*.java"/>
185     </checkstyle>
186 jsr166 1.65
187     <style in="${build.checkstyle.dir}/checkstyle-report.xml"
188     out="${build.checkstyle.dir}/checkstyle-report.html"
189 tim 1.58 style="${stylesheet.dir}/checkstyle-frames.xsl"/>
190 tim 1.27
191 tim 1.15 </target>
192    
193 jsr166 1.65
194 tim 1.8
195 tim 1.28 <target name="dist"
196     depends="init, dist-clean, dist-jar, dist-docs"
197 tim 1.16 description="Puts all distributable products in single hierarchy"/>
198 tim 1.1
199 tim 1.58
200 tim 1.59
201 tim 1.42 <target name="release"
202     depends="dist"
203     description="Puts entire CVS tree, plus distribution productions, in a jar">
204    
205     <property name="release.jar" value="dist/jsr166-${version}-dist.jar"/>
206    
207     <jar basedir="${basedir}" destfile="${release.jar}">
208 tim 1.58 <!-- <exclude name="build/**"/> -->
209 tim 1.42 <exclude name="${release.jar}"/>
210     <exclude name="user.properties"/>
211     <exclude name="etc/notes/**"/>
212 tim 1.58 <exclude name="src/emulation/**"/>
213 tim 1.44 <exclude name="**/SyntaxTest.java"/>
214 tim 1.58 <exclude name="**/SuperfluousAbstract.java"/>
215 tim 1.42 </jar>
216    
217     </target>
218 tim 1.1
219 tim 1.59
220    
221 tim 1.11 <target name="clean"
222     description="Removes all build products">
223 tim 1.27
224 tim 1.11 <delete dir="${build.dir}"/>
225     <delete dir="${build.classes.dir}"/>
226     <delete dir="${build.lib.dir}"/>
227 tim 1.27
228 tim 1.1 </target>
229    
230    
231 tim 1.59
232 tim 1.11 <target name="dist-clean"
233     description="Removes all build and distribution products">
234 tim 1.27
235 tim 1.11 <delete dir="${dist.dir}"/>
236 tim 1.27
237 tim 1.9 </target>
238 tim 1.10
239    
240 tim 1.59
241 tim 1.28 <target name="dist-docs"
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 tim 1.59 link="http://java.sun.com/j2se/1.4.2/docs/api"
249 tim 1.28 overview="${src.dir}/intro.html"
250 tim 1.59 source="${build.sourcelevel}">
251 tim 1.28
252 tim 1.59 <packageset dir="${src.dir}"/>
253 tim 1.14
254 tim 1.28 </javadoc>
255 tim 1.14
256     </target>
257    
258    
259 tim 1.28
260 tim 1.11 <!-- Internal targets -->
261 tim 1.9
262 tim 1.16
263 tim 1.32 <target name="init">
264 tim 1.27
265 tim 1.11 <!-- Version is kept in a separate file -->
266     <loadfile property="version" srcFile="version.properties"/>
267     <echo>Building JSR-166 version ${version}</echo>
268 tim 1.54 <echo>java.home is ${java.home}</echo>
269 tim 1.27
270     </target>
271 jsr166 1.65
272    
273 tim 1.28 <target name="dist-jar"
274     depends="clean, jar">
275 tim 1.27
276 tim 1.11 <copy file="${product.jar}" todir="${dist.dir}"/>
277 tim 1.27
278 tim 1.11 </target>
279    
280    
281 tim 1.28 <target name="compile-ant-filter"
282     depends="init">
283 tim 1.27
284 tim 1.1 <mkdir dir="${build.ant.dir}"/>
285 tim 1.27
286 tim 1.1 <javac srcdir="${ant.src.dir}"
287     destdir="${build.ant.dir}"
288 jsr166 1.65 source="1.4"/>
289 tim 1.27
290 tim 1.1 </target>
291    
292    
293 tim 1.28 <target name="filter-src"
294     depends="compile-ant-filter">
295 tim 1.27
296 tim 1.1 <mkdir dir="${build.filter.src.dir}"/>
297 tim 1.27
298 tim 1.1 <copy todir="${build.filter.src.dir}">
299     <fileset dir="${src.dir}">
300 tim 1.31 <include name="**/*.html"/>
301     </fileset>
302     </copy>
303    
304     <copy todir="${build.filter.src.dir}">
305     <fileset dir="${src.dir}">
306     <exclude name="**/*.html"/>
307 tim 1.59 <!-- Files excluded from dist-docs -->
308     <exclude name="java/util/Random.*"/>
309     <exclude name="sun/misc/Unsafe.*"/>
310 tim 1.1 </fileset>
311 tim 1.59 <!--
312 tim 1.1 <filterchain>
313 tim 1.59 -->
314 tim 1.36
315     <!--
316     # This filter gets rid of angle-bracketed type parameters
317     # so that javadoc can run on the result. The following
318     # heuristic seems to work:
319     #
320     # For all lines not starting with space(s)-asterisk-space(s),
321     # replace <something> with a space, where there may be more
322     # than one right angle bracket at the end, and "something"
323     # must not contain parens or pipes. (This may need some
324     # tweaking.)
325     -->
326    
327 tim 1.59 <!--
328 tim 1.1 <filterreader classname="jsr166.ant.filters.ReplaceFilter"
329     classpath="${build.ant.dir}">
330     <param name="notmatching" value="^\s+\*\s.*$"/>
331 tim 1.36 <param name="pattern" value="&lt;[^|>()]+?>+"/>
332 tim 1.1 <param name="replacement" value=" "/>
333     </filterreader>
334 tim 1.59 -->
335 tim 1.36
336 tim 1.59 <!--
337 tim 1.47 </filterchain>
338 tim 1.59 -->
339 tim 1.47 </copy>
340    
341     </target>
342    
343    
344     <target name="filter-doccheck"
345     depends="filter-src">
346 tim 1.36
347 tim 1.58 <mkdir dir="${build.dc-filter.dir}"/>
348 tim 1.36
349 tim 1.58 <copy todir="${build.dc-filter.dir}">
350 tim 1.47 <fileset dir="${build.filter.src.dir}">
351     <include name="**/*.html"/>
352     </fileset>
353     </copy>
354    
355     <property name="generic.declarations"
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 tim 1.58 <copy todir="${build.dc-filter.dir}">
360 tim 1.47 <fileset dir="${build.filter.src.dir}">
361     <exclude name="**/*.html"/>
362     </fileset>
363     <filterchain>
364 tim 1.36 <!--
365 tim 1.47 # These two filters try to make the source look like
366 tim 1.36 # something that doccheck can process. The first removes
367     # -source 1.4 assertions and the second adds in a bunch
368     # of single letter public nested marker interfaces so that
369     # the generic type parameters are recognized.
370     -->
371    
372     <filterreader classname="jsr166.ant.filters.ReplaceFilter"
373     classpath="${build.ant.dir}">
374     <param name="matching" value="^\s*assert[\s ].*$"/>
375     <param name="pattern" value="assert"/>
376     <param name="replacement" value="//assert"/>
377     </filterreader>
378    
379     <filterreader classname="jsr166.ant.filters.ReplaceFilter"
380     classpath="${build.ant.dir}">
381 tim 1.47 <param name="matching" value="^([^*]*(class|interface|implements) .*|)\{.*$"/>
382 tim 1.36 <param name="pattern" value="$"/>
383     <param name="replacement" value=" ${generic.declarations}"/>
384     </filterreader>
385    
386 tim 1.1 </filterchain>
387     </copy>
388 tim 1.27
389 tim 1.1 </target>
390    
391    
392 tim 1.28 <target name="compile-tests"
393     depends="jar">
394 tim 1.27
395 tim 1.1 <mkdir dir="${build.testcases.dir}"/>
396 tim 1.37
397 tim 1.60 <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 jsr166 1.65
408 tim 1.60 <classpath refid="test.classpath"/>
409    
410     </javac>
411    
412     <javac srcdir="${test.src.dir}"
413 tim 1.1 destdir="${build.testcases.dir}"
414     debug="${build.debug}"
415     debuglevel="${build.debuglevel}"
416     deprecation="${build.deprecation}"
417     source="${build.sourcelevel}"
418     fork="true">
419    
420 tim 1.60 <include name="jsr166/test/**"/>
421 jsr166 1.65
422 tim 1.59 <compilerarg value="${bootclasspath.args}"/>
423 tim 1.57 <compilerarg line="${build.args}"/>
424 jsr166 1.65
425 tim 1.57 <classpath refid="test.classpath"/>
426 tim 1.1
427     </javac>
428 tim 1.27
429 tim 1.62 <!--
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 jsr166 1.65
441 tim 1.62 <classpath refid="test.classpath"/>
442    
443     </javac>
444     -->
445    
446 tim 1.1 </target>
447 tim 1.11
448 tim 1.1
449 tim 1.28 <target name="run-tests"
450     depends="compile-tests">
451 tim 1.27
452     <!-- May be overridden by user.properties -->
453     <property name="testcase" value="*"/>
454    
455 tim 1.1 <mkdir dir="${build.reports.dir}"/>
456 tim 1.27
457 tim 1.1 <junit printsummary="true"
458     showoutput="true"
459     errorProperty="junit.failed"
460     failureProperty="junit.failed"
461 tim 1.12 dir="${build.reports.dir}"
462     fork="true">
463    
464 tim 1.59 <jvmarg value="${bootclasspath.args}"/>
465 tim 1.64 <jvmarg value="-server"/>
466     <jvmarg value="-showversion"/>
467 jsr166 1.65
468 tim 1.59 <classpath refid="test.classpath"/>
469 tim 1.1
470     <formatter type="xml"/>
471    
472 tim 1.62 <batchtest todir="${build.reports.dir}" unless="no.test.tck">
473 tim 1.60 <fileset dir="${tck.src.dir}">
474     <include name="**/${testcase}Test.java"/>
475     </fileset>
476 tim 1.62 </batchtest>
477 jsr166 1.65
478 tim 1.62 <batchtest todir="${build.reports.dir}" if="do.test.old">
479 tim 1.60 <fileset dir="${test.src.dir}">
480     <include name="jsr166/test/**/${testcase}Test.java"/>
481 tim 1.1 </fileset>
482     </batchtest>
483 tim 1.62
484 jsr166 1.65 <!--
485 tim 1.62 <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 tim 1.1
492     </junit>
493 tim 1.27
494 tim 1.1 </target>
495    
496    
497 tim 1.28 <target name="report-tests"
498     depends="run-tests">
499    
500 tim 1.54 <!-- Sets junit.report.format to frames if redirection is present,
501 tim 1.1 otherwise sets it to noframes. -->
502     <available property="junit.report.format"
503     value="frames"
504     classname="org.apache.xalan.lib.Redirect"
505     />
506     <property name="junit.report.format" value="noframes"/>
507    
508     <junitreport todir="${build.reports.dir}">
509     <fileset dir="${build.reports.dir}">
510     <include name="TEST-*.xml"/>
511     </fileset>
512     <report styledir="${stylesheet.dir}"
513     format="${junit.report.format}"
514     todir="${build.reports.dir}"
515     />
516     </junitreport>
517    
518     <fail message="Test Cases Failed" if="junit.failed"/>
519 tim 1.28
520 tim 1.18 </target>
521    
522    
523 tim 1.32 <target name="configure-compiler">
524 tim 1.54
525     <property name="unchecked.option" value="-Xlint:unchecked"/>
526    
527     <condition property="warnunchecked.arg" value="${unchecked.option}">
528 tim 1.57 <istrue value="${build.warnunchecked}"/>
529 tim 1.32 </condition>
530    
531 tim 1.37 <property name="warnunchecked.arg" value=""/>
532 tim 1.34
533 tim 1.32
534     <!-- Common options in javac invocations -->
535 tim 1.57 <property name="build.args" value="${warnunchecked.arg}"/>
536 tim 1.33
537     </target>
538    
539    
540 tim 1.37 <target name="configure-tests"
541     depends="configure-compiler">
542 tim 1.28
543     <!-- junit.framework.Protectable is in JUnit 3.8.1 but not in 3.7 -->
544 tim 1.18 <available property="junit.available"
545 tim 1.28 classname="junit.framework.Protectable"/>
546    
547 tim 1.54 <!-- Xalan -->
548     <available property="xalan.available"
549     classname="org.apache.xalan.Version"/>
550    
551 jsr166 1.65
552 tim 1.59 <!-- Ant 1.6beta and later don't need or want this check -->
553 jsr166 1.65 <!--
554 tim 1.59 <fail message="Need JUnit 3.8.1 in ${ant.home}${file.separator}lib to run tests"
555     unless="junit.available"/>
556    
557 tim 1.54 <fail message="Need Xalan 2.5.1 jar in ${ant.home}${file.separator}lib to run tests"
558     unless="xalan.available"/>
559 tim 1.59 -->
560 tim 1.30
561 tim 1.28 </target>
562    
563    
564    
565     <!-- Anthill targets -->
566    
567 tim 1.54 <target name="anthill-build">
568 jsr166 1.65
569 tim 1.55 <!-- Override this in user.properties -->
570     <property name="tiger.home" location="e:/j2sdk1.5.0"/>
571 jsr166 1.65
572 tim 1.54 <exec resultproperty="result.property" dir="${basedir}" executable="${tiger.home}/bin/java">
573     <arg value="-Xmx256000000"/>
574     <!-- classpath of new JVM -->
575     <arg value="-classpath"/> <arg path="${java.class.path}"/>
576     <!-- location of Ant home directory -->
577     <arg value="-Dant.home=${ant.home}"/>
578     <!-- the Ant main class -->
579     <arg value="org.apache.tools.ant.Main"/>
580     <!-- The build file -->
581     <arg value="-buildfile"/> <arg value="build.xml"/>
582     <!-- the target to build on the new Ant instance -->
583     <arg value="-DJAVA_HOME=${tiger.home}"/>
584     <arg value="do-anthill-build"/>
585     </exec>
586     </target>
587 jsr166 1.65
588 tim 1.54 <target name="do-anthill-build"
589 tim 1.28 depends="jar, test, docs, dist-docs"/>
590    
591     <target name="anthill-publish">
592    
593     <copy todir="${deployDir}/docs/private">
594     <fileset dir="${build.javadocs.dir}"/>
595     </copy>
596    
597     <copy todir="${deployDir}/docs/public">
598     <fileset dir="${dist.javadocs.dir}"/>
599     </copy>
600    
601     <copy tofile="${deployDir}/index.html"
602     file="${basedir}/etc/anthill-index.html"/>
603    
604     <copy todir="${deployDir}/notes">
605     <fileset dir="${basedir}/etc/notes"/>
606     </copy>
607    
608 tim 1.43 </target>
609    
610    
611 jsr166 1.65
612     <!-- Various demos and test programs -->
613    
614    
615     <target name="sample" depends="init, configure-compiler"
616     description="Standalone demo program">
617    
618 tim 1.59 <mkdir dir="${build.testcases.dir}"/>
619 jsr166 1.65
620 tim 1.59 <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 jsr166 1.65
628 tim 1.61 <include name="jsr166/test/Sample.java"/>
629 jsr166 1.65
630 tim 1.59 </javac>
631 jsr166 1.65
632 tim 1.64 <copy todir="${build.testcases.dir}">
633     <fileset dir="${test.src.dir}">
634     <include name="**/*.properties"/>
635     </fileset>
636     </copy>
637 jsr166 1.65
638    
639 tim 1.61 <java classname="jsr166.test.Sample" fork="true">
640 jsr166 1.65 <classpath refid="test.classpath"/>
641     <!-- <jvmarg value="-ea"/> -->
642 tim 1.64 <!-- <jvmarg value="-server"/> -->
643     <!-- <arg value="1000"/> -->
644     </java>
645     </target>
646    
647    
648 jsr166 1.65 <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 tim 1.64 <mkdir dir="${build.j1.dir}"/>
676 jsr166 1.65
677 tim 1.64 <javac srcdir="${j1.src.dir}"
678     destdir="${build.j1.dir}"
679     debug="${build.debug}"
680     debuglevel="${build.debuglevel}"
681     deprecation="${build.deprecation}"
682 jsr166 1.66 source="${build.sourcelevel}" >
683    
684     <include name="**/*.java"/>
685     <exclude name="**/dijkstra/**"/>
686 jsr166 1.65
687 tim 1.64 <compilerarg line="${build.args}"/>
688     <classpath refid="j1.classpath"/>
689 jsr166 1.65
690 tim 1.64 </javac>
691 jsr166 1.65
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 jsr166 1.66 <java classname="jsr166.bbuf.BoundedBufferDemo" fork="true">
716 tim 1.64 <classpath refid="j1.classpath"/>
717 jsr166 1.66 <jvmarg value="-server"/>
718     <arg value="http://www.perl.com/"/>
719     <arg value="1"/>
720 tim 1.43 </java>
721 jsr166 1.65
722     </target>
723    
724    
725     <target name="test-j1" depends="compile-j1"
726     description="Runs testcases from the JavaOne source directories">
727 tim 1.64
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 jsr166 1.65 <!-- <jvmarg value="-server"/> -->
736 tim 1.64 <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 jsr166 1.65 classname="org.apache.xalan.lib.Redirect"/>
750 tim 1.64 <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 tim 1.63 </target>
765    
766 jsr166 1.65
767    
768 tim 1.63 <!-- C++ and JNI definitions and demos -->
769 jsr166 1.65
770 tim 1.63 <target name="configure-cpp">
771    
772     <!-- Define tasks and types -->
773 jsr166 1.65
774 tim 1.63 <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 jsr166 1.65
780 tim 1.63 <!-- Set platform property for JNI includes -->
781 jsr166 1.65
782 tim 1.63 <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 jsr166 1.65
792 tim 1.63 </target>
793 jsr166 1.65
794    
795 tim 1.63 <target name="cppdemo" depends="configure-cpp">
796 jsr166 1.65
797 tim 1.63 <mkdir dir="${build.dir}"/>
798 jsr166 1.65
799 tim 1.63 <cc multithreaded="true"
800 jsr166 1.65 name="g++"
801 tim 1.63 objdir="${build.dir}"
802     outfile="${build.dir}/CppDemo">
803     <fileset dir="${test.src.dir}" includes="CppDemo.cpp"/>
804     <libset libs="stdc++"/>
805     </cc>
806 jsr166 1.65
807 tim 1.63 <exec executable="${build.dir}/CppDemo">
808     <arg line="count in word frequency of word in command line count"/>
809     </exec>
810 jsr166 1.65
811 tim 1.63 </target>
812 jsr166 1.65
813    
814 tim 1.63 <target name="jnidemo" depends="init, configure-compiler, configure-cpp">
815 jsr166 1.65
816 tim 1.63 <mkdir dir="${build.testcases.dir}"/>
817 jsr166 1.65
818 tim 1.63 <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 jsr166 1.65
831 tim 1.63 <javah destdir="${build.testcases.dir}"
832     classpathref="test.classpath">
833     <class name="JniDemo"/>
834     </javah>
835 jsr166 1.65
836 tim 1.63 <cc multithreaded="true"
837 jsr166 1.65 name="g++"
838 tim 1.63 objdir="${build.dir}"
839     outfile="${build.dir}/JniDemo"
840     outtype="shared">
841 jsr166 1.65
842 tim 1.63 <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 jsr166 1.65
851 tim 1.63 <linker>
852     <linkerarg value="--add-stdcall-alias"/>
853     </linker>
854 jsr166 1.65
855 tim 1.63 <includepath location="${build.testcases.dir}"/>
856 jsr166 1.65
857 tim 1.63 <fileset dir="${test.src.dir}" includes="JniDemo.cpp"/>
858 jsr166 1.65
859 tim 1.63 <libset libs="stdc++"/>
860 jsr166 1.65
861 tim 1.63 </cc>
862 jsr166 1.65
863 tim 1.63 <!-- Necessary if windows, harmless if not -->
864     <copy file="${build.dir}/libJniDemo.so" tofile="${build.dir}/JniDemo.dll"/>
865 jsr166 1.65
866 tim 1.63 <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 tim 1.64 <arg line="count in word frequency of word in command line count"/>
871 tim 1.63 </java>
872 jsr166 1.65
873 tim 1.1 </target>
874 tim 1.61
875    
876    
877     <!-- Backward compatibility, work in progress (some files not checked in) -->
878 tim 1.1
879 tim 1.59
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 jsr166 1.65
886     <target name="defang"
887 tim 1.59 depends="init"
888     description="Generates pre-Tiger compatible source">
889 jsr166 1.65
890 tim 1.59 <delete dir="${pretiger.src.dir}"/>
891     <mkdir dir="${pretiger.src.dir}"/>
892 jsr166 1.65
893 tim 1.59 <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 jsr166 1.65
900 tim 1.59 </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 jsr166 1.65
923 tim 1.59 <target name="pretiger" depends="compile-pretiger">
924    
925     <mkdir dir="${build.lib.dir}"/>
926 jsr166 1.65
927 tim 1.59 <jar destfile="${pretiger.jar}">
928     <fileset dir="${build.pretiger.dir}">
929     </fileset>
930     </jar>
931 jsr166 1.65
932 tim 1.59 </target>
933 tim 1.1
934     </project>