30 |
|
<!-- Build locations --> |
31 |
|
<property name="build.dir" location="build"/> |
32 |
|
<property name="build.classes.dir" location="${build.dir}/classes"/> |
33 |
– |
<property name="build.emulation.dir" location="${build.dir}/emulation"/> |
33 |
|
<property name="build.testcases.dir" location="${build.dir}/testcases"/> |
34 |
|
<property name="build.lib.dir" location="${build.dir}/lib"/> |
35 |
|
<property name="build.ant.dir" location="${build.dir}/ant"/> |
43 |
|
|
44 |
|
<!-- Source locations --> |
45 |
|
<property name="src.dir" location="${basedir}/src/main"/> |
47 |
– |
<property name="emulation.src.dir" location="${basedir}/src/emulation"/> |
46 |
|
<property name="test.src.dir" location="${basedir}/src/test"/> |
47 |
|
<property name="ant.src.dir" location="${basedir}/etc/ant"/> |
48 |
|
<property name="stylesheet.dir" location="${basedir}/etc/xsl"/> |
59 |
|
<property name="sinjdoc.jar" location="${lib.dir}/sinjdoc.jar"/> |
60 |
|
|
61 |
|
|
62 |
< |
<!-- Files excluded from dist-docs and emulation jar --> |
63 |
< |
<patternset id="unsafe.exclusion"> |
62 |
> |
<!-- Files excluded from dist-docs --> |
63 |
> |
<patternset id="docs.exclusion"> |
64 |
|
<exclude name="java/util/Random.*"/> |
65 |
|
<exclude name="sun/misc/Unsafe.*"/> |
66 |
|
</patternset> |
67 |
|
|
70 |
– |
<!-- Files excludes from emulation jar --> |
71 |
– |
<patternset id="atomic.exclusion"> |
72 |
– |
<exclude name="java/util/concurrent/atomic/AtomicBoolean*"/> |
73 |
– |
<exclude name="java/util/concurrent/atomic/AtomicInteger*"/> |
74 |
– |
<exclude name="java/util/concurrent/atomic/AtomicLong*"/> |
75 |
– |
<exclude name="java/util/concurrent/atomic/AtomicReference*"/> |
76 |
– |
<exclude name="java/util/concurrent/locks/LockSupport*"/> |
77 |
– |
<exclude name="java/util/concurrent/locks/ReentrantLock*"/> |
78 |
– |
</patternset> |
79 |
– |
|
68 |
|
|
69 |
|
|
70 |
|
<!-- Main targets --> |
78 |
|
<mkdir dir="${build.classes.dir}"/> |
79 |
|
|
80 |
|
<!-- |
81 |
< |
<echo>javac ${gjc.args}</echo> |
94 |
< |
<echo>bootclasspath=${compile.bootclasspath}</echo> |
81 |
> |
<echo>javac ${build.args}</echo> |
82 |
|
--> |
83 |
|
|
84 |
|
<javac srcdir="${prepare.src.dir}" |
89 |
|
source="${build.sourcelevel}" |
90 |
|
fork="true"> |
91 |
|
|
92 |
< |
<!-- |
106 |
< |
<compilerarg line="${gjc.args}"/> |
107 |
< |
<bootclasspath refid="compile.bootclasspath"/> |
108 |
< |
--> |
92 |
> |
<compilerarg line="${build.args}"/> |
93 |
|
|
94 |
|
</javac> |
95 |
|
|
97 |
|
|
98 |
|
|
99 |
|
<target name="jar" |
100 |
< |
depends="configure-emulation, init-jar, native-jar, emulation-jar" |
100 |
> |
depends="init-jar, native-jar" |
101 |
|
description="Builds library jar from compiled sources"/> |
102 |
|
|
103 |
|
|
172 |
|
|
173 |
|
<java classname="net.cscott.sinjdoc.Main" fork="true"> |
174 |
|
|
175 |
< |
<jvmarg value="-Xbootclasspath/p:${test.run.bootclasspath}"/> |
175 |
> |
<jvmarg value="-Xbootclasspath/p:${test.bootclasspath}"/> |
176 |
|
|
177 |
|
<classpath> |
178 |
|
<pathelement location="${sinjdoc.jar}"/> |
181 |
|
<path refid="test.classpath"/> |
182 |
|
</classpath> |
183 |
|
|
184 |
< |
|
184 |
> |
<!-- <arg value="-help"/> --> |
185 |
> |
<!-- <arg value="-verbose"/> --> |
186 |
> |
<!-- <arg value="-link"/> <arg value="http://java.sun.com/j2se/1.4.1/docs/api"/> --> |
187 |
> |
|
188 |
|
<arg value="-d"/> <arg value="${build.sinjdocs.dir}"/> |
189 |
|
<arg value="-sourcepath"/> <arg value="${src.dir}"/> |
190 |
|
<arg value="-overview"/> <arg value="${src.dir}/intro.html"/> |
191 |
|
<arg value="-source"/> <arg value="${build.sourcelevel}"/> |
192 |
< |
<!-- <arg value="-verbose"/> --> |
206 |
< |
<!-- <arg value="-link"/> <arg value="http://java.sun.com/j2se/1.4.1/docs/api"/> --> |
192 |
> |
|
193 |
|
<arg value="java.lang"/> |
194 |
|
<arg value="java.util"/> |
195 |
|
<arg value="java.util.concurrent"/> |
196 |
|
<arg value="java.util.concurrent.atomic"/> |
197 |
|
<arg value="java.util.concurrent.locks"/> |
198 |
|
|
213 |
– |
<!-- |
214 |
– |
<arg value="-help"/> |
215 |
– |
--> |
199 |
|
|
200 |
|
</java> |
201 |
|
|
221 |
|
source="${build.sourcelevel}" |
222 |
|
fork="true"> |
223 |
|
|
224 |
< |
<!-- |
242 |
< |
<compilerarg line="${gjc.args} -s"/> |
243 |
< |
<bootclasspath refid="compile.bootclasspath"/> |
244 |
< |
--> |
224 |
> |
<compilerarg line="${build.args} -s"/> |
225 |
|
|
226 |
|
</javac> |
227 |
|
|
246 |
|
<exclude name="${release.jar}"/> |
247 |
|
<exclude name="user.properties"/> |
248 |
|
<exclude name="etc/notes/**"/> |
269 |
– |
<exclude name="lib/gjc/2.1/**"/> |
249 |
|
<exclude name="**/SyntaxTest.java"/> |
250 |
|
</jar> |
251 |
|
|
297 |
|
<!-- Version is kept in a separate file --> |
298 |
|
<loadfile property="version" srcFile="version.properties"/> |
299 |
|
<echo>Building JSR-166 version ${version}</echo> |
300 |
+ |
<echo>java.home is ${java.home}</echo> |
301 |
|
|
302 |
|
</target> |
303 |
|
|
310 |
|
|
311 |
|
|
312 |
|
<target name="native-jar" |
313 |
< |
depends="compile" |
334 |
< |
unless="build.emulation.true"> |
313 |
> |
depends="compile"> |
314 |
|
|
315 |
|
<jar destfile="${product.jar}"> |
316 |
|
<fileset dir="${build.classes.dir}"/> |
319 |
|
</target> |
320 |
|
|
321 |
|
|
343 |
– |
<target name="compile-emulation" |
344 |
– |
depends="init, configure-compiler" |
345 |
– |
if="build.emulation.true"> |
346 |
– |
|
347 |
– |
<mkdir dir="${build.emulation.dir}"/> |
348 |
– |
|
349 |
– |
<javac srcdir="${emulation.src.dir}" |
350 |
– |
destdir="${build.emulation.dir}" |
351 |
– |
debug="${build.debug}" |
352 |
– |
debuglevel="${build.debuglevel}" |
353 |
– |
deprecation="${build.deprecation}" |
354 |
– |
source="${build.sourcelevel}" |
355 |
– |
fork="true"> |
356 |
– |
|
357 |
– |
<compilerarg line="${gjc.args}"/> |
358 |
– |
<bootclasspath refid="compile.bootclasspath"/> |
359 |
– |
|
360 |
– |
</javac> |
361 |
– |
|
362 |
– |
</target> |
363 |
– |
|
364 |
– |
|
365 |
– |
<target name="emulation-jar" |
366 |
– |
depends="compile-emulation" |
367 |
– |
if="build.emulation.true"> |
368 |
– |
|
369 |
– |
|
370 |
– |
<jar destfile="${product.jar}" duplicate="add"> |
371 |
– |
<fileset dir="${build.classes.dir}"> |
372 |
– |
<patternset refid="atomic.exclusion"/> |
373 |
– |
<patternset refid="unsafe.exclusion"/> |
374 |
– |
</fileset> |
375 |
– |
<fileset dir="${build.emulation.dir}"/> |
376 |
– |
</jar> |
377 |
– |
|
378 |
– |
</target> |
379 |
– |
|
380 |
– |
|
322 |
|
<target name="dist-jar" |
323 |
|
depends="clean, jar"> |
324 |
|
|
354 |
|
<copy todir="${build.filter.src.dir}"> |
355 |
|
<fileset dir="${src.dir}"> |
356 |
|
<exclude name="**/*.html"/> |
357 |
< |
<patternset refid="unsafe.exclusion"/> |
357 |
> |
<patternset refid="docs.exclusion"/> |
358 |
|
</fileset> |
359 |
|
<filterchain> |
360 |
|
|
377 |
|
<param name="replacement" value=" "/> |
378 |
|
</filterreader> |
379 |
|
|
439 |
– |
|
440 |
– |
<!-- |
441 |
– |
# This filter uncomments lines beginning with "//@" so that |
442 |
– |
# javadoc can see imports that are needed to resolve links |
443 |
– |
# but that shouldn't be in the compiled code. |
444 |
– |
--> |
445 |
– |
|
446 |
– |
<filterreader classname="jsr166.ant.filters.ReplaceFilter" |
447 |
– |
classpath="${build.ant.dir}"> |
448 |
– |
<param name="matching" value="^//@.*$"/> |
449 |
– |
<param name="pattern" value="^//@"/> |
450 |
– |
<param name="replacement" value=""/> |
451 |
– |
</filterreader> |
380 |
|
</filterchain> |
381 |
|
</copy> |
382 |
|
|
439 |
|
<mkdir dir="${build.testcases.dir}"/> |
440 |
|
|
441 |
|
<!-- |
442 |
< |
<echo>javac ${gjc.args}</echo> |
515 |
< |
<echo>bootclasspath=${test.compile.bootclasspath}</echo> |
442 |
> |
<echo>javac ${build.args}</echo> |
443 |
|
<echo>classpath="${test.classpath}"</echo> |
444 |
|
--> |
445 |
|
|
451 |
|
source="${build.sourcelevel}" |
452 |
|
fork="true"> |
453 |
|
|
454 |
< |
<!-- |
455 |
< |
<compilerarg line="${gjc.args}"/> |
456 |
< |
--> |
457 |
< |
<bootclasspath refid="test.compile.bootclasspath"/> |
458 |
< |
<classpath refid="test.classpath"/> |
454 |
> |
<compilerarg line="${build.args}"/> |
455 |
> |
<classpath refid="test.classpath"/> |
456 |
> |
|
457 |
> |
<include name="java/**"/> |
458 |
> |
<include name="jsr166/**"/> |
459 |
|
|
460 |
|
</javac> |
461 |
|
|
477 |
|
dir="${build.reports.dir}" |
478 |
|
fork="true"> |
479 |
|
|
480 |
< |
<jvmarg value="-Xbootclasspath/p:${test.run.bootclasspath}"/> |
480 |
> |
<jvmarg value="-Xbootclasspath:${test.bootclasspath}"/> |
481 |
|
|
482 |
|
<formatter type="xml"/> |
483 |
|
|
484 |
|
<batchtest todir="${build.reports.dir}"> |
485 |
|
<fileset dir="${test.src.dir}"> |
486 |
< |
<include name="**/${testcase}Test.java"/> |
486 |
> |
<include name="java/**/${testcase}Test.java"/> |
487 |
> |
<include name="jsr166/**/${testcase}Test.java"/> |
488 |
|
</fileset> |
489 |
|
</batchtest> |
490 |
|
|
496 |
|
<target name="report-tests" |
497 |
|
depends="run-tests"> |
498 |
|
|
499 |
< |
<!-- Sets junit.report.format to frames if Xalan is present, |
499 |
> |
<!-- Sets junit.report.format to frames if redirection is present, |
500 |
|
otherwise sets it to noframes. --> |
501 |
|
<available property="junit.report.format" |
502 |
|
value="frames" |
520 |
|
|
521 |
|
|
522 |
|
<target name="configure-compiler"> |
595 |
– |
<!-- |
596 |
– |
<property name="gjc.version" |
597 |
– |
value="2.2"/> |
598 |
– |
|
599 |
– |
<condition property="novariance.arg" value="-novariance"> |
600 |
– |
<and> |
601 |
– |
<equals arg1="${gjc.version}" arg2="2.0"/> |
602 |
– |
<or> |
603 |
– |
<not><isset property="gjc.novariance"/></not> |
604 |
– |
<istrue value="${gjc.novariance}"/> |
605 |
– |
</or> |
606 |
– |
</and> |
607 |
– |
</condition> |
608 |
– |
|
609 |
– |
<property name="novariance.arg" |
610 |
– |
value=""/> |
611 |
– |
|
612 |
– |
<property name="gjc.dir" |
613 |
– |
value="${lib.dir}/gjc"/> |
523 |
|
|
524 |
< |
<property name="javac.jar" |
616 |
< |
location="${gjc.dir}/${gjc.version}/javac.jar"/> |
524 |
> |
<property name="unchecked.option" value="-Xlint:unchecked"/> |
525 |
|
|
526 |
< |
<property name="collect.jar" |
527 |
< |
location="${gjc.dir}/${gjc.version}/collect${novariance.arg}.jar"/> |
620 |
< |
|
621 |
< |
--> |
622 |
< |
<condition property="warnunchecked.arg" value="-warnunchecked"> |
623 |
< |
<istrue value="${gjc.warnunchecked}"/> |
526 |
> |
<condition property="warnunchecked.arg" value="${unchecked.option}"> |
527 |
> |
<istrue value="${build.warnunchecked}"/> |
528 |
|
</condition> |
529 |
|
|
530 |
|
<property name="warnunchecked.arg" value=""/> |
531 |
< |
|
531 |
> |
|
532 |
|
<condition property="prepare.src.dir" value="${build.dir}/prepare-src"> |
533 |
|
<istrue value="${build.nothreads}"/> |
534 |
|
</condition> |
535 |
|
|
536 |
|
|
633 |
– |
<!-- |
634 |
– |
! Bootclasspath munging for source compilation. |
635 |
– |
--> |
636 |
– |
|
637 |
– |
<path id="pre.bootclasspath"> |
638 |
– |
<pathelement location="${javac.jar}"/> |
639 |
– |
</path> |
640 |
– |
|
641 |
– |
<path id="compile.bootclasspath"> |
642 |
– |
<pathelement location="${build.classes.dir}"/> |
643 |
– |
<pathelement location="${collect.jar}"/> |
644 |
– |
<pathelement location="${rt.jar}"/> |
645 |
– |
</path> |
646 |
– |
|
647 |
– |
<!-- Flatten paths into platform-appropriate strings --> |
648 |
– |
<property name="pre.bootclasspath" refid="pre.bootclasspath"/> |
649 |
– |
<property name="compile.bootclasspath" refid="compile.bootclasspath"/> |
650 |
– |
|
651 |
– |
|
537 |
|
<!-- Common options in javac invocations --> |
538 |
< |
<!-- |
654 |
< |
<property name="gjc.args" |
655 |
< |
value="-J-Xbootclasspath/p:${pre.bootclasspath} ${warnunchecked.arg} ${novariance.arg}" |
656 |
< |
/> |
657 |
< |
--> |
538 |
> |
<property name="build.args" value="${warnunchecked.arg}"/> |
539 |
|
|
540 |
|
</target> |
541 |
|
|
554 |
|
</target> |
555 |
|
|
556 |
|
|
676 |
– |
<target name="configure-emulation"> |
677 |
– |
|
678 |
– |
<condition property="build.emulation.true"> |
679 |
– |
<or> |
680 |
– |
<and> |
681 |
– |
<os family="windows"/> |
682 |
– |
<not> |
683 |
– |
<isset property="build.emulation"/> |
684 |
– |
</not> |
685 |
– |
</and> |
686 |
– |
<istrue value="${build.emulation}"/> |
687 |
– |
</or> |
688 |
– |
</condition> |
689 |
– |
|
690 |
– |
</target> |
691 |
– |
|
692 |
– |
|
557 |
|
<target name="configure-tests" |
558 |
|
depends="configure-compiler"> |
559 |
|
|
564 |
|
<fail message="Need JUnit 3.8.1 in ${ant.home}${file.separator}lib to run tests" |
565 |
|
unless="junit.available"/> |
566 |
|
|
567 |
+ |
<!-- Xalan --> |
568 |
+ |
<available property="xalan.available" |
569 |
+ |
classname="org.apache.xalan.Version"/> |
570 |
+ |
|
571 |
+ |
<fail message="Need Xalan 2.5.1 jar in ${ant.home}${file.separator}lib to run tests" |
572 |
+ |
unless="xalan.available"/> |
573 |
+ |
|
574 |
|
|
575 |
|
<!-- |
576 |
|
! Bootclasspath munging for testing, so JUnit can test our local |
579 |
|
|
580 |
|
<path id="test.classpath"> |
581 |
|
<pathelement location="${product.jar}"/> |
711 |
– |
<pathelement location="${build.testcases.dir}"/> |
712 |
– |
<pathelement location="${junit.jar}"/> |
713 |
– |
</path> |
714 |
– |
|
715 |
– |
<path id="test.compile.bootclasspath"> |
716 |
– |
<pathelement location="${javac.jar}"/> |
717 |
– |
<pathelement location="${collect.jar}"/> |
582 |
|
<pathelement location="${rt.jar}"/> |
583 |
+ |
<pathelement location="${junit.jar}"/> |
584 |
+ |
<pathelement location="${build.testcases.dir}"/> |
585 |
|
</path> |
586 |
|
|
587 |
< |
<path id="test.run.bootclasspath"> |
722 |
< |
<pathelement location="${javac.jar}"/> |
587 |
> |
<path id="test.bootclasspath"> |
588 |
|
<path refid="test.classpath"/> |
589 |
|
</path> |
590 |
|
|
591 |
|
<!-- Flatten test classpaths into platform-appropriate strings --> |
592 |
< |
<property name="test.classpath" refid="test.classpath"/> |
593 |
< |
<property name="test.compile.bootclasspath" refid="test.compile.bootclasspath"/> |
729 |
< |
<property name="test.run.bootclasspath" refid="test.run.bootclasspath"/> |
592 |
> |
<property name="test.classpath" refid="test.classpath"/> |
593 |
> |
<property name="test.bootclasspath" refid="test.bootclasspath"/> |
594 |
|
|
595 |
|
</target> |
596 |
|
|
598 |
|
|
599 |
|
<!-- Anthill targets --> |
600 |
|
|
601 |
< |
<target name="anthill-build" |
601 |
> |
<target name="anthill-build"> |
602 |
> |
|
603 |
> |
<!-- Override this in user.properties --> |
604 |
> |
<property name="tiger.home" location="e:/j2sdk1.5.0"/> |
605 |
> |
|
606 |
> |
<exec resultproperty="result.property" dir="${basedir}" executable="${tiger.home}/bin/java"> |
607 |
> |
<arg value="-Xmx256000000"/> |
608 |
> |
<!-- classpath of new JVM --> |
609 |
> |
<arg value="-classpath"/> <arg path="${java.class.path}"/> |
610 |
> |
<!-- location of Ant home directory --> |
611 |
> |
<arg value="-Dant.home=${ant.home}"/> |
612 |
> |
<!-- the Ant main class --> |
613 |
> |
<arg value="org.apache.tools.ant.Main"/> |
614 |
> |
<!-- The build file --> |
615 |
> |
<arg value="-buildfile"/> <arg value="build.xml"/> |
616 |
> |
<!-- the target to build on the new Ant instance --> |
617 |
> |
<arg value="-DJAVA_HOME=${tiger.home}"/> |
618 |
> |
<arg value="do-anthill-build"/> |
619 |
> |
</exec> |
620 |
> |
</target> |
621 |
> |
|
622 |
> |
<target name="do-anthill-build" |
623 |
|
depends="jar, test, docs, dist-docs"/> |
624 |
|
|
625 |
|
<target name="anthill-publish"> |
645 |
|
<target name="ng" depends="test"> |
646 |
|
<java classname="SuperfluousAbstract" fork="true"> |
647 |
|
|
648 |
< |
<jvmarg value="-Xbootclasspath/p:${test.run.bootclasspath}"/> |
648 |
> |
<jvmarg value="-Xbootclasspath/p:${test.bootclasspath}"/> |
649 |
|
|
650 |
|
</java> |
651 |
|
</target> |