| 1 |
<project name="jsr166" default="usage"> |
<project name="jsr166" default="usage"> |
| 2 |
|
|
| 3 |
<description> |
<description> |
| 4 |
|
------------------------------------------------------------------------------ |
| 5 |
Build file for JSR-166 |
Build file for JSR-166 |
| 6 |
|
|
| 7 |
JUnit 3.8 or better must be in ${ant.home}/lib for the test target to work. |
Usage: ant [target] |
|
</description> |
|
| 8 |
|
|
| 9 |
|
User-specific settings are read from user.properties. |
| 10 |
|
See user.properties.sample for an explanation of some useful settings. |
| 11 |
|
------------------------------------------------------------------------------ |
| 12 |
|
</description> |
| 13 |
|
|
| 14 |
<target name="usage" description="Prints this message"> |
<target name="usage" description="Advises user to run with -projecthelp"> |
| 15 |
<echo> |
<echo>Run "ant -projecthelp" for full usage information.</echo> |
|
ant [target], where target is one of: |
|
|
|
|
|
usage (default) Prints this message |
|
|
compile Compiles all sources to build folder |
|
|
jar Builds library jar from compiled sources |
|
|
test Runs all tests (requires JUnit 1.8 in ${ant.home}/lib) |
|
|
docs Builds javadocs with custom tags to build folder |
|
|
dist-docs Builds javadocs without custom tags to dist folder |
|
|
dist Puts all distributable products in single hierarchy |
|
|
|
|
|
clean Removes all build products |
|
|
dist-clean Removes all build and distribution products |
|
|
|
|
|
checkstyle Reports on style errors in Java source (verbose, mostly chaff) |
|
|
doccheck Reports on javadoc style errors (not working yet) |
|
|
</echo> |
|
| 16 |
</target> |
</target> |
| 17 |
|
|
| 18 |
|
|
| 19 |
<!-- User-specific settings --> |
<!-- User-specific settings --> |
| 20 |
<property file="user.properties"/> |
<property file="user.properties"/> |
| 21 |
|
|
|
<!-- Set build.warnings in user.properties to turn on -warnunchecked --> |
|
|
<!-- <property name="build.warnings" value=""/> --> |
|
|
|
|
| 22 |
|
|
| 23 |
<!-- Compilation options --> |
<!-- Compilation options --> |
| 24 |
<property name="build.sourcelevel" value="1.5"/> |
<property name="build.sourcelevel" value="1.5"/> |
| 35 |
<property name="build.lib.dir" location="${build.dir}/lib"/> |
<property name="build.lib.dir" location="${build.dir}/lib"/> |
| 36 |
<property name="build.ant.dir" location="${build.dir}/ant"/> |
<property name="build.ant.dir" location="${build.dir}/ant"/> |
| 37 |
<property name="build.javadocs.dir" location="${build.dir}/javadocs"/> |
<property name="build.javadocs.dir" location="${build.dir}/javadocs"/> |
| 38 |
|
<property name="build.sinjdocs.dir" location="${build.dir}/sinjdocs"/> |
| 39 |
<property name="build.stripped.dir" location="${build.dir}/stripped"/> |
<property name="build.stripped.dir" location="${build.dir}/stripped"/> |
| 40 |
<property name="build.reports.dir" location="${build.dir}/reports"/> |
<property name="build.reports.dir" location="${build.dir}/reports"/> |
| 41 |
<property name="build.doccheck.dir" location="${build.dir}/doccheck"/> |
<property name="build.doccheck.dir" location="${build.dir}/doccheck"/> |
| 42 |
<property name="build.filter.src.dir" location="${build.dir}/filtersrc"/> |
<property name="build.filter.src.dir" location="${build.dir}/filtersrc"/> |
| 43 |
|
<property name="build.filter.doccheck.dir" location="${build.dir}/filterdocchk"/> |
| 44 |
|
|
| 45 |
<!-- Source locations --> |
<!-- Source locations --> |
| 46 |
<property name="src.dir" location="${basedir}/src/main"/> |
<property name="src.dir" location="${basedir}/src/main"/> |
| 56 |
|
|
| 57 |
<!-- Jar locations --> |
<!-- Jar locations --> |
| 58 |
<property name="product.jar" location="${build.lib.dir}/jsr166.jar"/> |
<property name="product.jar" location="${build.lib.dir}/jsr166.jar"/> |
|
<property name="javac.jar" location="${lib.dir}/javac.jar"/> |
|
|
<property name="collect.jar" location="${lib.dir}/collect.jar"/> |
|
| 59 |
<property name="junit.jar" location="${lib.dir}/junit.jar"/> |
<property name="junit.jar" location="${lib.dir}/junit.jar"/> |
| 60 |
<property name="rt.jar" location="${java.home}/lib/rt.jar"/> |
<property name="rt.jar" location="${java.home}/lib/rt.jar"/> |
| 61 |
|
<property name="sinjdoc.jar" location="${lib.dir}/sinjdoc.jar"/> |
| 62 |
|
|
| 63 |
|
|
| 64 |
|
<!-- Files excluded from dist-docs and emulation jar --> |
| 65 |
<!-- |
<patternset id="unsafe.exclusion"> |
|
! Bootclasspath munging for source compilation. |
|
|
--> |
|
|
|
|
|
<path id="javac.bootclasspath.prefix"> |
|
|
<!-- <pathelement location="${src.dir}"/> --> |
|
|
<pathelement location="${javac.jar}"/> |
|
|
</path> |
|
|
|
|
|
<path id="javac.bootclasspath"> |
|
|
<!-- <pathelement location="${src.dir}"/> --> |
|
|
<pathelement location="${collect.jar}"/> |
|
|
<pathelement location="${rt.jar}"/> |
|
|
</path> |
|
|
|
|
|
<!-- Flatten bootclasspath prefix into a platform-appropriate string --> |
|
|
<property name="javac.bootclasspath.prefix" refid="javac.bootclasspath.prefix"/> |
|
|
|
|
|
<!-- Turn the flattened bootclasspath prefix into a javac argument --> |
|
|
<property name="javac.args" value='-J-Xbootclasspath/p:${javac.bootclasspath.prefix}'/> |
|
|
|
|
|
|
|
|
|
|
|
<!-- |
|
|
! Bootclasspath munging for testing, so JUnit can test our local |
|
|
! modifications to java.*. |
|
|
--> |
|
|
|
|
|
<path id="test.classpath"> |
|
|
<pathelement location="${product.jar}"/> |
|
|
<pathelement location="${build.testcases.dir}"/> |
|
|
<pathelement location="${junit.jar}"/> |
|
|
</path> |
|
|
|
|
|
<!-- Flatten test classpath into a platform-appropriate string --> |
|
|
<property name="test.classpath" refid="test.classpath"/> |
|
|
|
|
|
<!-- Turn the flattened test classpath into a javac argument --> |
|
|
<property name="test.javac.args" value='-Xbootclasspath/p:${test.classpath}'/> |
|
|
|
|
|
|
|
|
|
|
|
<!-- Files excluded from emulation and dist-docs --> |
|
|
<patternset id="emulation.excludes"> |
|
| 66 |
<exclude name="java/util/Random.*"/> |
<exclude name="java/util/Random.*"/> |
| 67 |
<exclude name="sun/misc/Unsafe.*"/> |
<exclude name="sun/misc/Unsafe.*"/> |
| 68 |
</patternset> |
</patternset> |
| 69 |
|
|
| 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 |
|
|
| 80 |
|
|
| 81 |
|
|
| 82 |
<!-- Main targets --> |
<!-- Main targets --> |
| 83 |
|
|
| 84 |
<target name="compile" |
<target name="compile" |
| 85 |
depends="init" |
depends="init, configure-compiler, prepare-src" |
| 86 |
description="Compiles main sources to build folder"> |
description="Compiles main sources to build folder"> |
| 87 |
|
|
| 88 |
|
<property name="prepare.src.dir" value="${src.dir}"/> |
| 89 |
|
|
| 90 |
<mkdir dir="${build.classes.dir}"/> |
<mkdir dir="${build.classes.dir}"/> |
| 91 |
|
|
| 92 |
<javac srcdir="${src.dir}" |
<!-- |
| 93 |
|
<echo>javac ${gjc.args}</echo> |
| 94 |
|
<echo>bootclasspath=${compile.bootclasspath}</echo> |
| 95 |
|
--> |
| 96 |
|
|
| 97 |
|
<javac srcdir="${prepare.src.dir}" |
| 98 |
destdir="${build.classes.dir}" |
destdir="${build.classes.dir}" |
| 99 |
debug="${build.debug}" |
debug="${build.debug}" |
| 100 |
debuglevel="${build.debuglevel}" |
debuglevel="${build.debuglevel}" |
| 102 |
source="${build.sourcelevel}" |
source="${build.sourcelevel}" |
| 103 |
fork="true"> |
fork="true"> |
| 104 |
|
|
| 105 |
<bootclasspath refid="javac.bootclasspath"/> |
<compilerarg line="${gjc.args}"/> |
| 106 |
<compilerarg line="${javac.args} ${build.warnings.option}"/> |
<bootclasspath refid="compile.bootclasspath"/> |
| 107 |
|
|
| 108 |
</javac> |
</javac> |
| 109 |
|
|
| 111 |
|
|
| 112 |
|
|
| 113 |
<target name="jar" |
<target name="jar" |
| 114 |
depends="native-jar, emulation-jar" |
depends="configure-emulation, init-jar, native-jar, emulation-jar" |
| 115 |
description="Builds library jar from compiled sources"/> |
description="Builds library jar from compiled sources"/> |
| 116 |
|
|
| 117 |
|
|
| 118 |
<target name="test" |
<target name="test" |
| 119 |
depends="init, check-junit, report-tests" |
depends="init, configure-tests, report-tests" |
| 120 |
description="Runs all tests (requires JUnit 3.8+ in ${ant.home}/lib)" /> |
description="Runs all tests (requires JUnit 3.8.1 in ${ant.home}/lib)" /> |
| 121 |
|
|
| 122 |
|
|
| 123 |
<target name="checkstyle" |
<target name="checkstyle" |
| 136 |
|
|
| 137 |
|
|
| 138 |
<target name="doccheck" |
<target name="doccheck" |
| 139 |
depends="filter-src" |
depends="filter-doccheck" |
| 140 |
description="Reports on javadoc style errors (not working yet)"> |
description="Reports on javadoc style errors"> |
| 141 |
|
|
| 142 |
<delete dir="${build.doccheck.dir}"/> |
<delete dir="${build.doccheck.dir}"/> |
| 143 |
<mkdir dir="${build.doccheck.dir}"/> |
<mkdir dir="${build.doccheck.dir}"/> |
| 145 |
<javadoc doclet="com.sun.tools.doclets.doccheck.DocCheck" |
<javadoc doclet="com.sun.tools.doclets.doccheck.DocCheck" |
| 146 |
docletpath="${lib.dir}/doccheck.jar" |
docletpath="${lib.dir}/doccheck.jar" |
| 147 |
destdir="${build.doccheck.dir}"> |
destdir="${build.doccheck.dir}"> |
| 148 |
<packageset dir="${build.filter.src.dir}"/> |
<packageset dir="${build.filter.doccheck.dir}"/> |
| 149 |
</javadoc> |
</javadoc> |
| 150 |
|
|
| 151 |
|
<echo>DocCheck output is in ${build.doccheck.dir}</echo> |
| 152 |
|
|
| 153 |
</target> |
</target> |
| 154 |
|
|
| 155 |
|
|
| 169 |
<tag name="spec" description="Specified by:"/> |
<tag name="spec" description="Specified by:"/> |
| 170 |
<tag name="editor" description="Last edited by:"/> |
<tag name="editor" description="Last edited by:"/> |
| 171 |
<tag name="fixme" description="FIX ME:"/> |
<tag name="fixme" description="FIX ME:"/> |
| 172 |
|
|
| 173 |
<packageset dir="${build.filter.src.dir}"/> |
<packageset dir="${build.filter.src.dir}"/> |
| 174 |
|
|
| 175 |
</javadoc> |
</javadoc> |
| 177 |
</target> |
</target> |
| 178 |
|
|
| 179 |
|
|
| 180 |
|
<target name="sinjdocs" |
| 181 |
|
depends="configure-tests" |
| 182 |
|
description="Builds javadocs with custom tags to build folder"> |
| 183 |
|
|
| 184 |
|
<delete dir="${build.sinjdocs.dir}"/> |
| 185 |
|
<mkdir dir="${build.sinjdocs.dir}"/> |
| 186 |
|
|
| 187 |
|
<java classname="net.cscott.sinjdoc.Main" fork="true"> |
| 188 |
|
|
| 189 |
|
<jvmarg value="-Xbootclasspath/p:${test.run.bootclasspath}"/> |
| 190 |
|
|
| 191 |
|
<classpath> |
| 192 |
|
<pathelement location="${sinjdoc.jar}"/> |
| 193 |
|
<pathelement location="${lib.dir}/jutil.jar"/> |
| 194 |
|
<pathelement location="${lib.dir}/cup.jar"/> |
| 195 |
|
<path refid="test.classpath"/> |
| 196 |
|
</classpath> |
| 197 |
|
|
| 198 |
|
|
| 199 |
|
<arg value="-d"/> <arg value="${build.sinjdocs.dir}"/> |
| 200 |
|
<arg value="-sourcepath"/> <arg value="${src.dir}"/> |
| 201 |
|
<arg value="-overview"/> <arg value="${src.dir}/intro.html"/> |
| 202 |
|
<arg value="-source"/> <arg value="${build.sourcelevel}"/> |
| 203 |
|
<!-- <arg value="-verbose"/> --> |
| 204 |
|
<!-- <arg value="-link"/> <arg value="http://java.sun.com/j2se/1.4.1/docs/api"/> --> |
| 205 |
|
<arg value="java.lang"/> |
| 206 |
|
<arg value="java.util"/> |
| 207 |
|
<arg value="java.util.concurrent"/> |
| 208 |
|
<arg value="java.util.concurrent.atomic"/> |
| 209 |
|
<arg value="java.util.concurrent.locks"/> |
| 210 |
|
|
| 211 |
<!-- |
<!-- |
| 212 |
# javac -s doesn't reliably generate compilable code. It generates |
<arg value="-help"/> |
|
# bridge methods (marked as "synthetic") that can have identical |
|
|
# signatures to existing methods except for the return value. |
|
| 213 |
--> |
--> |
| 214 |
|
|
| 215 |
|
</java> |
| 216 |
|
|
| 217 |
|
</target> |
| 218 |
|
|
| 219 |
|
|
| 220 |
<target name="strip" |
<target name="strip" |
| 221 |
depends="init"> |
depends="init, configure-compiler" |
| 222 |
|
description="Strip generics from java source (not working yet)"> |
| 223 |
|
|
| 224 |
<mkdir dir="${build.stripped.dir}"/> |
<mkdir dir="${build.stripped.dir}"/> |
| 225 |
|
|
| 226 |
|
<!-- |
| 227 |
|
# javac -s doesn't reliably generate compilable code. It generates |
| 228 |
|
# bridge methods (marked as "synthetic") that can have identical |
| 229 |
|
# signatures to existing methods except for the return value. |
| 230 |
|
--> |
| 231 |
<javac srcdir="${src.dir}" |
<javac srcdir="${src.dir}" |
| 232 |
destdir="${build.stripped.dir}" |
destdir="${build.stripped.dir}" |
| 233 |
debug="${build.debug}" |
debug="${build.debug}" |
| 236 |
source="${build.sourcelevel}" |
source="${build.sourcelevel}" |
| 237 |
fork="true"> |
fork="true"> |
| 238 |
|
|
| 239 |
<bootclasspath refid="javac.bootclasspath"/> |
<compilerarg line="${gjc.args} -s"/> |
| 240 |
<compilerarg line="${javac.args} ${build.warnings.option} -s"/> |
<bootclasspath refid="compile.bootclasspath"/> |
| 241 |
|
|
| 242 |
</javac> |
</javac> |
| 243 |
|
|
| 248 |
depends="init, dist-clean, dist-jar, dist-docs" |
depends="init, dist-clean, dist-jar, dist-docs" |
| 249 |
description="Puts all distributable products in single hierarchy"/> |
description="Puts all distributable products in single hierarchy"/> |
| 250 |
|
|
| 251 |
|
<target name="release" |
| 252 |
|
depends="dist" |
| 253 |
|
description="Puts entire CVS tree, plus distribution productions, in a jar"> |
| 254 |
|
|
| 255 |
|
<!-- |
| 256 |
|
#keep build dir? - dl |
| 257 |
|
<delete dir="${build.dir}"/> |
| 258 |
|
--> |
| 259 |
|
<property name="release.jar" value="dist/jsr166-${version}-dist.jar"/> |
| 260 |
|
|
| 261 |
|
<jar basedir="${basedir}" destfile="${release.jar}"> |
| 262 |
|
<exclude name="${release.jar}"/> |
| 263 |
|
<exclude name="user.properties"/> |
| 264 |
|
<exclude name="etc/notes/**"/> |
| 265 |
|
<exclude name="lib/gjc/2.1/**"/> |
| 266 |
|
<exclude name="**/SyntaxTest.java"/> |
| 267 |
|
</jar> |
| 268 |
|
|
| 269 |
|
</target> |
| 270 |
|
|
| 271 |
<target name="clean" |
<target name="clean" |
| 272 |
description="Removes all build products"> |
description="Removes all build products"> |
| 308 |
|
|
| 309 |
<!-- Internal targets --> |
<!-- Internal targets --> |
| 310 |
|
|
|
<target name="set-warnings-if" if="build.warnings"> |
|
|
|
|
|
<property name="build.warnings.option" value="-warnunchecked"/> |
|
|
|
|
|
</target> |
|
|
|
|
|
|
|
|
<target name="set-warnings-unless" unless="build.warnings"> |
|
|
|
|
|
<property name="build.warnings.option" value=""/> |
|
|
|
|
|
</target> |
|
| 311 |
|
|
| 312 |
|
<target name="init"> |
|
<target name="init" |
|
|
depends="set-warnings-if, set-warnings-unless"> |
|
| 313 |
|
|
| 314 |
<!-- Version is kept in a separate file --> |
<!-- Version is kept in a separate file --> |
| 315 |
<loadfile property="version" srcFile="version.properties"/> |
<loadfile property="version" srcFile="version.properties"/> |
| 326 |
|
|
| 327 |
|
|
| 328 |
<target name="native-jar" |
<target name="native-jar" |
| 329 |
depends="compile, init-jar" |
depends="compile" |
| 330 |
unless="build.emulation"> |
unless="build.emulation.true"> |
| 331 |
|
|
| 332 |
<jar destfile="${product.jar}"> |
<jar destfile="${product.jar}"> |
| 333 |
<fileset dir="${build.classes.dir}"/> |
<fileset dir="${build.classes.dir}"/> |
| 336 |
</target> |
</target> |
| 337 |
|
|
| 338 |
|
|
|
<target name="base-jar" |
|
|
depends="compile, init-jar"> |
|
|
|
|
|
<jar destfile="${product.jar}"> |
|
|
<fileset dir="${build.classes.dir}"> |
|
|
<patternset refid="emulation.excludes"/> |
|
|
</fileset> |
|
|
</jar> |
|
|
|
|
|
</target> |
|
|
|
|
|
|
|
| 339 |
<target name="compile-emulation" |
<target name="compile-emulation" |
| 340 |
depends="init" |
depends="init, configure-compiler" |
| 341 |
if="build.emulation"> |
if="build.emulation.true"> |
| 342 |
|
|
| 343 |
<mkdir dir="${build.emulation.dir}"/> |
<mkdir dir="${build.emulation.dir}"/> |
| 344 |
|
|
| 350 |
source="${build.sourcelevel}" |
source="${build.sourcelevel}" |
| 351 |
fork="true"> |
fork="true"> |
| 352 |
|
|
| 353 |
<bootclasspath refid="javac.bootclasspath"/> |
<compilerarg line="${gjc.args}"/> |
| 354 |
<compilerarg line="${javac.args} ${build.warnings.option}"/> |
<bootclasspath refid="compile.bootclasspath"/> |
| 355 |
|
|
| 356 |
</javac> |
</javac> |
| 357 |
|
|
| 359 |
|
|
| 360 |
|
|
| 361 |
<target name="emulation-jar" |
<target name="emulation-jar" |
| 362 |
depends="base-jar, compile-emulation" |
depends="compile-emulation" |
| 363 |
if="build.emulation"> |
if="build.emulation.true"> |
| 364 |
|
|
| 365 |
|
|
| 366 |
<jar destfile="${product.jar}" update="true" duplicate="add"> |
<jar destfile="${product.jar}" duplicate="add"> |
| 367 |
|
<fileset dir="${build.classes.dir}"> |
| 368 |
|
<patternset refid="atomic.exclusion"/> |
| 369 |
|
<patternset refid="unsafe.exclusion"/> |
| 370 |
|
</fileset> |
| 371 |
<fileset dir="${build.emulation.dir}"/> |
<fileset dir="${build.emulation.dir}"/> |
| 372 |
</jar> |
</jar> |
| 373 |
|
|
| 402 |
|
|
| 403 |
<copy todir="${build.filter.src.dir}"> |
<copy todir="${build.filter.src.dir}"> |
| 404 |
<fileset dir="${src.dir}"> |
<fileset dir="${src.dir}"> |
| 405 |
<patternset refid="emulation.excludes"/> |
<include name="**/*.html"/> |
| 406 |
|
</fileset> |
| 407 |
|
</copy> |
| 408 |
|
|
| 409 |
|
<copy todir="${build.filter.src.dir}"> |
| 410 |
|
<fileset dir="${src.dir}"> |
| 411 |
|
<exclude name="**/*.html"/> |
| 412 |
|
<patternset refid="unsafe.exclusion"/> |
| 413 |
</fileset> |
</fileset> |
| 414 |
<filterchain> |
<filterchain> |
| 415 |
<filterreader classname="jsr166.ant.filters.ReplaceFilter" |
|
|
classpath="${build.ant.dir}"> |
|
| 416 |
<!-- |
<!-- |
| 417 |
# These arguments are to get rid of angle-bracketed type |
# This filter gets rid of angle-bracketed type parameters |
| 418 |
# parameters so that javadoc can run on the result. The |
# so that javadoc can run on the result. The following |
| 419 |
# following heuristic that seems to work: |
# heuristic seems to work: |
| 420 |
# |
# |
| 421 |
# For all lines not starting with space(s)-asterisk-space(s), |
# For all lines not starting with space(s)-asterisk-space(s), |
| 422 |
# replace <something> with a space, where there may be more |
# replace <something> with a space, where there may be more |
| 424 |
# must not contain parens or pipes. (This may need some |
# must not contain parens or pipes. (This may need some |
| 425 |
# tweaking.) |
# tweaking.) |
| 426 |
--> |
--> |
| 427 |
|
|
| 428 |
|
<filterreader classname="jsr166.ant.filters.ReplaceFilter" |
| 429 |
|
classpath="${build.ant.dir}"> |
| 430 |
<param name="notmatching" value="^\s+\*\s.*$"/> |
<param name="notmatching" value="^\s+\*\s.*$"/> |
| 431 |
<param name="pattern" value="<[^|>()]+?>+"/> |
<param name="pattern" value="<[^|>()]+?>+"/> |
| 432 |
<param name="replacement" value=" "/> |
<param name="replacement" value=" "/> |
| 433 |
</filterreader> |
</filterreader> |
| 434 |
<filterreader classname="jsr166.ant.filters.ReplaceFilter" |
|
| 435 |
classpath="${build.ant.dir}"> |
|
| 436 |
<!-- |
<!-- |
| 437 |
# These arguments are to uncomment lines beginning with |
# This filter uncomments lines beginning with "//@" so that |
| 438 |
# "//@" so that javadoc can see imports that are needed |
# javadoc can see imports that are needed to resolve links |
| 439 |
# to resolve links but that shouldn't be in the compiled |
# but that shouldn't be in the compiled code. |
|
# code. |
|
| 440 |
--> |
--> |
| 441 |
|
|
| 442 |
|
<filterreader classname="jsr166.ant.filters.ReplaceFilter" |
| 443 |
|
classpath="${build.ant.dir}"> |
| 444 |
<param name="matching" value="^//@.*$"/> |
<param name="matching" value="^//@.*$"/> |
| 445 |
<param name="pattern" value="^//@"/> |
<param name="pattern" value="^//@"/> |
| 446 |
<param name="replacement" value=""/> |
<param name="replacement" value=""/> |
| 451 |
</target> |
</target> |
| 452 |
|
|
| 453 |
|
|
| 454 |
|
|
| 455 |
|
|
| 456 |
|
<target name="filter-doccheck" |
| 457 |
|
depends="filter-src"> |
| 458 |
|
|
| 459 |
|
<mkdir dir="${build.filter.doccheck.dir}"/> |
| 460 |
|
|
| 461 |
|
<copy todir="${build.filter.doccheck.dir}"> |
| 462 |
|
<fileset dir="${build.filter.src.dir}"> |
| 463 |
|
<include name="**/*.html"/> |
| 464 |
|
</fileset> |
| 465 |
|
</copy> |
| 466 |
|
|
| 467 |
|
<property name="generic.declarations" |
| 468 |
|
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 {}" |
| 469 |
|
/> |
| 470 |
|
|
| 471 |
|
<copy todir="${build.filter.doccheck.dir}"> |
| 472 |
|
<fileset dir="${build.filter.src.dir}"> |
| 473 |
|
<exclude name="**/*.html"/> |
| 474 |
|
</fileset> |
| 475 |
|
<filterchain> |
| 476 |
|
<!-- |
| 477 |
|
# These two filters try to make the source look like |
| 478 |
|
# something that doccheck can process. The first removes |
| 479 |
|
# -source 1.4 assertions and the second adds in a bunch |
| 480 |
|
# of single letter public nested marker interfaces so that |
| 481 |
|
# the generic type parameters are recognized. |
| 482 |
|
--> |
| 483 |
|
|
| 484 |
|
<filterreader classname="jsr166.ant.filters.ReplaceFilter" |
| 485 |
|
classpath="${build.ant.dir}"> |
| 486 |
|
<param name="matching" value="^\s*assert[\s ].*$"/> |
| 487 |
|
<param name="pattern" value="assert"/> |
| 488 |
|
<param name="replacement" value="//assert"/> |
| 489 |
|
</filterreader> |
| 490 |
|
|
| 491 |
|
<filterreader classname="jsr166.ant.filters.ReplaceFilter" |
| 492 |
|
classpath="${build.ant.dir}"> |
| 493 |
|
<param name="matching" value="^([^*]*(class|interface|implements) .*|)\{.*$"/> |
| 494 |
|
<param name="pattern" value="$"/> |
| 495 |
|
<param name="replacement" value=" ${generic.declarations}"/> |
| 496 |
|
</filterreader> |
| 497 |
|
|
| 498 |
|
</filterchain> |
| 499 |
|
</copy> |
| 500 |
|
|
| 501 |
|
</target> |
| 502 |
|
|
| 503 |
|
|
| 504 |
<target name="compile-tests" |
<target name="compile-tests" |
| 505 |
depends="jar"> |
depends="jar"> |
| 506 |
|
|
| 507 |
<mkdir dir="${build.testcases.dir}"/> |
<mkdir dir="${build.testcases.dir}"/> |
| 508 |
|
|
| 509 |
|
<!-- |
| 510 |
|
<echo>javac ${gjc.args}</echo> |
| 511 |
|
<echo>bootclasspath=${test.compile.bootclasspath}</echo> |
| 512 |
|
<echo>classpath="${test.classpath}"</echo> |
| 513 |
|
--> |
| 514 |
|
|
| 515 |
<javac srcdir="${test.src.dir}" |
<javac srcdir="${test.src.dir}" |
| 516 |
destdir="${build.testcases.dir}" |
destdir="${build.testcases.dir}" |
| 517 |
debug="${build.debug}" |
debug="${build.debug}" |
| 520 |
source="${build.sourcelevel}" |
source="${build.sourcelevel}" |
| 521 |
fork="true"> |
fork="true"> |
| 522 |
|
|
| 523 |
<bootclasspath refid="javac.bootclasspath"/> |
<compilerarg line="${gjc.args}"/> |
| 524 |
<compilerarg line="${javac.args} ${build.warnings.option}"/> |
<bootclasspath refid="test.compile.bootclasspath"/> |
| 525 |
<classpath refid="test.classpath"/> |
<classpath refid="test.classpath"/> |
| 526 |
|
|
| 527 |
</javac> |
</javac> |
| 544 |
dir="${build.reports.dir}" |
dir="${build.reports.dir}" |
| 545 |
fork="true"> |
fork="true"> |
| 546 |
|
|
| 547 |
<jvmarg value="${test.javac.args}"/> |
<jvmarg value="-Xbootclasspath/p:${test.run.bootclasspath}"/> |
| 548 |
|
|
| 549 |
<formatter type="xml"/> |
<formatter type="xml"/> |
| 550 |
|
|
| 585 |
</target> |
</target> |
| 586 |
|
|
| 587 |
|
|
| 588 |
<target name="check-junit"> |
<target name="configure-compiler"> |
| 589 |
|
|
| 590 |
|
<property name="gjc.version" |
| 591 |
|
value="2.2"/> |
| 592 |
|
|
| 593 |
|
<condition property="novariance.arg" value="-novariance"> |
| 594 |
|
<and> |
| 595 |
|
<equals arg1="${gjc.version}" arg2="2.0"/> |
| 596 |
|
<or> |
| 597 |
|
<not><isset property="gjc.novariance"/></not> |
| 598 |
|
<istrue value="${gjc.novariance}"/> |
| 599 |
|
</or> |
| 600 |
|
</and> |
| 601 |
|
</condition> |
| 602 |
|
|
| 603 |
|
<property name="novariance.arg" |
| 604 |
|
value=""/> |
| 605 |
|
|
| 606 |
|
<property name="gjc.dir" |
| 607 |
|
value="${lib.dir}/gjc"/> |
| 608 |
|
|
| 609 |
|
<property name="javac.jar" |
| 610 |
|
location="${gjc.dir}/${gjc.version}/javac.jar"/> |
| 611 |
|
|
| 612 |
|
<property name="collect.jar" |
| 613 |
|
location="${gjc.dir}/${gjc.version}/collect${novariance.arg}.jar"/> |
| 614 |
|
|
| 615 |
|
|
| 616 |
|
<condition property="warnunchecked.arg" value="-warnunchecked"> |
| 617 |
|
<istrue value="${gjc.warnunchecked}"/> |
| 618 |
|
</condition> |
| 619 |
|
|
| 620 |
|
<property name="warnunchecked.arg" value=""/> |
| 621 |
|
|
| 622 |
|
<condition property="prepare.src.dir" value="${build.dir}/prepare-src"> |
| 623 |
|
<istrue value="${build.nothreads}"/> |
| 624 |
|
</condition> |
| 625 |
|
|
| 626 |
|
|
| 627 |
|
<!-- |
| 628 |
|
! Bootclasspath munging for source compilation. |
| 629 |
|
--> |
| 630 |
|
|
| 631 |
|
<path id="pre.bootclasspath"> |
| 632 |
|
<pathelement location="${javac.jar}"/> |
| 633 |
|
</path> |
| 634 |
|
|
| 635 |
|
<path id="compile.bootclasspath"> |
| 636 |
|
<pathelement location="${build.classes.dir}"/> |
| 637 |
|
<pathelement location="${collect.jar}"/> |
| 638 |
|
<pathelement location="${rt.jar}"/> |
| 639 |
|
</path> |
| 640 |
|
|
| 641 |
|
<!-- Flatten paths into platform-appropriate strings --> |
| 642 |
|
<property name="pre.bootclasspath" refid="pre.bootclasspath"/> |
| 643 |
|
<property name="compile.bootclasspath" refid="compile.bootclasspath"/> |
| 644 |
|
|
| 645 |
|
|
| 646 |
|
<!-- Common options in javac invocations --> |
| 647 |
|
<property name="gjc.args" |
| 648 |
|
value="-J-Xbootclasspath/p:${pre.bootclasspath} ${warnunchecked.arg} ${novariance.arg}" |
| 649 |
|
/> |
| 650 |
|
|
| 651 |
|
</target> |
| 652 |
|
|
| 653 |
|
|
| 654 |
|
<target name="prepare-src" |
| 655 |
|
depends="configure-compiler" |
| 656 |
|
if="prepare.src.dir"> |
| 657 |
|
|
| 658 |
|
<mkdir dir="${prepare.src.dir}"/> |
| 659 |
|
<copy todir="${prepare.src.dir}"> |
| 660 |
|
<fileset dir="${src.dir}"> |
| 661 |
|
<exclude name="java/lang/**"/> |
| 662 |
|
</fileset> |
| 663 |
|
</copy> |
| 664 |
|
|
| 665 |
|
</target> |
| 666 |
|
|
| 667 |
|
|
| 668 |
|
<target name="configure-emulation"> |
| 669 |
|
|
| 670 |
|
<condition property="build.emulation.true"> |
| 671 |
|
<or> |
| 672 |
|
<and> |
| 673 |
|
<os family="windows"/> |
| 674 |
|
<not> |
| 675 |
|
<isset property="build.emulation"/> |
| 676 |
|
</not> |
| 677 |
|
</and> |
| 678 |
|
<istrue value="${build.emulation}"/> |
| 679 |
|
</or> |
| 680 |
|
</condition> |
| 681 |
|
|
| 682 |
|
</target> |
| 683 |
|
|
| 684 |
|
|
| 685 |
|
<target name="configure-tests" |
| 686 |
|
depends="configure-compiler"> |
| 687 |
|
|
| 688 |
<!-- junit.framework.Protectable is in JUnit 3.8.1 but not in 3.7 --> |
<!-- junit.framework.Protectable is in JUnit 3.8.1 but not in 3.7 --> |
| 689 |
<available property="junit.available" |
<available property="junit.available" |
| 692 |
<fail message="Need JUnit 3.8.1 in ${ant.home}${file.separator}lib to run tests" |
<fail message="Need JUnit 3.8.1 in ${ant.home}${file.separator}lib to run tests" |
| 693 |
unless="junit.available"/> |
unless="junit.available"/> |
| 694 |
|
|
| 695 |
|
|
| 696 |
|
<!-- |
| 697 |
|
! Bootclasspath munging for testing, so JUnit can test our local |
| 698 |
|
! modifications to java.*. |
| 699 |
|
--> |
| 700 |
|
|
| 701 |
|
<path id="test.classpath"> |
| 702 |
|
<pathelement location="${product.jar}"/> |
| 703 |
|
<pathelement location="${build.testcases.dir}"/> |
| 704 |
|
<pathelement location="${junit.jar}"/> |
| 705 |
|
</path> |
| 706 |
|
|
| 707 |
|
<path id="test.compile.bootclasspath"> |
| 708 |
|
<pathelement location="${javac.jar}"/> |
| 709 |
|
<pathelement location="${collect.jar}"/> |
| 710 |
|
<pathelement location="${rt.jar}"/> |
| 711 |
|
</path> |
| 712 |
|
|
| 713 |
|
<path id="test.run.bootclasspath"> |
| 714 |
|
<pathelement location="${javac.jar}"/> |
| 715 |
|
<path refid="test.classpath"/> |
| 716 |
|
</path> |
| 717 |
|
|
| 718 |
|
<!-- Flatten test classpaths into platform-appropriate strings --> |
| 719 |
|
<property name="test.classpath" refid="test.classpath"/> |
| 720 |
|
<property name="test.compile.bootclasspath" refid="test.compile.bootclasspath"/> |
| 721 |
|
<property name="test.run.bootclasspath" refid="test.run.bootclasspath"/> |
| 722 |
|
|
| 723 |
</target> |
</target> |
| 724 |
|
|
| 725 |
|
|
| 749 |
</target> |
</target> |
| 750 |
|
|
| 751 |
|
|
| 752 |
|
<target name="ng" depends="test"> |
| 753 |
|
<java classname="SuperfluousAbstract" fork="true"> |
| 754 |
|
|
| 755 |
|
<jvmarg value="-Xbootclasspath/p:${test.run.bootclasspath}"/> |
| 756 |
|
|
| 757 |
|
</java> |
| 758 |
|
</target> |
| 759 |
|
|
| 760 |
|
|
| 761 |
</project> |
</project> |