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

Annotation of /jsr166/build.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.68 - (hide annotations)
Mon Jun 14 17:22:09 2004 UTC (15 years, 2 months ago) by jsr166
Branch: MAIN
Changes since 1.67: +9 -1 lines
File MIME type: text/xml
Different implementations of WebCrawler

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

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