| 1 |
<project name="jsr166" default="jar"> |
<project name="jsr166" default="usage"> |
| 2 |
|
|
| 3 |
<description> |
<description> |
| 4 |
|
------------------------------------------------------------------------------ |
| 5 |
Build file for JSR-166 |
Build file for JSR-166 |
| 6 |
|
|
| 7 |
Note that junit.jar must be in ${ant.home}/lib for the |
Usage: ant [target] |
| 8 |
test target to work. [FIXME: This should be automatically |
|
| 9 |
enforced by this build file by failing with a message if |
User-specific settings are read from user.properties. |
| 10 |
junit.jar is not in the right place.] |
See user.properties.sample for an explanation of some useful settings. |
| 11 |
|
------------------------------------------------------------------------------ |
| 12 |
</description> |
</description> |
| 13 |
|
|
| 14 |
|
<target name="usage" description="Advises user to run with -projecthelp"> |
| 15 |
|
<echo>Run "ant -projecthelp" for full usage information.</echo> |
| 16 |
|
</target> |
| 17 |
|
|
| 18 |
|
|
| 19 |
|
<!-- User-specific settings --> |
| 20 |
|
<property file="user.properties"/> |
| 21 |
|
|
| 22 |
|
|
| 23 |
<!-- Compilation options --> |
<!-- Compilation options --> |
| 24 |
|
<property name="build.sourcelevel" value="1.5"/> |
| 25 |
<property name="build.debug" value="true"/> |
<property name="build.debug" value="true"/> |
| 26 |
<property name="build.debuglevel" value="source,lines,vars"/> |
<property name="build.debuglevel" value="source,lines,vars"/> |
| 27 |
<property name="build.deprecation" value="false"/> |
<property name="build.deprecation" value="false"/> |
|
<property name="build.sourcelevel" value="1.5"/> |
|
| 28 |
|
|
| 29 |
<!-- Build locations --> |
<!-- Build locations --> |
| 30 |
<property name="build.dir" location="build"/> |
<property name="build.dir" location="build"/> |
| 34 |
<property name="build.ant.dir" location="${build.dir}/ant"/> |
<property name="build.ant.dir" location="${build.dir}/ant"/> |
| 35 |
<property name="build.javadocs.dir" location="${build.dir}/javadocs"/> |
<property name="build.javadocs.dir" location="${build.dir}/javadocs"/> |
| 36 |
<property name="build.reports.dir" location="${build.dir}/reports"/> |
<property name="build.reports.dir" location="${build.dir}/reports"/> |
| 37 |
|
<property name="build.checkstyle.dir" location="${build.dir}/checkstyle"/> |
| 38 |
|
<property name="build.doccheck.dir" location="${build.dir}/doccheck"/> |
| 39 |
<property name="build.filter.src.dir" location="${build.dir}/filtersrc"/> |
<property name="build.filter.src.dir" location="${build.dir}/filtersrc"/> |
| 40 |
|
<property name="build.dc-filter.dir" location="${build.dir}/filterdocchk"/> |
| 41 |
|
|
| 42 |
<!-- Source locations --> |
<!-- Source locations --> |
| 43 |
<property name="src.dir" location="${basedir}"/> |
<property name="src.dir" location="${basedir}/src/main"/> |
| 44 |
<property name="test.src.dir" location="${basedir}/etc/testcases"/> |
<property name="test.src.dir" location="${basedir}/src/test"/> |
| 45 |
<property name="ant.src.dir" location="${basedir}/etc/ant"/> |
<property name="ant.src.dir" location="${basedir}/etc/ant"/> |
| 46 |
<property name="stylesheet.dir" location="${basedir}/etc/xsl"/> |
<property name="stylesheet.dir" location="${basedir}/etc/xsl"/> |
| 47 |
<property name="lib.dir" location="${basedir}/lib"/> |
<property name="lib.dir" location="${basedir}/lib"/> |
| 52 |
|
|
| 53 |
<!-- Jar locations --> |
<!-- Jar locations --> |
| 54 |
<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"/> |
|
| 55 |
<property name="junit.jar" location="${lib.dir}/junit.jar"/> |
<property name="junit.jar" location="${lib.dir}/junit.jar"/> |
|
<property name="rt.jar" location="${java.home}/lib/rt.jar"/> |
|
| 56 |
|
|
| 57 |
<property name="gj.compiler.args" |
<!-- Bootclasspath argument --> |
| 58 |
value='-J-Xbootclasspath/p:${javac.jar} -deprecation -warnunchecked' |
<property name="bootclasspath.args" value="-Xbootclasspath/p:${product.jar}"/> |
|
/> |
|
|
|
|
|
<path id="gj.compiler.bootclasspath"> |
|
|
<pathelement location="${collect.jar}"/> |
|
|
<pathelement location="${rt.jar}"/> |
|
|
</path> |
|
| 59 |
|
|
| 60 |
|
<!-- Test classpath --> |
| 61 |
<path id="test.classpath"> |
<path id="test.classpath"> |
| 62 |
<pathelement location="${product.jar}"/> |
<pathelement location="${build.testcases.dir}"/> |
| 63 |
|
<pathelement location="${junit.jar}"/> |
| 64 |
</path> |
</path> |
| 65 |
|
|
| 66 |
|
|
| 67 |
<target name="compile"> |
|
| 68 |
|
<!-- Main targets --> |
| 69 |
|
|
| 70 |
|
|
| 71 |
|
<target name="compile" |
| 72 |
|
depends="init, configure-compiler, prepare-src" |
| 73 |
|
description="Compiles main sources to build folder"> |
| 74 |
|
|
| 75 |
<mkdir dir="${build.classes.dir}"/> |
<mkdir dir="${build.classes.dir}"/> |
| 76 |
<javac srcdir="${src.dir}" |
|
| 77 |
|
<javac srcdir="${prepare.src.dir}" |
| 78 |
destdir="${build.classes.dir}" |
destdir="${build.classes.dir}" |
| 79 |
debug="${build.debug}" |
debug="${build.debug}" |
| 80 |
debuglevel="${build.debuglevel}" |
debuglevel="${build.debuglevel}" |
| 82 |
source="${build.sourcelevel}" |
source="${build.sourcelevel}" |
| 83 |
fork="true"> |
fork="true"> |
| 84 |
|
|
| 85 |
<bootclasspath refid="gj.compiler.bootclasspath"/> |
<compilerarg line="${build.args}"/> |
|
<compilerarg line="${gj.compiler.args}"/> |
|
|
|
|
|
<!-- need this because srcdir is basedir! --> |
|
|
<include name="java/**/*.java"/> |
|
| 86 |
|
|
| 87 |
</javac> |
</javac> |
| 88 |
|
|
| 89 |
</target> |
</target> |
| 90 |
|
|
| 91 |
|
|
| 92 |
<target name="jar" depends="compile"> |
|
| 93 |
|
<target name="jar" |
| 94 |
|
depends="compile" |
| 95 |
|
description="Builds library jar from compiled sources"> |
| 96 |
|
|
| 97 |
<mkdir dir="${build.lib.dir}"/> |
<mkdir dir="${build.lib.dir}"/> |
| 98 |
<jar basedir="${build.classes.dir}" |
|
| 99 |
destfile="${product.jar}" |
<jar destfile="${product.jar}"> |
| 100 |
/> |
<fileset dir="${build.classes.dir}"/> |
| 101 |
|
</jar> |
| 102 |
|
|
| 103 |
</target> |
</target> |
| 104 |
|
|
| 105 |
|
|
|
<target name="test" depends="report-tests"/> |
|
| 106 |
|
|
| 107 |
|
<target name="test" |
| 108 |
|
depends="init, configure-tests, report-tests" |
| 109 |
|
description="Runs all tests (requires JUnit 3.8.1 in ${ant.home}/lib)" /> |
| 110 |
|
|
| 111 |
<target name="docs" depends="clean-filtered-src, filter-src" |
|
| 112 |
|
|
| 113 |
|
<target name="docs" |
| 114 |
description="Builds javadocs with custom tags to build folder"> |
description="Builds javadocs with custom tags to build folder"> |
| 115 |
|
|
| 116 |
<delete dir="${build.javadocs.dir}"/> |
<delete dir="${build.javadocs.dir}"/> |
| 117 |
<mkdir dir="${build.javadocs.dir}"/> |
<mkdir dir="${build.javadocs.dir}"/> |
| 118 |
|
|
| 119 |
<javadoc destdir="${build.javadocs.dir}" |
<javadoc destdir="${build.javadocs.dir}" |
| 120 |
link="http://java.sun.com/j2se/1.4.1/docs/api" |
link="http://java.sun.com/j2se/1.4.1/docs/api" |
| 121 |
overview="${src.dir}/intro.html" |
overview="${src.dir}/intro.html" |
| 123 |
|
|
| 124 |
<tag name="revised" description="Last revised:"/> |
<tag name="revised" description="Last revised:"/> |
| 125 |
<tag name="spec" description="Specified by:"/> |
<tag name="spec" description="Specified by:"/> |
| 126 |
<tag name="editor" description="Last edited by:"/> |
|
| 127 |
<tag name="fixme" description="FIX ME:"/> |
<packageset dir="${src.dir}"/> |
|
<packageset dir="${build.filter.src.dir}"> |
|
|
<include name="java/**"/> |
|
|
</packageset> |
|
| 128 |
|
|
| 129 |
</javadoc> |
</javadoc> |
| 130 |
|
|
| 131 |
</target> |
</target> |
| 132 |
|
|
| 133 |
|
|
|
<target name="dist-docs" depends="clean-filtered-src, filter-src" |
|
|
description="Builds javadocs without custom tags to dist folder"> |
|
|
<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.sourcelevel}"> |
|
| 134 |
|
|
| 135 |
<packageset dir="${build.filter.src.dir}"> |
<target name="checkstyle" |
| 136 |
<include name="java/**"/> |
depends="filter-src" |
| 137 |
</packageset> |
description="Reports on style errors in Java source (verbose, mostly chaff)"> |
| 138 |
|
|
| 139 |
|
<taskdef resource="checkstyletask.properties" |
| 140 |
|
classpath="${lib.dir}/checkstyle-all-3.1.jar"/> |
| 141 |
|
|
| 142 |
|
<mkdir dir="${build.checkstyle.dir}"/> |
| 143 |
|
|
| 144 |
|
<checkstyle config="etc/checkstyle/sun_checks.xml" |
| 145 |
|
failOnViolation="false"> |
| 146 |
|
<formatter type="xml" toFile="${build.checkstyle.dir}/checkstyle-report.xml"/> |
| 147 |
|
<fileset dir="${build.filter.src.dir}" includes="**/*.java"/> |
| 148 |
|
</checkstyle> |
| 149 |
|
|
| 150 |
|
<style in="${build.checkstyle.dir}/checkstyle-report.xml" |
| 151 |
|
out="${build.checkstyle.dir}/checkstyle-report.html" |
| 152 |
|
style="${stylesheet.dir}/checkstyle-frames.xsl"/> |
| 153 |
|
|
| 154 |
|
</target> |
| 155 |
|
|
| 156 |
|
|
| 157 |
|
|
| 158 |
|
<target name="doccheck" |
| 159 |
|
depends="filter-doccheck" |
| 160 |
|
description="Reports on javadoc style errors"> |
| 161 |
|
|
| 162 |
|
<delete dir="${build.doccheck.dir}"/> |
| 163 |
|
<mkdir dir="${build.doccheck.dir}"/> |
| 164 |
|
|
| 165 |
|
<javadoc doclet="com.sun.tools.doclets.doccheck.DocCheck" |
| 166 |
|
docletpath="${lib.dir}/doccheck.jar" |
| 167 |
|
destdir="${build.doccheck.dir}"> |
| 168 |
|
<packageset dir="${build.dc-filter.dir}"/> |
| 169 |
</javadoc> |
</javadoc> |
| 170 |
|
|
| 171 |
|
<echo>DocCheck output is in ${build.doccheck.dir}</echo> |
| 172 |
|
|
| 173 |
</target> |
</target> |
| 174 |
|
|
| 175 |
|
|
| 176 |
<target name="dist" depends="clean, jar, dist-docs"> |
|
| 177 |
<!-- nothing to do here yet --> |
<target name="dist" |
| 178 |
|
depends="init, dist-clean, dist-jar, dist-docs" |
| 179 |
|
description="Puts all distributable products in single hierarchy"/> |
| 180 |
|
|
| 181 |
|
|
| 182 |
|
|
| 183 |
|
<target name="release" |
| 184 |
|
depends="dist" |
| 185 |
|
description="Puts entire CVS tree, plus distribution productions, in a jar"> |
| 186 |
|
|
| 187 |
|
<property name="release.jar" value="dist/jsr166-${version}-dist.jar"/> |
| 188 |
|
|
| 189 |
|
<jar basedir="${basedir}" destfile="${release.jar}"> |
| 190 |
|
<!-- <exclude name="build/**"/> --> |
| 191 |
|
<exclude name="${release.jar}"/> |
| 192 |
|
<exclude name="user.properties"/> |
| 193 |
|
<exclude name="etc/notes/**"/> |
| 194 |
|
<exclude name="src/emulation/**"/> |
| 195 |
|
<exclude name="**/SyntaxTest.java"/> |
| 196 |
|
<exclude name="**/SuperfluousAbstract.java"/> |
| 197 |
|
</jar> |
| 198 |
|
|
| 199 |
</target> |
</target> |
| 200 |
|
|
| 201 |
|
|
| 202 |
<target name="clean"> |
|
| 203 |
|
<target name="clean" |
| 204 |
|
description="Removes all build products"> |
| 205 |
|
|
| 206 |
<delete dir="${build.dir}"/> |
<delete dir="${build.dir}"/> |
| 207 |
<delete dir="${build.classes.dir}"/> |
<delete dir="${build.classes.dir}"/> |
| 208 |
<delete dir="${build.lib.dir}"/> |
<delete dir="${build.lib.dir}"/> |
| 209 |
|
|
| 210 |
</target> |
</target> |
| 211 |
|
|
| 212 |
|
|
| 213 |
<target name="dist-clean" depends="clean"> |
|
| 214 |
|
<target name="dist-clean" |
| 215 |
|
description="Removes all build and distribution products"> |
| 216 |
|
|
| 217 |
<delete dir="${dist.dir}"/> |
<delete dir="${dist.dir}"/> |
| 218 |
|
|
| 219 |
|
</target> |
| 220 |
|
|
| 221 |
|
|
| 222 |
|
|
| 223 |
|
<target name="dist-docs" |
| 224 |
|
description="Builds javadocs without custom tags to dist folder"> |
| 225 |
|
|
| 226 |
|
<delete dir="${dist.javadocs.dir}"/> |
| 227 |
|
<mkdir dir="${dist.javadocs.dir}"/> |
| 228 |
|
|
| 229 |
|
<javadoc destdir="${dist.javadocs.dir}" |
| 230 |
|
link="http://java.sun.com/j2se/1.4.2/docs/api" |
| 231 |
|
overview="${src.dir}/intro.html" |
| 232 |
|
source="${build.sourcelevel}"> |
| 233 |
|
|
| 234 |
|
<packageset dir="${src.dir}"/> |
| 235 |
|
|
| 236 |
|
</javadoc> |
| 237 |
|
|
| 238 |
|
</target> |
| 239 |
|
|
| 240 |
|
|
| 241 |
|
|
| 242 |
|
<!-- Internal targets --> |
| 243 |
|
|
| 244 |
|
|
| 245 |
|
<target name="init"> |
| 246 |
|
|
| 247 |
|
<!-- Version is kept in a separate file --> |
| 248 |
|
<loadfile property="version" srcFile="version.properties"/> |
| 249 |
|
<echo>Building JSR-166 version ${version}</echo> |
| 250 |
|
<echo>java.home is ${java.home}</echo> |
| 251 |
|
|
| 252 |
</target> |
</target> |
| 253 |
|
|
| 254 |
|
|
| 255 |
<target name="clean-filtered-src"> |
<target name="dist-jar" |
| 256 |
<delete dir="${build.filter.src.dir}"/> |
depends="clean, jar"> |
| 257 |
|
|
| 258 |
|
<copy file="${product.jar}" todir="${dist.dir}"/> |
| 259 |
|
|
| 260 |
</target> |
</target> |
| 261 |
|
|
| 262 |
|
|
| 263 |
<!-- Internal targets used by docs target --> |
<target name="compile-ant-filter" |
| 264 |
|
depends="init"> |
| 265 |
|
|
|
<target name="compile-ant"> |
|
| 266 |
<mkdir dir="${build.ant.dir}"/> |
<mkdir dir="${build.ant.dir}"/> |
| 267 |
|
|
| 268 |
<javac srcdir="${ant.src.dir}" |
<javac srcdir="${ant.src.dir}" |
| 269 |
destdir="${build.ant.dir}" |
destdir="${build.ant.dir}" |
| 270 |
source="1.4" |
source="1.4" |
| 271 |
/> |
/> |
| 272 |
|
|
| 273 |
</target> |
</target> |
| 274 |
|
|
| 275 |
|
|
| 276 |
<target name="filter-src" depends="compile-ant"> |
<target name="filter-src" |
| 277 |
|
depends="compile-ant-filter"> |
| 278 |
|
|
| 279 |
<mkdir dir="${build.filter.src.dir}"/> |
<mkdir dir="${build.filter.src.dir}"/> |
| 280 |
|
|
| 281 |
<copy todir="${build.filter.src.dir}"> |
<copy todir="${build.filter.src.dir}"> |
| 282 |
<fileset dir="${src.dir}"> |
<fileset dir="${src.dir}"> |
| 283 |
<include name="**/*.java"/> |
<include name="**/*.html"/> |
| 284 |
</fileset> |
</fileset> |
| 285 |
|
</copy> |
| 286 |
|
|
| 287 |
|
<copy todir="${build.filter.src.dir}"> |
| 288 |
|
<fileset dir="${src.dir}"> |
| 289 |
|
<exclude name="**/*.html"/> |
| 290 |
|
<!-- Files excluded from dist-docs --> |
| 291 |
|
<exclude name="java/util/Random.*"/> |
| 292 |
|
<exclude name="sun/misc/Unsafe.*"/> |
| 293 |
|
</fileset> |
| 294 |
|
<!-- |
| 295 |
<filterchain> |
<filterchain> |
| 296 |
<filterreader classname="jsr166.ant.filters.ReplaceFilter" |
--> |
| 297 |
classpath="${build.ant.dir}"> |
|
| 298 |
<!-- |
<!-- |
| 299 |
# These arguments are to get rid of angle-bracketed type |
# This filter gets rid of angle-bracketed type parameters |
| 300 |
# parameters so that javadoc can run on the result. The |
# so that javadoc can run on the result. The following |
| 301 |
# following heuristic that seems to work: |
# heuristic seems to work: |
| 302 |
# |
# |
| 303 |
# For all lines not starting with space(s)-asterisk-space(s), |
# For all lines not starting with space(s)-asterisk-space(s), |
| 304 |
# replace <something> with a space, where there may be more |
# replace <something> with a space, where there may be more |
| 306 |
# must not contain parens or pipes. (This may need some |
# must not contain parens or pipes. (This may need some |
| 307 |
# tweaking.) |
# tweaking.) |
| 308 |
--> |
--> |
| 309 |
|
|
| 310 |
|
<!-- |
| 311 |
|
<filterreader classname="jsr166.ant.filters.ReplaceFilter" |
| 312 |
|
classpath="${build.ant.dir}"> |
| 313 |
<param name="notmatching" value="^\s+\*\s.*$"/> |
<param name="notmatching" value="^\s+\*\s.*$"/> |
| 314 |
<param name="pattern" value="<[^|>()]+?>+"/> |
<param name="pattern" value="<[^|>()]+?>+"/> |
| 315 |
<param name="replacement" value=" "/> |
<param name="replacement" value=" "/> |
| 316 |
</filterreader> |
</filterreader> |
| 317 |
<filterreader classname="jsr166.ant.filters.ReplaceFilter" |
--> |
| 318 |
classpath="${build.ant.dir}"> |
|
| 319 |
<!-- |
<!-- |
| 320 |
# These arguments are to uncomment lines beginning with |
</filterchain> |
|
# "//@" so that javadoc can see imports that are needed |
|
|
# to resolve links but that shouldn't be in the compiled |
|
|
# code. |
|
| 321 |
--> |
--> |
| 322 |
<param name="matching" value="^//@.*$"/> |
</copy> |
| 323 |
<param name="pattern" value="^//@"/> |
|
| 324 |
<param name="replacement" value=""/> |
</target> |
| 325 |
|
|
| 326 |
|
|
| 327 |
|
<target name="filter-doccheck" |
| 328 |
|
depends="filter-src"> |
| 329 |
|
|
| 330 |
|
<mkdir dir="${build.dc-filter.dir}"/> |
| 331 |
|
|
| 332 |
|
<copy todir="${build.dc-filter.dir}"> |
| 333 |
|
<fileset dir="${build.filter.src.dir}"> |
| 334 |
|
<include name="**/*.html"/> |
| 335 |
|
</fileset> |
| 336 |
|
</copy> |
| 337 |
|
|
| 338 |
|
<property name="generic.declarations" |
| 339 |
|
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 {}" |
| 340 |
|
/> |
| 341 |
|
|
| 342 |
|
<copy todir="${build.dc-filter.dir}"> |
| 343 |
|
<fileset dir="${build.filter.src.dir}"> |
| 344 |
|
<exclude name="**/*.html"/> |
| 345 |
|
</fileset> |
| 346 |
|
<filterchain> |
| 347 |
|
<!-- |
| 348 |
|
# These two filters try to make the source look like |
| 349 |
|
# something that doccheck can process. The first removes |
| 350 |
|
# -source 1.4 assertions and the second adds in a bunch |
| 351 |
|
# of single letter public nested marker interfaces so that |
| 352 |
|
# the generic type parameters are recognized. |
| 353 |
|
--> |
| 354 |
|
|
| 355 |
|
<filterreader classname="jsr166.ant.filters.ReplaceFilter" |
| 356 |
|
classpath="${build.ant.dir}"> |
| 357 |
|
<param name="matching" value="^\s*assert[\s ].*$"/> |
| 358 |
|
<param name="pattern" value="assert"/> |
| 359 |
|
<param name="replacement" value="//assert"/> |
| 360 |
|
</filterreader> |
| 361 |
|
|
| 362 |
|
<filterreader classname="jsr166.ant.filters.ReplaceFilter" |
| 363 |
|
classpath="${build.ant.dir}"> |
| 364 |
|
<param name="matching" value="^([^*]*(class|interface|implements) .*|)\{.*$"/> |
| 365 |
|
<param name="pattern" value="$"/> |
| 366 |
|
<param name="replacement" value=" ${generic.declarations}"/> |
| 367 |
</filterreader> |
</filterreader> |
| 368 |
|
|
| 369 |
</filterchain> |
</filterchain> |
| 370 |
</copy> |
</copy> |
| 371 |
|
|
| 372 |
</target> |
</target> |
| 373 |
|
|
| 374 |
|
|
| 375 |
<!-- Internal targets used by test target --> |
<target name="compile-tests" |
| 376 |
|
depends="jar"> |
| 377 |
|
|
|
<target name="compile-tests" depends="jar"> |
|
| 378 |
<mkdir dir="${build.testcases.dir}"/> |
<mkdir dir="${build.testcases.dir}"/> |
| 379 |
<javac srcdir="${test.src.dir}" |
|
| 380 |
|
<javac srcdir="${test.src.dir}/tck" |
| 381 |
destdir="${build.testcases.dir}" |
destdir="${build.testcases.dir}" |
| 382 |
debug="${build.debug}" |
debug="${build.debug}" |
| 383 |
debuglevel="${build.debuglevel}" |
debuglevel="${build.debuglevel}" |
| 385 |
source="${build.sourcelevel}" |
source="${build.sourcelevel}" |
| 386 |
fork="true"> |
fork="true"> |
| 387 |
|
|
| 388 |
<bootclasspath refid="gj.compiler.bootclasspath"/> |
<compilerarg value="${bootclasspath.args}"/> |
| 389 |
<compilerarg line="${gj.compiler.args}"/> |
<compilerarg line="${build.args}"/> |
| 390 |
|
|
| 391 |
<classpath refid="test.classpath"/> |
<classpath refid="test.classpath"/> |
|
<include name="**/*Test.java"/> |
|
| 392 |
|
|
| 393 |
</javac> |
</javac> |
| 394 |
|
|
| 395 |
</target> |
</target> |
| 396 |
|
|
| 397 |
<target name="run-tests" depends="compile-tests"> |
|
| 398 |
|
<target name="run-tests" |
| 399 |
|
depends="compile-tests"> |
| 400 |
|
|
| 401 |
|
<!-- May be overridden by user.properties --> |
| 402 |
|
<property name="testcase" value="*"/> |
| 403 |
|
|
| 404 |
<mkdir dir="${build.reports.dir}"/> |
<mkdir dir="${build.reports.dir}"/> |
| 405 |
|
|
| 406 |
<junit printsummary="true" |
<junit printsummary="true" |
| 407 |
showoutput="true" |
showoutput="true" |
| 408 |
errorProperty="junit.failed" |
errorProperty="junit.failed" |
| 409 |
failureProperty="junit.failed" |
failureProperty="junit.failed" |
| 410 |
dir="${build.reports.dir}"> |
dir="${build.reports.dir}" |
| 411 |
|
fork="true"> |
| 412 |
|
|
| 413 |
<classpath> |
<jvmarg value="${bootclasspath.args}"/> |
| 414 |
<path refid="test.classpath"/> |
|
| 415 |
<pathelement location="${build.testcases.dir}"/> |
<classpath refid="test.classpath"/> |
|
</classpath> |
|
| 416 |
|
|
| 417 |
<formatter type="xml"/> |
<formatter type="xml"/> |
| 418 |
|
|
| 419 |
<batchtest todir="${build.reports.dir}"> |
<batchtest todir="${build.reports.dir}"> |
| 420 |
<fileset dir="${test.src.dir}"> |
<fileset dir="${test.src.dir}/tck"> |
| 421 |
<include name="**/*Test.java"/> |
<include name="${testcase}Test.java"/> |
| 422 |
</fileset> |
</fileset> |
| 423 |
</batchtest> |
</batchtest> |
| 424 |
|
|
| 425 |
</junit> |
</junit> |
| 426 |
|
|
| 427 |
</target> |
</target> |
| 428 |
|
|
| 429 |
|
|
| 430 |
<target name="report-tests" depends="run-tests"> |
<target name="report-tests" |
| 431 |
<!-- Sets junit.report.format to frames if Xalan is present, |
depends="run-tests"> |
| 432 |
|
|
| 433 |
|
<!-- Sets junit.report.format to frames if redirection is present, |
| 434 |
otherwise sets it to noframes. --> |
otherwise sets it to noframes. --> |
| 435 |
<available property="junit.report.format" |
<available property="junit.report.format" |
| 436 |
value="frames" |
value="frames" |
| 449 |
</junitreport> |
</junitreport> |
| 450 |
|
|
| 451 |
<fail message="Test Cases Failed" if="junit.failed"/> |
<fail message="Test Cases Failed" if="junit.failed"/> |
| 452 |
|
|
| 453 |
|
</target> |
| 454 |
|
|
| 455 |
|
|
| 456 |
|
<target name="configure-compiler"> |
| 457 |
|
|
| 458 |
|
<property name="unchecked.option" value="-Xlint:unchecked"/> |
| 459 |
|
|
| 460 |
|
<condition property="warnunchecked.arg" value="${unchecked.option}"> |
| 461 |
|
<istrue value="${build.warnunchecked}"/> |
| 462 |
|
</condition> |
| 463 |
|
|
| 464 |
|
<property name="warnunchecked.arg" value=""/> |
| 465 |
|
|
| 466 |
|
<condition property="prepare.src.dir" value="${build.dir}/prepare-src"> |
| 467 |
|
<istrue value="${build.nothreads}"/> |
| 468 |
|
</condition> |
| 469 |
|
|
| 470 |
|
<property name="prepare.src.dir" value="${src.dir}"/> |
| 471 |
|
|
| 472 |
|
|
| 473 |
|
<!-- Common options in javac invocations --> |
| 474 |
|
<property name="build.args" value="${warnunchecked.arg}"/> |
| 475 |
|
|
| 476 |
|
</target> |
| 477 |
|
|
| 478 |
|
|
| 479 |
|
<target name="prepare-src" |
| 480 |
|
depends="configure-compiler" |
| 481 |
|
if="prepare.src.dir"> |
| 482 |
|
|
| 483 |
|
<mkdir dir="${prepare.src.dir}"/> |
| 484 |
|
<copy todir="${prepare.src.dir}"> |
| 485 |
|
<fileset dir="${src.dir}"> |
| 486 |
|
<exclude name="java/lang/**"/> |
| 487 |
|
</fileset> |
| 488 |
|
</copy> |
| 489 |
|
|
| 490 |
|
</target> |
| 491 |
|
|
| 492 |
|
|
| 493 |
|
<target name="configure-tests" |
| 494 |
|
depends="configure-compiler"> |
| 495 |
|
|
| 496 |
|
<!-- junit.framework.Protectable is in JUnit 3.8.1 but not in 3.7 --> |
| 497 |
|
<available property="junit.available" |
| 498 |
|
classname="junit.framework.Protectable"/> |
| 499 |
|
|
| 500 |
|
<!-- Xalan --> |
| 501 |
|
<available property="xalan.available" |
| 502 |
|
classname="org.apache.xalan.Version"/> |
| 503 |
|
|
| 504 |
|
|
| 505 |
|
<!-- Ant 1.6beta and later don't need or want this check --> |
| 506 |
|
<!-- |
| 507 |
|
<fail message="Need JUnit 3.8.1 in ${ant.home}${file.separator}lib to run tests" |
| 508 |
|
unless="junit.available"/> |
| 509 |
|
|
| 510 |
|
<fail message="Need Xalan 2.5.1 jar in ${ant.home}${file.separator}lib to run tests" |
| 511 |
|
unless="xalan.available"/> |
| 512 |
|
--> |
| 513 |
|
|
| 514 |
|
</target> |
| 515 |
|
|
| 516 |
|
|
| 517 |
|
|
| 518 |
|
<!-- Anthill targets --> |
| 519 |
|
|
| 520 |
|
<target name="anthill-build"> |
| 521 |
|
|
| 522 |
|
<!-- Override this in user.properties --> |
| 523 |
|
<property name="tiger.home" location="e:/j2sdk1.5.0"/> |
| 524 |
|
|
| 525 |
|
<exec resultproperty="result.property" dir="${basedir}" executable="${tiger.home}/bin/java"> |
| 526 |
|
<arg value="-Xmx256000000"/> |
| 527 |
|
<!-- classpath of new JVM --> |
| 528 |
|
<arg value="-classpath"/> <arg path="${java.class.path}"/> |
| 529 |
|
<!-- location of Ant home directory --> |
| 530 |
|
<arg value="-Dant.home=${ant.home}"/> |
| 531 |
|
<!-- the Ant main class --> |
| 532 |
|
<arg value="org.apache.tools.ant.Main"/> |
| 533 |
|
<!-- The build file --> |
| 534 |
|
<arg value="-buildfile"/> <arg value="build.xml"/> |
| 535 |
|
<!-- the target to build on the new Ant instance --> |
| 536 |
|
<arg value="-DJAVA_HOME=${tiger.home}"/> |
| 537 |
|
<arg value="do-anthill-build"/> |
| 538 |
|
</exec> |
| 539 |
</target> |
</target> |
| 540 |
|
|
| 541 |
|
<target name="do-anthill-build" |
| 542 |
|
depends="jar, test, docs, dist-docs"/> |
| 543 |
|
|
| 544 |
|
<target name="anthill-publish"> |
| 545 |
|
|
| 546 |
|
<copy todir="${deployDir}/docs/private"> |
| 547 |
|
<fileset dir="${build.javadocs.dir}"/> |
| 548 |
|
</copy> |
| 549 |
|
|
| 550 |
|
<copy todir="${deployDir}/docs/public"> |
| 551 |
|
<fileset dir="${dist.javadocs.dir}"/> |
| 552 |
|
</copy> |
| 553 |
|
|
| 554 |
|
<copy tofile="${deployDir}/index.html" |
| 555 |
|
file="${basedir}/etc/anthill-index.html"/> |
| 556 |
|
|
| 557 |
|
<copy todir="${deployDir}/notes"> |
| 558 |
|
<fileset dir="${basedir}/etc/notes"/> |
| 559 |
|
</copy> |
| 560 |
|
|
| 561 |
|
</target> |
| 562 |
|
|
| 563 |
|
|
| 564 |
|
|
| 565 |
|
<!-- Backward compatibility, work in progress --> |
| 566 |
|
|
| 567 |
|
|
| 568 |
|
<target name="compat" depends="jar"> |
| 569 |
|
|
| 570 |
|
<mkdir dir="${build.testcases.dir}"/> |
| 571 |
|
|
| 572 |
|
<javac srcdir="${test.src.dir}" |
| 573 |
|
destdir="${build.testcases.dir}" |
| 574 |
|
debug="${build.debug}" |
| 575 |
|
debuglevel="${build.debuglevel}" |
| 576 |
|
deprecation="${build.deprecation}" |
| 577 |
|
source="${build.sourcelevel}" |
| 578 |
|
fork="true"> |
| 579 |
|
|
| 580 |
|
<compilerarg value="${bootclasspath.args}"/> |
| 581 |
|
<compilerarg line="${build.args}"/> |
| 582 |
|
|
| 583 |
|
<classpath refid="test.classpath"/> |
| 584 |
|
|
| 585 |
|
<include name="Compatibility.java"/> |
| 586 |
|
|
| 587 |
|
</javac> |
| 588 |
|
|
| 589 |
|
|
| 590 |
|
<java classname="Compatibility" fork="true"> |
| 591 |
|
<jvmarg value="${bootclasspath.args}"/> |
| 592 |
|
<classpath refid="test.classpath"/> |
| 593 |
|
</java> |
| 594 |
|
</target> |
| 595 |
|
|
| 596 |
|
|
| 597 |
|
|
| 598 |
|
<property name="pretiger.src.dir" location="${build.dir}/pretiger/src"/> |
| 599 |
|
<property name="build.pretiger.dir" location="${build.dir}/pretiger/classes"/> |
| 600 |
|
<property name="pretiger.jar" location="${build.lib.dir}/jsr166-pretiger.jar"/> |
| 601 |
|
<property name="pretiger.sourcelevel" value="1.4"/> |
| 602 |
|
|
| 603 |
|
<target name="defang" |
| 604 |
|
depends="init" |
| 605 |
|
description="Generates pre-Tiger compatible source"> |
| 606 |
|
|
| 607 |
|
<delete dir="${pretiger.src.dir}"/> |
| 608 |
|
<mkdir dir="${pretiger.src.dir}"/> |
| 609 |
|
|
| 610 |
|
<exec executable="perl"> |
| 611 |
|
<arg file="etc/defang.pl"/> |
| 612 |
|
<!-- <arg value="-v"/> --> |
| 613 |
|
<arg value="-s"/> <arg file="${src.dir}"/> |
| 614 |
|
<arg value="-t"/> <arg file="${pretiger.src.dir}"/> |
| 615 |
|
</exec> |
| 616 |
|
|
| 617 |
|
</target> |
| 618 |
|
|
| 619 |
|
<target name="compile-pretiger" |
| 620 |
|
depends="init, configure-compiler, defang" |
| 621 |
|
description="Compiles pre-Tiger sources to build folder"> |
| 622 |
|
|
| 623 |
|
<mkdir dir="${build.pretiger.dir}"/> |
| 624 |
|
|
| 625 |
|
<javac srcdir="${pretiger.src.dir}" |
| 626 |
|
destdir="${build.pretiger.dir}" |
| 627 |
|
debug="${build.debug}" |
| 628 |
|
debuglevel="${build.debuglevel}" |
| 629 |
|
deprecation="${build.deprecation}" |
| 630 |
|
source="${pretiger.sourcelevel}" |
| 631 |
|
fork="true"> |
| 632 |
|
|
| 633 |
|
<compilerarg line="${build.args}"/> |
| 634 |
|
<exclude name="**/Thread.java"/> |
| 635 |
|
|
| 636 |
|
</javac> |
| 637 |
|
|
| 638 |
|
</target> |
| 639 |
|
|
| 640 |
|
<target name="pretiger" depends="compile-pretiger"> |
| 641 |
|
|
| 642 |
|
<mkdir dir="${build.lib.dir}"/> |
| 643 |
|
|
| 644 |
|
<jar destfile="${pretiger.jar}"> |
| 645 |
|
<fileset dir="${build.pretiger.dir}"> |
| 646 |
|
</fileset> |
| 647 |
|
</jar> |
| 648 |
|
|
| 649 |
|
</target> |
| 650 |
|
|
| 651 |
</project> |
</project> |