Parent Directory
|
Revision Log
Revision 1.42 - (view) (download) (as text)
| 1 : | tim | 1.18 | <project name="jsr166" default="usage"> |
| 2 : | tim | 1.1 | |
| 3 : | <description> | ||
| 4 : | tim | 1.29 | ------------------------------------------------------------------------------ |
| 5 : | Build file for JSR-166 | ||
| 6 : | tim | 1.18 | |
| 7 : | tim | 1.29 | Usage: ant [target] |
| 8 : | |||
| 9 : | User-specific settings are read from user.properties. | ||
| 10 : | tim | 1.32 | See user.properties.sample for an explanation of some useful settings. |
| 11 : | tim | 1.29 | ------------------------------------------------------------------------------ |
| 12 : | tim | 1.18 | </description> |
| 13 : | tim | 1.11 | |
| 14 : | tim | 1.29 | <target name="usage" description="Advises user to run with -projecthelp"> |
| 15 : | <echo>Run "ant -projecthelp" for full usage information.</echo> | ||
| 16 : | </target> | ||
| 17 : | tim | 1.3 | |
| 18 : | tim | 1.11 | |
| 19 : | tim | 1.27 | <!-- User-specific settings --> |
| 20 : | tim | 1.23 | <property file="user.properties"/> |
| 21 : | tim | 1.27 | |
| 22 : | tim | 1.1 | |
| 23 : | <!-- Compilation options --> | ||
| 24 : | tim | 1.11 | <property name="build.sourcelevel" value="1.5"/> |
| 25 : | tim | 1.25 | <property name="build.docsourcelevel" value="1.4"/> |
| 26 : | tim | 1.1 | <property name="build.debug" value="true"/> |
| 27 : | <property name="build.debuglevel" value="source,lines,vars"/> | ||
| 28 : | tim | 1.13 | <property name="build.deprecation" value="false"/> |
| 29 : | tim | 1.1 | |
| 30 : | <!-- Build locations --> | ||
| 31 : | <property name="build.dir" location="build"/> | ||
| 32 : | <property name="build.classes.dir" location="${build.dir}/classes"/> | ||
| 33 : | tim | 1.27 | <property name="build.emulation.dir" location="${build.dir}/emulation"/> |
| 34 : | tim | 1.1 | <property name="build.testcases.dir" location="${build.dir}/testcases"/> |
| 35 : | <property name="build.lib.dir" location="${build.dir}/lib"/> | ||
| 36 : | <property name="build.ant.dir" location="${build.dir}/ant"/> | ||
| 37 : | tim | 1.9 | <property name="build.javadocs.dir" location="${build.dir}/javadocs"/> |
| 38 : | tim | 1.16 | <property name="build.stripped.dir" location="${build.dir}/stripped"/> |
| 39 : | tim | 1.1 | <property name="build.reports.dir" location="${build.dir}/reports"/> |
| 40 : | tim | 1.16 | <property name="build.doccheck.dir" location="${build.dir}/doccheck"/> |
| 41 : | tim | 1.1 | <property name="build.filter.src.dir" location="${build.dir}/filtersrc"/> |
| 42 : | |||
| 43 : | <!-- Source locations --> | ||
| 44 : | tim | 1.22 | <property name="src.dir" location="${basedir}/src/main"/> |
| 45 : | tim | 1.27 | <property name="emulation.src.dir" location="${basedir}/src/emulation"/> |
| 46 : | tim | 1.22 | <property name="test.src.dir" location="${basedir}/src/test"/> |
| 47 : | tim | 1.1 | <property name="ant.src.dir" location="${basedir}/etc/ant"/> |
| 48 : | <property name="stylesheet.dir" location="${basedir}/etc/xsl"/> | ||
| 49 : | <property name="lib.dir" location="${basedir}/lib"/> | ||
| 50 : | tim | 1.9 | <property name="dist.dir" location="${basedir}/dist"/> |
| 51 : | |||
| 52 : | <!-- Distribution locations --> | ||
| 53 : | <property name="dist.javadocs.dir" location="${dist.dir}/docs"/> | ||
| 54 : | tim | 1.1 | |
| 55 : | <!-- Jar locations --> | ||
| 56 : | <property name="product.jar" location="${build.lib.dir}/jsr166.jar"/> | ||
| 57 : | <property name="junit.jar" location="${lib.dir}/junit.jar"/> | ||
| 58 : | <property name="rt.jar" location="${java.home}/lib/rt.jar"/> | ||
| 59 : | |||
| 60 : | tim | 1.27 | |
| 61 : | tim | 1.28 | |
| 62 : | tim | 1.40 | <!-- Files excluded from dist-docs and emulation jar --> |
| 63 : | <patternset id="unsafe.exclusion"> | ||
| 64 : | tim | 1.28 | <exclude name="java/util/Random.*"/> |
| 65 : | <exclude name="sun/misc/Unsafe.*"/> | ||
| 66 : | </patternset> | ||
| 67 : | |||
| 68 : | tim | 1.40 | <!-- Files excludes from emulation jar --> |
| 69 : | <patternset id="atomic.exclusion"> | ||
| 70 : | tim | 1.41 | <exclude name="java/util/concurrent/atomic/AtomicBoolean*"/> |
| 71 : | tim | 1.40 | <exclude name="java/util/concurrent/atomic/AtomicInteger*"/> |
| 72 : | <exclude name="java/util/concurrent/atomic/AtomicLong*"/> | ||
| 73 : | <exclude name="java/util/concurrent/atomic/AtomicReference*"/> | ||
| 74 : | </patternset> | ||
| 75 : | |||
| 76 : | tim | 1.28 | |
| 77 : | |||
| 78 : | tim | 1.11 | <!-- Main targets --> |
| 79 : | |||
| 80 : | tim | 1.28 | <target name="compile" |
| 81 : | tim | 1.33 | depends="init, configure-compiler, prepare-src" |
| 82 : | tim | 1.27 | description="Compiles main sources to build folder"> |
| 83 : | |||
| 84 : | tim | 1.33 | <property name="prepare.src.dir" value="${src.dir}"/> |
| 85 : | |||
| 86 : | tim | 1.1 | <mkdir dir="${build.classes.dir}"/> |
| 87 : | tim | 1.27 | |
| 88 : | tim | 1.37 | <!-- |
| 89 : | <echo>javac ${gjc.args}</echo> | ||
| 90 : | <echo>bootclasspath=${compile.bootclasspath}</echo> | ||
| 91 : | --> | ||
| 92 : | |||
| 93 : | tim | 1.33 | <javac srcdir="${prepare.src.dir}" |
| 94 : | tim | 1.1 | destdir="${build.classes.dir}" |
| 95 : | debug="${build.debug}" | ||
| 96 : | debuglevel="${build.debuglevel}" | ||
| 97 : | deprecation="${build.deprecation}" | ||
| 98 : | source="${build.sourcelevel}" | ||
| 99 : | fork="true"> | ||
| 100 : | |||
| 101 : | tim | 1.37 | <compilerarg line="${gjc.args}"/> |
| 102 : | <bootclasspath refid="compile.bootclasspath"/> | ||
| 103 : | tim | 1.1 | |
| 104 : | </javac> | ||
| 105 : | tim | 1.27 | |
| 106 : | tim | 1.1 | </target> |
| 107 : | |||
| 108 : | |||
| 109 : | tim | 1.28 | <target name="jar" |
| 110 : | tim | 1.32 | depends="configure-emulation, init-jar, native-jar, emulation-jar" |
| 111 : | tim | 1.28 | description="Builds library jar from compiled sources"/> |
| 112 : | tim | 1.1 | |
| 113 : | |||
| 114 : | tim | 1.28 | <target name="test" |
| 115 : | tim | 1.32 | depends="init, configure-tests, report-tests" |
| 116 : | tim | 1.29 | description="Runs all tests (requires JUnit 3.8.1 in ${ant.home}/lib)" /> |
| 117 : | tim | 1.1 | |
| 118 : | |||
| 119 : | tim | 1.28 | <target name="checkstyle" |
| 120 : | depends="filter-src" | ||
| 121 : | tim | 1.18 | description="Reports on style errors in Java source (verbose, mostly chaff)"> |
| 122 : | tim | 1.27 | |
| 123 : | tim | 1.15 | <taskdef resource="checkstyletask.properties" |
| 124 : | classpath="${lib.dir}/checkstyle-all-2.4.jar"/> | ||
| 125 : | |||
| 126 : | <checkstyle> | ||
| 127 : | tim | 1.16 | <formatter type="plain"/> <!-- also available: type="xml" --> |
| 128 : | tim | 1.15 | <fileset dir="${build.filter.src.dir}" includes="**/*.java"/> |
| 129 : | </checkstyle> | ||
| 130 : | tim | 1.27 | |
| 131 : | tim | 1.15 | </target> |
| 132 : | |||
| 133 : | tim | 1.16 | |
| 134 : | tim | 1.28 | <target name="doccheck" |
| 135 : | depends="filter-src" | ||
| 136 : | tim | 1.18 | description="Reports on javadoc style errors (not working yet)"> |
| 137 : | tim | 1.27 | |
| 138 : | tim | 1.16 | <delete dir="${build.doccheck.dir}"/> |
| 139 : | <mkdir dir="${build.doccheck.dir}"/> | ||
| 140 : | tim | 1.27 | |
| 141 : | tim | 1.16 | <javadoc doclet="com.sun.tools.doclets.doccheck.DocCheck" |
| 142 : | docletpath="${lib.dir}/doccheck.jar" | ||
| 143 : | destdir="${build.doccheck.dir}"> | ||
| 144 : | tim | 1.22 | <packageset dir="${build.filter.src.dir}"/> |
| 145 : | tim | 1.16 | </javadoc> |
| 146 : | tim | 1.27 | |
| 147 : | tim | 1.16 | </target> |
| 148 : | |||
| 149 : | |||
| 150 : | tim | 1.28 | <target name="docs" |
| 151 : | depends="filter-src" | ||
| 152 : | tim | 1.9 | description="Builds javadocs with custom tags to build folder"> |
| 153 : | tim | 1.27 | |
| 154 : | tim | 1.9 | <delete dir="${build.javadocs.dir}"/> |
| 155 : | <mkdir dir="${build.javadocs.dir}"/> | ||
| 156 : | tim | 1.27 | |
| 157 : | tim | 1.9 | <javadoc destdir="${build.javadocs.dir}" |
| 158 : | tim | 1.8 | link="http://java.sun.com/j2se/1.4.1/docs/api" |
| 159 : | overview="${src.dir}/intro.html" | ||
| 160 : | dholmes | 1.24 | source="${build.docsourcelevel}"> |
| 161 : | tim | 1.8 | |
| 162 : | tim | 1.9 | <tag name="revised" description="Last revised:"/> |
| 163 : | tim | 1.29 | <tag name="spec" description="Specified by:"/> |
| 164 : | <tag name="editor" description="Last edited by:"/> | ||
| 165 : | <tag name="fixme" description="FIX ME:"/> | ||
| 166 : | |||
| 167 : | tim | 1.22 | <packageset dir="${build.filter.src.dir}"/> |
| 168 : | tim | 1.8 | |
| 169 : | </javadoc> | ||
| 170 : | tim | 1.27 | |
| 171 : | tim | 1.8 | </target> |
| 172 : | |||
| 173 : | |||
| 174 : | tim | 1.28 | <target name="strip" |
| 175 : | tim | 1.32 | depends="init, configure-compiler" |
| 176 : | tim | 1.31 | description="Strip generics from java source (not working yet)"> |
| 177 : | tim | 1.27 | |
| 178 : | tim | 1.16 | <mkdir dir="${build.stripped.dir}"/> |
| 179 : | tim | 1.27 | |
| 180 : | tim | 1.31 | <!-- |
| 181 : | # javac -s doesn't reliably generate compilable code. It generates | ||
| 182 : | # bridge methods (marked as "synthetic") that can have identical | ||
| 183 : | # signatures to existing methods except for the return value. | ||
| 184 : | --> | ||
| 185 : | tim | 1.16 | <javac srcdir="${src.dir}" |
| 186 : | destdir="${build.stripped.dir}" | ||
| 187 : | debug="${build.debug}" | ||
| 188 : | debuglevel="${build.debuglevel}" | ||
| 189 : | deprecation="${build.deprecation}" | ||
| 190 : | source="${build.sourcelevel}" | ||
| 191 : | fork="true"> | ||
| 192 : | |||
| 193 : | tim | 1.37 | <compilerarg line="${gjc.args} -s"/> |
| 194 : | <bootclasspath refid="compile.bootclasspath"/> | ||
| 195 : | tim | 1.16 | |
| 196 : | </javac> | ||
| 197 : | tim | 1.27 | |
| 198 : | tim | 1.16 | </target> |
| 199 : | |||
| 200 : | |||
| 201 : | tim | 1.28 | <target name="dist" |
| 202 : | depends="init, dist-clean, dist-jar, dist-docs" | ||
| 203 : | tim | 1.16 | description="Puts all distributable products in single hierarchy"/> |
| 204 : | tim | 1.1 | |
| 205 : | tim | 1.42 | <target name="release" |
| 206 : | depends="dist" | ||
| 207 : | description="Puts entire CVS tree, plus distribution productions, in a jar"> | ||
| 208 : | |||
| 209 : | <delete dir="${build.dir}"/> | ||
| 210 : | |||
| 211 : | <property name="release.jar" value="dist/jsr166-${version}-dist.jar"/> | ||
| 212 : | |||
| 213 : | <jar basedir="${basedir}" destfile="${release.jar}"> | ||
| 214 : | <exclude name="${release.jar}"/> | ||
| 215 : | <exclude name="user.properties"/> | ||
| 216 : | <exclude name="etc/notes/**"/> | ||
| 217 : | </jar> | ||
| 218 : | |||
| 219 : | </target> | ||
| 220 : | tim | 1.1 | |
| 221 : | tim | 1.11 | <target name="clean" |
| 222 : | description="Removes all build products"> | ||
| 223 : | tim | 1.27 | |
| 224 : | tim | 1.11 | <delete dir="${build.dir}"/> |
| 225 : | <delete dir="${build.classes.dir}"/> | ||
| 226 : | <delete dir="${build.lib.dir}"/> | ||
| 227 : | tim | 1.27 | |
| 228 : | tim | 1.1 | </target> |
| 229 : | |||
| 230 : | |||
| 231 : | tim | 1.11 | <target name="dist-clean" |
| 232 : | description="Removes all build and distribution products"> | ||
| 233 : | tim | 1.27 | |
| 234 : | tim | 1.11 | <delete dir="${dist.dir}"/> |
| 235 : | tim | 1.27 | |
| 236 : | tim | 1.9 | </target> |
| 237 : | tim | 1.10 | |
| 238 : | |||
| 239 : | tim | 1.28 | <target name="dist-docs" |
| 240 : | depends="filter-src" | ||
| 241 : | description="Builds javadocs without custom tags to dist folder"> | ||
| 242 : | |||
| 243 : | <delete dir="${dist.javadocs.dir}"/> | ||
| 244 : | <mkdir dir="${dist.javadocs.dir}"/> | ||
| 245 : | |||
| 246 : | <javadoc destdir="${dist.javadocs.dir}" | ||
| 247 : | link="http://java.sun.com/j2se/1.4.1/docs/api" | ||
| 248 : | overview="${src.dir}/intro.html" | ||
| 249 : | source="${build.docsourcelevel}"> | ||
| 250 : | |||
| 251 : | <packageset dir="${build.filter.src.dir}"/> | ||
| 252 : | tim | 1.14 | |
| 253 : | tim | 1.28 | </javadoc> |
| 254 : | tim | 1.14 | |
| 255 : | </target> | ||
| 256 : | |||
| 257 : | |||
| 258 : | tim | 1.28 | |
| 259 : | tim | 1.11 | <!-- Internal targets --> |
| 260 : | tim | 1.9 | |
| 261 : | tim | 1.16 | |
| 262 : | tim | 1.32 | <target name="init"> |
| 263 : | tim | 1.27 | |
| 264 : | tim | 1.11 | <!-- Version is kept in a separate file --> |
| 265 : | <loadfile property="version" srcFile="version.properties"/> | ||
| 266 : | <echo>Building JSR-166 version ${version}</echo> | ||
| 267 : | tim | 1.27 | |
| 268 : | </target> | ||
| 269 : | |||
| 270 : | |||
| 271 : | tim | 1.28 | <target name="init-jar"> |
| 272 : | tim | 1.27 | |
| 273 : | <mkdir dir="${build.lib.dir}"/> | ||
| 274 : | |||
| 275 : | tim | 1.28 | </target> |
| 276 : | |||
| 277 : | |||
| 278 : | <target name="native-jar" | ||
| 279 : | tim | 1.30 | depends="compile" |
| 280 : | unless="build.emulation.true"> | ||
| 281 : | tim | 1.28 | |
| 282 : | tim | 1.27 | <jar destfile="${product.jar}"> |
| 283 : | <fileset dir="${build.classes.dir}"/> | ||
| 284 : | </jar> | ||
| 285 : | |||
| 286 : | </target> | ||
| 287 : | |||
| 288 : | |||
| 289 : | tim | 1.28 | <target name="compile-emulation" |
| 290 : | tim | 1.32 | depends="init, configure-compiler" |
| 291 : | tim | 1.30 | if="build.emulation.true"> |
| 292 : | tim | 1.27 | |
| 293 : | <mkdir dir="${build.emulation.dir}"/> | ||
| 294 : | |||
| 295 : | <javac srcdir="${emulation.src.dir}" | ||
| 296 : | destdir="${build.emulation.dir}" | ||
| 297 : | debug="${build.debug}" | ||
| 298 : | debuglevel="${build.debuglevel}" | ||
| 299 : | deprecation="${build.deprecation}" | ||
| 300 : | source="${build.sourcelevel}" | ||
| 301 : | fork="true"> | ||
| 302 : | |||
| 303 : | tim | 1.37 | <compilerarg line="${gjc.args}"/> |
| 304 : | <bootclasspath refid="compile.bootclasspath"/> | ||
| 305 : | tim | 1.27 | |
| 306 : | </javac> | ||
| 307 : | |||
| 308 : | </target> | ||
| 309 : | |||
| 310 : | |||
| 311 : | tim | 1.28 | <target name="emulation-jar" |
| 312 : | tim | 1.30 | depends="compile-emulation" |
| 313 : | if="build.emulation.true"> | ||
| 314 : | tim | 1.27 | |
| 315 : | tim | 1.29 | |
| 316 : | <jar destfile="${product.jar}" duplicate="add"> | ||
| 317 : | <fileset dir="${build.classes.dir}"> | ||
| 318 : | tim | 1.40 | <patternset refid="atomic.exclusion"/> |
| 319 : | <patternset refid="unsafe.exclusion"/> | ||
| 320 : | tim | 1.29 | </fileset> |
| 321 : | tim | 1.27 | <fileset dir="${build.emulation.dir}"/> |
| 322 : | </jar> | ||
| 323 : | |||
| 324 : | tim | 1.9 | </target> |
| 325 : | |||
| 326 : | |||
| 327 : | tim | 1.28 | <target name="dist-jar" |
| 328 : | depends="clean, jar"> | ||
| 329 : | tim | 1.27 | |
| 330 : | tim | 1.11 | <copy file="${product.jar}" todir="${dist.dir}"/> |
| 331 : | tim | 1.27 | |
| 332 : | tim | 1.11 | </target> |
| 333 : | |||
| 334 : | |||
| 335 : | tim | 1.28 | <target name="compile-ant-filter" |
| 336 : | depends="init"> | ||
| 337 : | tim | 1.27 | |
| 338 : | tim | 1.1 | <mkdir dir="${build.ant.dir}"/> |
| 339 : | tim | 1.27 | |
| 340 : | tim | 1.1 | <javac srcdir="${ant.src.dir}" |
| 341 : | destdir="${build.ant.dir}" | ||
| 342 : | source="1.4" | ||
| 343 : | /> | ||
| 344 : | tim | 1.27 | |
| 345 : | tim | 1.1 | </target> |
| 346 : | |||
| 347 : | |||
| 348 : | tim | 1.28 | <target name="filter-src" |
| 349 : | depends="compile-ant-filter"> | ||
| 350 : | tim | 1.27 | |
| 351 : | tim | 1.1 | <mkdir dir="${build.filter.src.dir}"/> |
| 352 : | tim | 1.27 | |
| 353 : | tim | 1.1 | <copy todir="${build.filter.src.dir}"> |
| 354 : | <fileset dir="${src.dir}"> | ||
| 355 : | tim | 1.31 | <include name="**/*.html"/> |
| 356 : | </fileset> | ||
| 357 : | </copy> | ||
| 358 : | |||
| 359 : | tim | 1.36 | <!-- Not needed now, used for doccheck filtering: |
| 360 : | <property name="generic.declarations" | ||
| 361 : | value="public interface E {} public interface T {} public interface K {} public interface V {}" | ||
| 362 : | /> | ||
| 363 : | --> | ||
| 364 : | |||
| 365 : | tim | 1.31 | <copy todir="${build.filter.src.dir}"> |
| 366 : | <fileset dir="${src.dir}"> | ||
| 367 : | <exclude name="**/*.html"/> | ||
| 368 : | tim | 1.40 | <patternset refid="unsafe.exclusion"/> |
| 369 : | tim | 1.1 | </fileset> |
| 370 : | <filterchain> | ||
| 371 : | tim | 1.36 | |
| 372 : | <!-- | ||
| 373 : | # This filter gets rid of angle-bracketed type parameters | ||
| 374 : | # so that javadoc can run on the result. The following | ||
| 375 : | # heuristic seems to work: | ||
| 376 : | # | ||
| 377 : | # For all lines not starting with space(s)-asterisk-space(s), | ||
| 378 : | # replace <something> with a space, where there may be more | ||
| 379 : | # than one right angle bracket at the end, and "something" | ||
| 380 : | # must not contain parens or pipes. (This may need some | ||
| 381 : | # tweaking.) | ||
| 382 : | --> | ||
| 383 : | |||
| 384 : | tim | 1.1 | <filterreader classname="jsr166.ant.filters.ReplaceFilter" |
| 385 : | classpath="${build.ant.dir}"> | ||
| 386 : | <param name="notmatching" value="^\s+\*\s.*$"/> | ||
| 387 : | tim | 1.36 | <param name="pattern" value="<[^|>()]+?>+"/> |
| 388 : | tim | 1.1 | <param name="replacement" value=" "/> |
| 389 : | </filterreader> | ||
| 390 : | tim | 1.36 | |
| 391 : | |||
| 392 : | <!-- | ||
| 393 : | # This filter uncomments lines beginning with "//@" so that | ||
| 394 : | # javadoc can see imports that are needed to resolve links | ||
| 395 : | # but that shouldn't be in the compiled code. | ||
| 396 : | --> | ||
| 397 : | |||
| 398 : | tim | 1.1 | <filterreader classname="jsr166.ant.filters.ReplaceFilter" |
| 399 : | classpath="${build.ant.dir}"> | ||
| 400 : | tim | 1.36 | <param name="matching" value="^//@.*$"/> |
| 401 : | <param name="pattern" value="^//@"/> | ||
| 402 : | tim | 1.1 | <param name="replacement" value=""/> |
| 403 : | </filterreader> | ||
| 404 : | tim | 1.36 | |
| 405 : | |||
| 406 : | <!-- | ||
| 407 : | # The next two filters try to make the source look like | ||
| 408 : | # something that doccheck can process. The first removes | ||
| 409 : | # -source 1.4 assertions and the second adds in a bunch | ||
| 410 : | # of single letter public nested marker interfaces so that | ||
| 411 : | # the generic type parameters are recognized. | ||
| 412 : | # | ||
| 413 : | # Currently commented out because doccheck doesn't work. :-( | ||
| 414 : | --> | ||
| 415 : | |||
| 416 : | <!-- | ||
| 417 : | <filterreader classname="jsr166.ant.filters.ReplaceFilter" | ||
| 418 : | classpath="${build.ant.dir}"> | ||
| 419 : | <param name="matching" value="^\s*assert[\s ].*$"/> | ||
| 420 : | <param name="pattern" value="assert"/> | ||
| 421 : | <param name="replacement" value="//assert"/> | ||
| 422 : | </filterreader> | ||
| 423 : | |||
| 424 : | <filterreader classname="jsr166.ant.filters.ReplaceFilter" | ||
| 425 : | classpath="${build.ant.dir}"> | ||
| 426 : | <param name="matching" value="^(.*(class|interface|implements) .*|)\{.*$"/> | ||
| 427 : | <param name="pattern" value="$"/> | ||
| 428 : | <param name="replacement" value=" ${generic.declarations}"/> | ||
| 429 : | </filterreader> | ||
| 430 : | --> | ||
| 431 : | |||
| 432 : | tim | 1.1 | </filterchain> |
| 433 : | </copy> | ||
| 434 : | tim | 1.27 | |
| 435 : | tim | 1.1 | </target> |
| 436 : | |||
| 437 : | |||
| 438 : | tim | 1.28 | <target name="compile-tests" |
| 439 : | depends="jar"> | ||
| 440 : | tim | 1.27 | |
| 441 : | tim | 1.1 | <mkdir dir="${build.testcases.dir}"/> |
| 442 : | tim | 1.27 | |
| 443 : | tim | 1.37 | <!-- |
| 444 : | <echo>javac ${gjc.args}</echo> | ||
| 445 : | <echo>bootclasspath=${test.compile.bootclasspath}</echo> | ||
| 446 : | <echo>classpath="${test.classpath}"</echo> | ||
| 447 : | --> | ||
| 448 : | |||
| 449 : | tim | 1.1 | <javac srcdir="${test.src.dir}" |
| 450 : | destdir="${build.testcases.dir}" | ||
| 451 : | debug="${build.debug}" | ||
| 452 : | debuglevel="${build.debuglevel}" | ||
| 453 : | deprecation="${build.deprecation}" | ||
| 454 : | source="${build.sourcelevel}" | ||
| 455 : | fork="true"> | ||
| 456 : | |||
| 457 : | tim | 1.37 | <compilerarg line="${gjc.args}"/> |
| 458 : | <bootclasspath refid="test.compile.bootclasspath"/> | ||
| 459 : | <classpath refid="test.classpath"/> | ||
| 460 : | tim | 1.1 | |
| 461 : | </javac> | ||
| 462 : | tim | 1.27 | |
| 463 : | tim | 1.1 | </target> |
| 464 : | tim | 1.11 | |
| 465 : | tim | 1.1 | |
| 466 : | tim | 1.28 | <target name="run-tests" |
| 467 : | depends="compile-tests"> | ||
| 468 : | tim | 1.27 | |
| 469 : | <!-- May be overridden by user.properties --> | ||
| 470 : | <property name="testcase" value="*"/> | ||
| 471 : | |||
| 472 : | tim | 1.1 | <mkdir dir="${build.reports.dir}"/> |
| 473 : | tim | 1.27 | |
| 474 : | tim | 1.1 | <junit printsummary="true" |
| 475 : | showoutput="true" | ||
| 476 : | errorProperty="junit.failed" | ||
| 477 : | failureProperty="junit.failed" | ||
| 478 : | tim | 1.12 | dir="${build.reports.dir}" |
| 479 : | fork="true"> | ||
| 480 : | |||
| 481 : | tim | 1.37 | <jvmarg value="-Xbootclasspath/p:${test.run.bootclasspath}"/> |
| 482 : | tim | 1.1 | |
| 483 : | <formatter type="xml"/> | ||
| 484 : | |||
| 485 : | <batchtest todir="${build.reports.dir}"> | ||
| 486 : | <fileset dir="${test.src.dir}"> | ||
| 487 : | tim | 1.23 | <include name="**/${testcase}Test.java"/> |
| 488 : | tim | 1.1 | </fileset> |
| 489 : | </batchtest> | ||
| 490 : | |||
| 491 : | </junit> | ||
| 492 : | tim | 1.27 | |
| 493 : | tim | 1.1 | </target> |
| 494 : | |||
| 495 : | |||
| 496 : | tim | 1.28 | <target name="report-tests" |
| 497 : | depends="run-tests"> | ||
| 498 : | |||
| 499 : | tim | 1.1 | <!-- Sets junit.report.format to frames if Xalan is present, |
| 500 : | otherwise sets it to noframes. --> | ||
| 501 : | <available property="junit.report.format" | ||
| 502 : | value="frames" | ||
| 503 : | classname="org.apache.xalan.lib.Redirect" | ||
| 504 : | /> | ||
| 505 : | <property name="junit.report.format" value="noframes"/> | ||
| 506 : | |||
| 507 : | <junitreport todir="${build.reports.dir}"> | ||
| 508 : | <fileset dir="${build.reports.dir}"> | ||
| 509 : | <include name="TEST-*.xml"/> | ||
| 510 : | </fileset> | ||
| 511 : | <report styledir="${stylesheet.dir}" | ||
| 512 : | format="${junit.report.format}" | ||
| 513 : | todir="${build.reports.dir}" | ||
| 514 : | /> | ||
| 515 : | </junitreport> | ||
| 516 : | |||
| 517 : | <fail message="Test Cases Failed" if="junit.failed"/> | ||
| 518 : | tim | 1.28 | |
| 519 : | tim | 1.18 | </target> |
| 520 : | |||
| 521 : | |||
| 522 : | tim | 1.32 | <target name="configure-compiler"> |
| 523 : | |||
| 524 : | <property name="gjc.version" | ||
| 525 : | tim | 1.34 | value="2.0"/> |
| 526 : | tim | 1.32 | |
| 527 : | tim | 1.37 | <condition property="novariance.arg" value="-novariance"> |
| 528 : | tim | 1.32 | <and> |
| 529 : | <equals arg1="${gjc.version}" arg2="2.0"/> | ||
| 530 : | <or> | ||
| 531 : | <not><isset property="gjc.novariance"/></not> | ||
| 532 : | <istrue value="${gjc.novariance}"/> | ||
| 533 : | </or> | ||
| 534 : | </and> | ||
| 535 : | </condition> | ||
| 536 : | |||
| 537 : | tim | 1.37 | <property name="novariance.arg" |
| 538 : | tim | 1.32 | value=""/> |
| 539 : | |||
| 540 : | <property name="gjc.dir" | ||
| 541 : | value="${lib.dir}/gjc"/> | ||
| 542 : | |||
| 543 : | <property name="javac.jar" | ||
| 544 : | location="${gjc.dir}/${gjc.version}/javac.jar"/> | ||
| 545 : | |||
| 546 : | <property name="collect.jar" | ||
| 547 : | tim | 1.37 | location="${gjc.dir}/${gjc.version}/collect${novariance.arg}.jar"/> |
| 548 : | tim | 1.32 | |
| 549 : | |||
| 550 : | tim | 1.37 | <condition property="warnunchecked.arg" value="-warnunchecked"> |
| 551 : | tim | 1.32 | <istrue value="${gjc.warnunchecked}"/> |
| 552 : | </condition> | ||
| 553 : | |||
| 554 : | tim | 1.37 | <property name="warnunchecked.arg" value=""/> |
| 555 : | tim | 1.32 | |
| 556 : | tim | 1.34 | <condition property="prepare.src.dir" value="${build.dir}/prepare-src"> |
| 557 : | tim | 1.35 | <istrue value="${build.nothreads}"/> |
| 558 : | tim | 1.34 | </condition> |
| 559 : | |||
| 560 : | tim | 1.32 | |
| 561 : | <!-- | ||
| 562 : | ! Bootclasspath munging for source compilation. | ||
| 563 : | --> | ||
| 564 : | |||
| 565 : | tim | 1.37 | <path id="pre.bootclasspath"> |
| 566 : | tim | 1.32 | <pathelement location="${javac.jar}"/> |
| 567 : | </path> | ||
| 568 : | |||
| 569 : | tim | 1.37 | <path id="compile.bootclasspath"> |
| 570 : | tim | 1.39 | <pathelement location="${build.classes.dir}"/> |
| 571 : | tim | 1.32 | <pathelement location="${collect.jar}"/> |
| 572 : | <pathelement location="${rt.jar}"/> | ||
| 573 : | </path> | ||
| 574 : | |||
| 575 : | tim | 1.37 | <!-- Flatten paths into platform-appropriate strings --> |
| 576 : | <property name="pre.bootclasspath" refid="pre.bootclasspath"/> | ||
| 577 : | <property name="compile.bootclasspath" refid="compile.bootclasspath"/> | ||
| 578 : | |||
| 579 : | tim | 1.32 | |
| 580 : | <!-- Common options in javac invocations --> | ||
| 581 : | tim | 1.37 | <property name="gjc.args" |
| 582 : | value="-J-Xbootclasspath/p:${pre.bootclasspath} ${warnunchecked.arg} ${novariance.arg}" | ||
| 583 : | /> | ||
| 584 : | tim | 1.33 | |
| 585 : | </target> | ||
| 586 : | |||
| 587 : | |||
| 588 : | <target name="prepare-src" | ||
| 589 : | tim | 1.34 | depends="configure-compiler" |
| 590 : | tim | 1.33 | if="prepare.src.dir"> |
| 591 : | |||
| 592 : | <mkdir dir="${prepare.src.dir}"/> | ||
| 593 : | <copy todir="${prepare.src.dir}"> | ||
| 594 : | <fileset dir="${src.dir}"> | ||
| 595 : | <exclude name="java/lang/**"/> | ||
| 596 : | </fileset> | ||
| 597 : | </copy> | ||
| 598 : | tim | 1.32 | |
| 599 : | </target> | ||
| 600 : | |||
| 601 : | |||
| 602 : | <target name="configure-emulation"> | ||
| 603 : | |||
| 604 : | <condition property="build.emulation.true"> | ||
| 605 : | <or> | ||
| 606 : | <and> | ||
| 607 : | <os family="windows"/> | ||
| 608 : | <not> | ||
| 609 : | <isset property="build.emulation"/> | ||
| 610 : | </not> | ||
| 611 : | </and> | ||
| 612 : | <istrue value="${build.emulation}"/> | ||
| 613 : | </or> | ||
| 614 : | </condition> | ||
| 615 : | |||
| 616 : | </target> | ||
| 617 : | |||
| 618 : | |||
| 619 : | tim | 1.37 | <target name="configure-tests" |
| 620 : | depends="configure-compiler"> | ||
| 621 : | tim | 1.28 | |
| 622 : | <!-- junit.framework.Protectable is in JUnit 3.8.1 but not in 3.7 --> | ||
| 623 : | tim | 1.18 | <available property="junit.available" |
| 624 : | tim | 1.28 | classname="junit.framework.Protectable"/> |
| 625 : | |||
| 626 : | <fail message="Need JUnit 3.8.1 in ${ant.home}${file.separator}lib to run tests" | ||
| 627 : | unless="junit.available"/> | ||
| 628 : | |||
| 629 : | tim | 1.30 | |
| 630 : | tim | 1.32 | <!-- |
| 631 : | ! Bootclasspath munging for testing, so JUnit can test our local | ||
| 632 : | ! modifications to java.*. | ||
| 633 : | --> | ||
| 634 : | |||
| 635 : | <path id="test.classpath"> | ||
| 636 : | <pathelement location="${product.jar}"/> | ||
| 637 : | <pathelement location="${build.testcases.dir}"/> | ||
| 638 : | <pathelement location="${junit.jar}"/> | ||
| 639 : | </path> | ||
| 640 : | |||
| 641 : | tim | 1.37 | <path id="test.compile.bootclasspath"> |
| 642 : | <pathelement location="${javac.jar}"/> | ||
| 643 : | <pathelement location="${collect.jar}"/> | ||
| 644 : | <pathelement location="${rt.jar}"/> | ||
| 645 : | </path> | ||
| 646 : | |||
| 647 : | <path id="test.run.bootclasspath"> | ||
| 648 : | <pathelement location="${javac.jar}"/> | ||
| 649 : | <path refid="test.classpath"/> | ||
| 650 : | </path> | ||
| 651 : | tim | 1.32 | |
| 652 : | tim | 1.37 | <!-- Flatten test classpaths into platform-appropriate strings --> |
| 653 : | <property name="test.classpath" refid="test.classpath"/> | ||
| 654 : | <property name="test.compile.bootclasspath" refid="test.compile.bootclasspath"/> | ||
| 655 : | <property name="test.run.bootclasspath" refid="test.run.bootclasspath"/> | ||
| 656 : | tim | 1.30 | |
| 657 : | tim | 1.28 | </target> |
| 658 : | |||
| 659 : | |||
| 660 : | |||
| 661 : | <!-- Anthill targets --> | ||
| 662 : | |||
| 663 : | <target name="anthill-build" | ||
| 664 : | depends="jar, test, docs, dist-docs"/> | ||
| 665 : | |||
| 666 : | <target name="anthill-publish"> | ||
| 667 : | |||
| 668 : | <copy todir="${deployDir}/docs/private"> | ||
| 669 : | <fileset dir="${build.javadocs.dir}"/> | ||
| 670 : | </copy> | ||
| 671 : | |||
| 672 : | <copy todir="${deployDir}/docs/public"> | ||
| 673 : | <fileset dir="${dist.javadocs.dir}"/> | ||
| 674 : | </copy> | ||
| 675 : | |||
| 676 : | <copy tofile="${deployDir}/index.html" | ||
| 677 : | file="${basedir}/etc/anthill-index.html"/> | ||
| 678 : | |||
| 679 : | <copy todir="${deployDir}/notes"> | ||
| 680 : | <fileset dir="${basedir}/etc/notes"/> | ||
| 681 : | </copy> | ||
| 682 : | |||
| 683 : | tim | 1.1 | </target> |
| 684 : | |||
| 685 : | |||
| 686 : | </project> |
| Doug Lea | ViewVC Help |
| Powered by ViewVC 1.0.8 |