/[cvs]/jsr166/build.xml
ViewVC logotype

Annotation of /jsr166/build.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.73 - (hide annotations)
Tue Nov 8 00:13:41 2005 UTC (13 years, 9 months ago) by dl
Branch: MAIN
Changes since 1.72: +5 -3 lines
File MIME type: text/xml
dunno

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

dl@cs.oswego.edu
ViewVC Help
Powered by ViewVC 1.1.27