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

Annotation of /jsr166/build.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.70 - (hide annotations)
Wed Aug 11 10:57:33 2004 UTC (15 years, 4 months ago) by dl
Branch: MAIN
Changes since 1.69: +114 -0 lines
File MIME type: text/xml
Add jsr166x targets

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

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