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 |
< |
<compilerarg line="${gjc.args}"/> |
106 |
< |
<!-- |
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 |
< |
<compilerarg line="${gjc.args} -s"/> |
242 |
< |
<!-- |
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 |
|
|
310 |
|
|
311 |
|
|
312 |
|
<target name="native-jar" |
313 |
< |
depends="compile" |
335 |
< |
unless="build.emulation.true"> |
313 |
> |
depends="compile"> |
314 |
|
|
315 |
|
<jar destfile="${product.jar}"> |
316 |
|
<fileset dir="${build.classes.dir}"/> |
319 |
|
</target> |
320 |
|
|
321 |
|
|
344 |
– |
<target name="compile-emulation" |
345 |
– |
depends="init, configure-compiler" |
346 |
– |
if="build.emulation.true"> |
347 |
– |
|
348 |
– |
<mkdir dir="${build.emulation.dir}"/> |
349 |
– |
|
350 |
– |
<javac srcdir="${emulation.src.dir}" |
351 |
– |
destdir="${build.emulation.dir}" |
352 |
– |
debug="${build.debug}" |
353 |
– |
debuglevel="${build.debuglevel}" |
354 |
– |
deprecation="${build.deprecation}" |
355 |
– |
source="${build.sourcelevel}" |
356 |
– |
fork="true"> |
357 |
– |
|
358 |
– |
<compilerarg line="${gjc.args}"/> |
359 |
– |
<!-- |
360 |
– |
<bootclasspath refid="compile.bootclasspath"/> |
361 |
– |
--> |
362 |
– |
|
363 |
– |
</javac> |
364 |
– |
|
365 |
– |
</target> |
366 |
– |
|
367 |
– |
|
368 |
– |
<target name="emulation-jar" |
369 |
– |
depends="compile-emulation" |
370 |
– |
if="build.emulation.true"> |
371 |
– |
|
372 |
– |
|
373 |
– |
<jar destfile="${product.jar}" duplicate="add"> |
374 |
– |
<fileset dir="${build.classes.dir}"> |
375 |
– |
<patternset refid="atomic.exclusion"/> |
376 |
– |
<patternset refid="unsafe.exclusion"/> |
377 |
– |
</fileset> |
378 |
– |
<fileset dir="${build.emulation.dir}"/> |
379 |
– |
</jar> |
380 |
– |
|
381 |
– |
</target> |
382 |
– |
|
383 |
– |
|
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 |
|
|
442 |
– |
|
443 |
– |
<!-- |
444 |
– |
# This filter uncomments lines beginning with "//@" so that |
445 |
– |
# javadoc can see imports that are needed to resolve links |
446 |
– |
# but that shouldn't be in the compiled code. |
447 |
– |
--> |
448 |
– |
|
449 |
– |
<filterreader classname="jsr166.ant.filters.ReplaceFilter" |
450 |
– |
classpath="${build.ant.dir}"> |
451 |
– |
<param name="matching" value="^//@.*$"/> |
452 |
– |
<param name="pattern" value="^//@"/> |
453 |
– |
<param name="replacement" value=""/> |
454 |
– |
</filterreader> |
380 |
|
</filterchain> |
381 |
|
</copy> |
382 |
|
|
439 |
|
<mkdir dir="${build.testcases.dir}"/> |
440 |
|
|
441 |
|
<!-- |
442 |
< |
<echo>javac ${gjc.args}</echo> |
518 |
< |
<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 |
< |
<compilerarg line="${gjc.args}"/> |
455 |
< |
<!-- |
532 |
< |
<bootclasspath refid="test.compile.bootclasspath"/> |
533 |
< |
--> |
534 |
< |
<classpath refid="test.classpath"/> |
454 |
> |
<compilerarg line="${build.args}"/> |
455 |
> |
<classpath refid="test.classpath"/> |
456 |
|
|
457 |
|
<include name="java/**"/> |
458 |
|
<include name="jsr166/**"/> |
477 |
|
dir="${build.reports.dir}" |
478 |
|
fork="true"> |
479 |
|
|
480 |
< |
<jvmarg value="-Xbootclasspath:${test.run.bootclasspath}"/> |
480 |
> |
<jvmarg value="-Xbootclasspath:${test.bootclasspath}"/> |
481 |
|
|
482 |
|
<formatter type="xml"/> |
483 |
|
|
521 |
|
|
522 |
|
<target name="configure-compiler"> |
523 |
|
|
603 |
– |
<property name="gjc.version" |
604 |
– |
value="2.2"/> |
605 |
– |
|
606 |
– |
<condition property="novariance.arg" value="-novariance"> |
607 |
– |
<and> |
608 |
– |
<equals arg1="${gjc.version}" arg2="2.0"/> |
609 |
– |
<or> |
610 |
– |
<not><isset property="gjc.novariance"/></not> |
611 |
– |
<istrue value="${gjc.novariance}"/> |
612 |
– |
</or> |
613 |
– |
</and> |
614 |
– |
</condition> |
615 |
– |
|
616 |
– |
<property name="novariance.arg" |
617 |
– |
value=""/> |
618 |
– |
|
619 |
– |
<property name="gjc.dir" |
620 |
– |
value="${lib.dir}/gjc"/> |
621 |
– |
|
622 |
– |
<property name="javac.jar" |
623 |
– |
location="${gjc.dir}/${gjc.version}/javac.jar"/> |
624 |
– |
|
625 |
– |
<property name="collect.jar" |
626 |
– |
location="${gjc.dir}/${gjc.version}/collect${novariance.arg}.jar"/> |
627 |
– |
|
628 |
– |
<!-- |
629 |
– |
<property name="unchecked.option" value="-warnunchecked"/> |
630 |
– |
--> |
631 |
– |
|
524 |
|
<property name="unchecked.option" value="-Xlint:unchecked"/> |
525 |
|
|
526 |
|
<condition property="warnunchecked.arg" value="${unchecked.option}"> |
527 |
< |
<istrue value="${gjc.warnunchecked}"/> |
527 |
> |
<istrue value="${build.warnunchecked}"/> |
528 |
|
</condition> |
529 |
|
|
530 |
|
<property name="warnunchecked.arg" value=""/> |
534 |
|
</condition> |
535 |
|
|
536 |
|
|
645 |
– |
<!-- |
646 |
– |
! Bootclasspath munging for source compilation. |
647 |
– |
--> |
648 |
– |
|
649 |
– |
<path id="pre.bootclasspath"> |
650 |
– |
<!-- |
651 |
– |
<pathelement location="${javac.jar}"/> |
652 |
– |
--> |
653 |
– |
</path> |
654 |
– |
|
655 |
– |
<path id="compile.bootclasspath"> |
656 |
– |
<pathelement location="${build.classes.dir}"/> |
657 |
– |
<!-- |
658 |
– |
<pathelement location="${collect.jar}"/> |
659 |
– |
--> |
660 |
– |
<pathelement location="${rt.jar}"/> |
661 |
– |
</path> |
662 |
– |
|
663 |
– |
<!-- Flatten paths into platform-appropriate strings --> |
664 |
– |
<property name="pre.bootclasspath" refid="pre.bootclasspath"/> |
665 |
– |
<property name="compile.bootclasspath" refid="compile.bootclasspath"/> |
666 |
– |
|
667 |
– |
|
537 |
|
<!-- Common options in javac invocations --> |
538 |
< |
<!-- |
670 |
< |
<property name="gjc.args" |
671 |
< |
value="-J-Xbootclasspath/p:${pre.bootclasspath} ${warnunchecked.arg} ${novariance.arg}" |
672 |
< |
/> |
673 |
< |
--> |
674 |
< |
<property name="gjc.args" value="${warnunchecked.arg} ${novariance.arg}"/> |
538 |
> |
<property name="build.args" value="${warnunchecked.arg}"/> |
539 |
|
|
540 |
|
</target> |
541 |
|
|
554 |
|
</target> |
555 |
|
|
556 |
|
|
693 |
– |
<target name="configure-emulation"> |
694 |
– |
|
695 |
– |
<condition property="build.emulation.true"> |
696 |
– |
<or> |
697 |
– |
<and> |
698 |
– |
<os family="windows"/> |
699 |
– |
<not> |
700 |
– |
<isset property="build.emulation"/> |
701 |
– |
</not> |
702 |
– |
</and> |
703 |
– |
<istrue value="${build.emulation}"/> |
704 |
– |
</or> |
705 |
– |
</condition> |
706 |
– |
|
707 |
– |
</target> |
708 |
– |
|
709 |
– |
|
557 |
|
<target name="configure-tests" |
558 |
|
depends="configure-compiler"> |
559 |
|
|
580 |
|
<path id="test.classpath"> |
581 |
|
<pathelement location="${product.jar}"/> |
582 |
|
<pathelement location="${rt.jar}"/> |
736 |
– |
<pathelement location="${build.testcases.dir}"/> |
583 |
|
<pathelement location="${junit.jar}"/> |
584 |
+ |
<pathelement location="${build.testcases.dir}"/> |
585 |
|
</path> |
586 |
|
|
587 |
< |
<path id="test.compile.bootclasspath"> |
741 |
< |
<pathelement location="${javac.jar}"/> |
742 |
< |
<pathelement location="${collect.jar}"/> |
743 |
< |
<pathelement location="${rt.jar}"/> |
744 |
< |
</path> |
745 |
< |
|
746 |
< |
<path id="test.run.bootclasspath"> |
747 |
< |
<!-- |
748 |
< |
<pathelement location="${javac.jar}"/> |
749 |
< |
--> |
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"/> |
756 |
< |
<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 |
|
|
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> |