70 |
|
<!-- Main targets --> |
71 |
|
|
72 |
|
<target name="compile" |
73 |
< |
depends="init, configure-compiler" |
73 |
> |
depends="init, configure-compiler, prepare-src" |
74 |
|
description="Compiles main sources to build folder"> |
75 |
|
|
76 |
+ |
<property name="prepare.src.dir" value="${src.dir}"/> |
77 |
+ |
|
78 |
|
<mkdir dir="${build.classes.dir}"/> |
79 |
|
|
80 |
< |
<javac srcdir="${src.dir}" |
80 |
> |
<javac srcdir="${prepare.src.dir}" |
81 |
|
destdir="${build.classes.dir}" |
82 |
|
debug="${build.debug}" |
83 |
|
debuglevel="${build.debuglevel}" |
327 |
|
</fileset> |
328 |
|
</copy> |
329 |
|
|
330 |
+ |
<!-- Not needed now, used for doccheck filtering: |
331 |
+ |
<property name="generic.declarations" |
332 |
+ |
value="public interface E {} public interface T {} public interface K {} public interface V {}" |
333 |
+ |
/> |
334 |
+ |
--> |
335 |
+ |
|
336 |
|
<copy todir="${build.filter.src.dir}"> |
337 |
|
<fileset dir="${src.dir}"> |
338 |
|
<exclude name="**/*.html"/> |
339 |
|
<patternset refid="emulation.excludes"/> |
340 |
|
</fileset> |
341 |
|
<filterchain> |
342 |
+ |
|
343 |
+ |
<!-- |
344 |
+ |
# This filter gets rid of angle-bracketed type parameters |
345 |
+ |
# so that javadoc can run on the result. The following |
346 |
+ |
# heuristic seems to work: |
347 |
+ |
# |
348 |
+ |
# For all lines not starting with space(s)-asterisk-space(s), |
349 |
+ |
# replace <something> with a space, where there may be more |
350 |
+ |
# than one right angle bracket at the end, and "something" |
351 |
+ |
# must not contain parens or pipes. (This may need some |
352 |
+ |
# tweaking.) |
353 |
+ |
--> |
354 |
+ |
|
355 |
|
<filterreader classname="jsr166.ant.filters.ReplaceFilter" |
356 |
|
classpath="${build.ant.dir}"> |
336 |
– |
<!-- |
337 |
– |
# These arguments are to get rid of angle-bracketed type |
338 |
– |
# parameters so that javadoc can run on the result. The |
339 |
– |
# following heuristic that seems to work: |
340 |
– |
# |
341 |
– |
# For all lines not starting with space(s)-asterisk-space(s), |
342 |
– |
# replace <something> with a space, where there may be more |
343 |
– |
# than one right angle bracket at the end, and "something" |
344 |
– |
# must not contain parens or pipes. (This may need some |
345 |
– |
# tweaking.) |
346 |
– |
--> |
357 |
|
<param name="notmatching" value="^\s+\*\s.*$"/> |
358 |
< |
<param name="pattern" value="<[^|>()]+?>+"/> |
358 |
> |
<param name="pattern" value="<[^|>()]+?>+"/> |
359 |
|
<param name="replacement" value=" "/> |
360 |
|
</filterreader> |
361 |
+ |
|
362 |
+ |
|
363 |
+ |
<!-- |
364 |
+ |
# This filter uncomments lines beginning with "//@" so that |
365 |
+ |
# javadoc can see imports that are needed to resolve links |
366 |
+ |
# but that shouldn't be in the compiled code. |
367 |
+ |
--> |
368 |
+ |
|
369 |
|
<filterreader classname="jsr166.ant.filters.ReplaceFilter" |
370 |
|
classpath="${build.ant.dir}"> |
371 |
< |
<!-- |
372 |
< |
# These arguments are to uncomment lines beginning with |
355 |
< |
# "//@" so that javadoc can see imports that are needed |
356 |
< |
# to resolve links but that shouldn't be in the compiled |
357 |
< |
# code. |
358 |
< |
--> |
359 |
< |
<param name="matching" value="^//@.*$"/> |
360 |
< |
<param name="pattern" value="^//@"/> |
371 |
> |
<param name="matching" value="^//@.*$"/> |
372 |
> |
<param name="pattern" value="^//@"/> |
373 |
|
<param name="replacement" value=""/> |
374 |
|
</filterreader> |
375 |
+ |
|
376 |
+ |
|
377 |
+ |
<!-- |
378 |
+ |
# The next two filters try to make the source look like |
379 |
+ |
# something that doccheck can process. The first removes |
380 |
+ |
# -source 1.4 assertions and the second adds in a bunch |
381 |
+ |
# of single letter public nested marker interfaces so that |
382 |
+ |
# the generic type parameters are recognized. |
383 |
+ |
# |
384 |
+ |
# Currently commented out because doccheck doesn't work. :-( |
385 |
+ |
--> |
386 |
+ |
|
387 |
+ |
<!-- |
388 |
+ |
<filterreader classname="jsr166.ant.filters.ReplaceFilter" |
389 |
+ |
classpath="${build.ant.dir}"> |
390 |
+ |
<param name="matching" value="^\s*assert[\s ].*$"/> |
391 |
+ |
<param name="pattern" value="assert"/> |
392 |
+ |
<param name="replacement" value="//assert"/> |
393 |
+ |
</filterreader> |
394 |
+ |
|
395 |
+ |
<filterreader classname="jsr166.ant.filters.ReplaceFilter" |
396 |
+ |
classpath="${build.ant.dir}"> |
397 |
+ |
<param name="matching" value="^(.*(class|interface|implements) .*|)\{.*$"/> |
398 |
+ |
<param name="pattern" value="$"/> |
399 |
+ |
<param name="replacement" value=" ${generic.declarations}"/> |
400 |
+ |
</filterreader> |
401 |
+ |
--> |
402 |
+ |
|
403 |
|
</filterchain> |
404 |
|
</copy> |
405 |
|
|
487 |
|
<target name="configure-compiler"> |
488 |
|
|
489 |
|
<property name="gjc.version" |
490 |
< |
value="1.3"/> |
490 |
> |
value="2.0"/> |
491 |
|
|
492 |
|
<condition property="build.novariance" value="-novariance"> |
493 |
|
<and> |
518 |
|
|
519 |
|
<property name="build.warnunchecked" value=""/> |
520 |
|
|
521 |
+ |
<condition property="prepare.src.dir" value="${build.dir}/prepare-src"> |
522 |
+ |
<istrue value="${build.nothreads}"/> |
523 |
+ |
</condition> |
524 |
+ |
|
525 |
|
|
526 |
|
<!-- |
527 |
|
! Bootclasspath munging for source compilation. |
554 |
|
<property name="build.javac.args" |
555 |
|
value="${build.bootclasspath.arg} ${build.warnunchecked} ${build.novariance}"/> |
556 |
|
|
557 |
< |
<echo>javac ${build.javac.args} |
558 |
< |
bootclasspath is ${javac.bootclasspath}</echo> |
557 |
> |
<echo>javac ${build.javac.args}</echo> |
558 |
> |
<echo>bootclasspath=${javac.bootclasspath}</echo> |
559 |
> |
|
560 |
> |
</target> |
561 |
> |
|
562 |
> |
|
563 |
> |
<target name="prepare-src" |
564 |
> |
depends="configure-compiler" |
565 |
> |
if="prepare.src.dir"> |
566 |
> |
|
567 |
> |
<mkdir dir="${prepare.src.dir}"/> |
568 |
> |
<copy todir="${prepare.src.dir}"> |
569 |
> |
<fileset dir="${src.dir}"> |
570 |
> |
<exclude name="java/lang/**"/> |
571 |
> |
</fileset> |
572 |
> |
</copy> |
573 |
|
|
574 |
|
</target> |
575 |
|
|