74 |
<property name="rt.jar" location="${java.home}/lib/rt.jar"/> |
<property name="rt.jar" location="${java.home}/lib/rt.jar"/> |
75 |
|
|
76 |
|
|
77 |
|
|
78 |
<!-- |
<!-- |
79 |
! Bootclasspath munging for source compilation. |
! Bootclasspath munging for source compilation. |
80 |
--> |
--> |
81 |
|
|
82 |
<path id="javac.bootclasspath.prepend"> |
<path id="javac.bootclasspath.prefix"> |
83 |
<!-- <pathelement location="${src.dir}"/> --> |
<!-- <pathelement location="${src.dir}"/> --> |
84 |
<pathelement location="${javac.jar}"/> |
<pathelement location="${javac.jar}"/> |
85 |
</path> |
</path> |
91 |
</path> |
</path> |
92 |
|
|
93 |
<!-- Flatten bootclasspath prefix into a platform-appropriate string --> |
<!-- Flatten bootclasspath prefix into a platform-appropriate string --> |
94 |
<property name="javac.bootclasspath.prepend" refid="javac.bootclasspath.prepend"/> |
<property name="javac.bootclasspath.prefix" refid="javac.bootclasspath.prefix"/> |
95 |
|
|
96 |
<!-- Turn the flattened bootclasspath prefix into a javac argument --> |
<!-- Turn the flattened bootclasspath prefix into a javac argument --> |
97 |
<property name="javac.args" value='-J-Xbootclasspath/p:${javac.bootclasspath.prepend}'/> |
<property name="javac.args" value='-J-Xbootclasspath/p:${javac.bootclasspath.prefix}'/> |
98 |
|
|
99 |
|
|
100 |
|
|
101 |
<!-- |
<!-- |
117 |
|
|
118 |
|
|
119 |
|
|
120 |
|
<!-- Files excluded from emulation and dist-docs --> |
121 |
|
<patternset id="emulation.excludes"> |
122 |
|
<exclude name="java/util/Random.*"/> |
123 |
|
<exclude name="sun/misc/Unsafe.*"/> |
124 |
|
</patternset> |
125 |
|
|
126 |
|
|
127 |
|
|
128 |
<!-- Main targets --> |
<!-- Main targets --> |
129 |
|
|
130 |
<target name="compile" depends="init" |
<target name="compile" |
131 |
|
depends="init" |
132 |
description="Compiles main sources to build folder"> |
description="Compiles main sources to build folder"> |
133 |
|
|
134 |
<mkdir dir="${build.classes.dir}"/> |
<mkdir dir="${build.classes.dir}"/> |
149 |
</target> |
</target> |
150 |
|
|
151 |
|
|
152 |
<target name="jar" depends="native-jar, emulation-jar"/> |
<target name="jar" |
153 |
|
depends="native-jar, emulation-jar" |
154 |
|
description="Builds library jar from compiled sources"/> |
155 |
|
|
156 |
|
|
157 |
<target name="test" depends="init, check-junit, report-tests" |
<target name="test" |
158 |
description="Runs all tests (requires JUnit 3.8+ in ${ant.home}/lib)" |
depends="init, check-junit, report-tests" |
159 |
/> |
description="Runs all tests (requires JUnit 3.8+ in ${ant.home}/lib)" /> |
160 |
|
|
161 |
|
|
162 |
<target name="checkstyle" depends="filter-src" |
<target name="checkstyle" |
163 |
|
depends="filter-src" |
164 |
description="Reports on style errors in Java source (verbose, mostly chaff)"> |
description="Reports on style errors in Java source (verbose, mostly chaff)"> |
165 |
|
|
166 |
<taskdef resource="checkstyletask.properties" |
<taskdef resource="checkstyletask.properties" |
174 |
</target> |
</target> |
175 |
|
|
176 |
|
|
177 |
<target name="doccheck" depends="filter-src" |
<target name="doccheck" |
178 |
|
depends="filter-src" |
179 |
description="Reports on javadoc style errors (not working yet)"> |
description="Reports on javadoc style errors (not working yet)"> |
180 |
|
|
181 |
<delete dir="${build.doccheck.dir}"/> |
<delete dir="${build.doccheck.dir}"/> |
190 |
</target> |
</target> |
191 |
|
|
192 |
|
|
193 |
<target name="docs" depends="filter-src" |
<target name="docs" |
194 |
|
depends="filter-src" |
195 |
description="Builds javadocs with custom tags to build folder"> |
description="Builds javadocs with custom tags to build folder"> |
196 |
|
|
197 |
<delete dir="${build.javadocs.dir}"/> |
<delete dir="${build.javadocs.dir}"/> |
218 |
# bridge methods (marked as "synthetic") that can have identical |
# bridge methods (marked as "synthetic") that can have identical |
219 |
# signatures to existing methods except for the return value. |
# signatures to existing methods except for the return value. |
220 |
--> |
--> |
221 |
<target name="strip" depends="init"> |
<target name="strip" |
222 |
|
depends="init"> |
223 |
|
|
224 |
<mkdir dir="${build.stripped.dir}"/> |
<mkdir dir="${build.stripped.dir}"/> |
225 |
|
|
239 |
</target> |
</target> |
240 |
|
|
241 |
|
|
242 |
<target name="dist" depends="init, dist-clean, dist-jar, dist-docs" |
<target name="dist" |
243 |
|
depends="init, dist-clean, dist-jar, dist-docs" |
244 |
description="Puts all distributable products in single hierarchy"/> |
description="Puts all distributable products in single hierarchy"/> |
245 |
|
|
246 |
|
|
262 |
</target> |
</target> |
263 |
|
|
264 |
|
|
265 |
<!-- Anthill targets --> |
<target name="dist-docs" |
266 |
|
depends="filter-src" |
267 |
|
description="Builds javadocs without custom tags to dist folder"> |
268 |
|
|
269 |
<!-- Should really run the tests instead of just the jar target --> |
<delete dir="${dist.javadocs.dir}"/> |
270 |
<target name="anthill-build" depends="jar, test, docs, dist-docs"/> |
<mkdir dir="${dist.javadocs.dir}"/> |
271 |
|
|
272 |
|
<javadoc destdir="${dist.javadocs.dir}" |
273 |
|
link="http://java.sun.com/j2se/1.4.1/docs/api" |
274 |
|
overview="${src.dir}/intro.html" |
275 |
|
source="${build.docsourcelevel}"> |
276 |
|
|
277 |
|
<packageset dir="${build.filter.src.dir}"/> |
278 |
|
|
279 |
|
</javadoc> |
280 |
|
|
|
<target name="anthill-publish"> |
|
|
<copy todir="${deployDir}/docs/private"> |
|
|
<fileset dir="${build.javadocs.dir}"/> |
|
|
</copy> |
|
|
<copy todir="${deployDir}/docs/public"> |
|
|
<fileset dir="${dist.javadocs.dir}"/> |
|
|
</copy> |
|
|
<copy tofile="${deployDir}/index.html" |
|
|
file="${basedir}/etc/anthill-index.html"/> |
|
|
<copy todir="${deployDir}/notes"> |
|
|
<fileset dir="${basedir}/etc/notes"/> |
|
|
</copy> |
|
281 |
</target> |
</target> |
282 |
|
|
283 |
|
|
284 |
|
|
285 |
<!-- Internal targets --> |
<!-- Internal targets --> |
286 |
|
|
287 |
<target name="set-warnings-if" if="build.warnings"> |
<target name="set-warnings-if" if="build.warnings"> |
298 |
</target> |
</target> |
299 |
|
|
300 |
|
|
301 |
<target name="init" depends="set-warnings-if, set-warnings-unless"> |
<target name="init" |
302 |
|
depends="set-warnings-if, set-warnings-unless"> |
303 |
|
|
304 |
<!-- Version is kept in a separate file --> |
<!-- Version is kept in a separate file --> |
305 |
<loadfile property="version" srcFile="version.properties"/> |
<loadfile property="version" srcFile="version.properties"/> |
308 |
</target> |
</target> |
309 |
|
|
310 |
|
|
311 |
<target name="native-jar" depends="compile" |
<target name="init-jar"> |
|
description="Builds library jar from compiled sources"> |
|
312 |
|
|
313 |
<mkdir dir="${build.lib.dir}"/> |
<mkdir dir="${build.lib.dir}"/> |
314 |
|
|
315 |
|
</target> |
316 |
|
|
317 |
|
|
318 |
|
<target name="native-jar" |
319 |
|
depends="compile, init-jar" |
320 |
|
unless="build.emulation"> |
321 |
|
|
322 |
<jar destfile="${product.jar}"> |
<jar destfile="${product.jar}"> |
323 |
<fileset dir="${build.classes.dir}"/> |
<fileset dir="${build.classes.dir}"/> |
324 |
</jar> |
</jar> |
326 |
</target> |
</target> |
327 |
|
|
328 |
|
|
329 |
<target name="compile-emulation" depends="init" |
<target name="base-jar" |
330 |
if="build.emulation" |
depends="compile, init-jar"> |
331 |
description="Compiles emulation sources to build folder"> |
|
332 |
|
<jar destfile="${product.jar}"> |
333 |
|
<fileset dir="${build.classes.dir}"> |
334 |
|
<patternset refid="emulation.excludes"/> |
335 |
|
</fileset> |
336 |
|
</jar> |
337 |
|
|
338 |
|
</target> |
339 |
|
|
340 |
|
|
341 |
|
<target name="compile-emulation" |
342 |
|
depends="init" |
343 |
|
if="build.emulation"> |
344 |
|
|
345 |
<mkdir dir="${build.emulation.dir}"/> |
<mkdir dir="${build.emulation.dir}"/> |
346 |
|
|
360 |
</target> |
</target> |
361 |
|
|
362 |
|
|
363 |
<target name="emulation-jar" depends="native-jar, compile-emulation" |
<target name="emulation-jar" |
364 |
|
depends="base-jar, compile-emulation" |
365 |
if="build.emulation"> |
if="build.emulation"> |
366 |
|
|
367 |
<jar destfile="${product.jar}" update="true" duplicate="add"> |
<jar destfile="${product.jar}" update="true" duplicate="add"> |
371 |
</target> |
</target> |
372 |
|
|
373 |
|
|
374 |
<target name="dist-jar" depends="clean, jar"> |
<target name="dist-jar" |
375 |
|
depends="clean, jar"> |
376 |
|
|
377 |
<copy file="${product.jar}" todir="${dist.dir}"/> |
<copy file="${product.jar}" todir="${dist.dir}"/> |
378 |
|
|
379 |
</target> |
</target> |
380 |
|
|
381 |
|
|
382 |
<target name="dist-docs" depends="filter-src" |
<target name="compile-ant-filter" |
383 |
description="Builds javadocs without custom tags to dist folder"> |
depends="init"> |
|
|
|
|
<delete dir="${dist.javadocs.dir}"/> |
|
|
<mkdir dir="${dist.javadocs.dir}"/> |
|
|
|
|
|
<javadoc destdir="${dist.javadocs.dir}" |
|
|
link="http://java.sun.com/j2se/1.4.1/docs/api" |
|
|
overview="${src.dir}/intro.html" |
|
|
source="${build.docsourcelevel}"> |
|
|
|
|
|
<packageset dir="${build.filter.src.dir}"/> |
|
|
|
|
|
</javadoc> |
|
|
|
|
|
</target> |
|
|
|
|
|
|
|
|
<target name="compile-ant-filter" depends="init"> |
|
384 |
|
|
385 |
<mkdir dir="${build.ant.dir}"/> |
<mkdir dir="${build.ant.dir}"/> |
386 |
|
|
392 |
</target> |
</target> |
393 |
|
|
394 |
|
|
395 |
<target name="filter-src" depends="compile-ant-filter"> |
<target name="filter-src" |
396 |
|
depends="compile-ant-filter"> |
397 |
|
|
398 |
<mkdir dir="${build.filter.src.dir}"/> |
<mkdir dir="${build.filter.src.dir}"/> |
399 |
|
|
400 |
<copy todir="${build.filter.src.dir}"> |
<copy todir="${build.filter.src.dir}"> |
401 |
<fileset dir="${src.dir}"> |
<fileset dir="${src.dir}"> |
402 |
<include name="**/*.java"/> |
<patternset refid="emulation.excludes"/> |
|
<exclude name="**/Random.java"/> |
|
|
<exclude name="**/Unsafe.java"/> |
|
403 |
</fileset> |
</fileset> |
404 |
<filterchain> |
<filterchain> |
405 |
<filterreader classname="jsr166.ant.filters.ReplaceFilter" |
<filterreader classname="jsr166.ant.filters.ReplaceFilter" |
437 |
</target> |
</target> |
438 |
|
|
439 |
|
|
440 |
<target name="compile-tests" depends="jar"> |
<target name="compile-tests" |
441 |
|
depends="jar"> |
442 |
|
|
443 |
<mkdir dir="${build.testcases.dir}"/> |
<mkdir dir="${build.testcases.dir}"/> |
444 |
|
|
459 |
</target> |
</target> |
460 |
|
|
461 |
|
|
462 |
<target name="run-tests" depends="compile-tests"> |
<target name="run-tests" |
463 |
|
depends="compile-tests"> |
464 |
|
|
465 |
<!-- May be overridden by user.properties --> |
<!-- May be overridden by user.properties --> |
466 |
<property name="testcase" value="*"/> |
<property name="testcase" value="*"/> |
489 |
</target> |
</target> |
490 |
|
|
491 |
|
|
492 |
<target name="report-tests" depends="run-tests"> |
<target name="report-tests" |
493 |
|
depends="run-tests"> |
494 |
|
|
495 |
<!-- Sets junit.report.format to frames if Xalan is present, |
<!-- Sets junit.report.format to frames if Xalan is present, |
496 |
otherwise sets it to noframes. --> |
otherwise sets it to noframes. --> |
497 |
<available property="junit.report.format" |
<available property="junit.report.format" |
511 |
</junitreport> |
</junitreport> |
512 |
|
|
513 |
<fail message="Test Cases Failed" if="junit.failed"/> |
<fail message="Test Cases Failed" if="junit.failed"/> |
514 |
|
|
515 |
</target> |
</target> |
516 |
|
|
517 |
|
|
518 |
<target name="check-junit"> |
<target name="check-junit"> |
519 |
<!-- FIXME: this test isn't specific enough --> |
|
520 |
|
<!-- junit.framework.Protectable is in JUnit 3.8.1 but not in 3.7 --> |
521 |
<available property="junit.available" |
<available property="junit.available" |
522 |
classname="junit.framework.TestCase"/> |
classname="junit.framework.Protectable"/> |
523 |
<fail message="Need JUnit 3.8 to run tests" unless="junit.available"/> |
|
524 |
|
<fail message="Need JUnit 3.8.1 in ${ant.home}${file.separator}lib to run tests" |
525 |
|
unless="junit.available"/> |
526 |
|
|
527 |
|
</target> |
528 |
|
|
529 |
|
|
530 |
|
|
531 |
|
<!-- Anthill targets --> |
532 |
|
|
533 |
|
<target name="anthill-build" |
534 |
|
depends="jar, test, docs, dist-docs"/> |
535 |
|
|
536 |
|
<target name="anthill-publish"> |
537 |
|
|
538 |
|
<copy todir="${deployDir}/docs/private"> |
539 |
|
<fileset dir="${build.javadocs.dir}"/> |
540 |
|
</copy> |
541 |
|
|
542 |
|
<copy todir="${deployDir}/docs/public"> |
543 |
|
<fileset dir="${dist.javadocs.dir}"/> |
544 |
|
</copy> |
545 |
|
|
546 |
|
<copy tofile="${deployDir}/index.html" |
547 |
|
file="${basedir}/etc/anthill-index.html"/> |
548 |
|
|
549 |
|
<copy todir="${deployDir}/notes"> |
550 |
|
<fileset dir="${basedir}/etc/notes"/> |
551 |
|
</copy> |
552 |
|
|
553 |
</target> |
</target> |
554 |
|
|
555 |
|
|