|
23 | 23 | <property name="test-repeat" value="1" /> |
24 | 24 | <property name="test-timeout" value="1440" /> |
25 | 25 | <property name="test-formatter" value="oneline" /> |
26 | | - <property name="use-concjunit" value="true" /> |
27 | 26 | <property name="findbugs-formatter" value="html" /> |
28 | 27 | <property name="test-halt" value="false" /> |
29 | 28 | <property name="force-server" value="no" /> |
|
41 | 40 | <property name="drjava.test.config" value="testFiles/drjava.basic.config" /> |
42 | 41 |
|
43 | 42 | <property environment="env" /> |
| 43 | + <property name="java7-home" value="${env.JAVA7_HOME}" /> |
44 | 44 | <property name="java6-home" value="${env.JAVA6_HOME}" /> |
45 | 45 | <property name="java5-home" value="${env.JAVA5_HOME}" /> |
46 | 46 | <property name="launch4j-home" value="${env.LAUNCH4J_HOME}" /> |
|
68 | 68 |
|
69 | 69 | <fileset id="libs" dir="lib" includes="*.jar" /> <!-- Only include jars that are at the top level (not in buildlib) --> |
70 | 70 |
|
71 | | - |
| 71 | + <!-- Use ConcJUnit if use-concjunit is not defined and we are not running Java 7. --> |
| 72 | + <!-- ConcJUnit is currently incompatible with Java 7. --> |
| 73 | + <if> |
| 74 | + <contains string="${java.version}" substring="1.7"/> |
| 75 | + <then> |
| 76 | + <echo message="ConcJUnit is currently incompatible with Java 7."/> |
| 77 | + <property name="use-concjunit" value="false" /> |
| 78 | + </then> |
| 79 | + <else> |
| 80 | + <property name="use-concjunit" value="true" /> |
| 81 | + </else> |
| 82 | + </if> |
72 | 83 |
|
73 | 84 | <!-- ************ |
74 | 85 | Help Targets |
|
91 | 102 | <echo message=" compiling and '-5' targets)" /> |
92 | 103 | <echo message="JAVA6_HOME: Home folder of the Java 6 JRE or JDK (required for" /> |
93 | 104 | <echo message=" '-6' targets)" /> |
| 105 | + <echo message="JAVA7_HOME: Home folder of the Java 7 JRE or JDK (required for" /> |
| 106 | + <echo message=" '-7' targets)" /> |
94 | 107 | <echo message="LAUNCH4J_HOME: Location of the Launch4j installation (used to " /> |
95 | 108 | <echo message=" release a Windows application)" /> |
96 | 109 | <echo message="CLOVER_JAR: Location of the Clover jar file" /> |
|
296 | 309 | <antcall target="iterate-tests"> |
297 | 310 | <param name="test-jvm" value="java" /> |
298 | 311 | <param name="test-tools" value="${current-tools}" /> |
| 312 | + <param name="test-force-disable-concjunit" value="false" /> |
| 313 | + </antcall> |
| 314 | + </target> |
| 315 | + |
| 316 | + <target name="test-7" depends="compile, resolve-java7-exec, resolve-java7-tools" unless="skip-test" |
| 317 | + description="Run all tests under Java 7 (after compiling); use -Dtest-spec=... to filter"> |
| 318 | + <echo message="ConcJUnit is currently incompatible with Java 7."/> |
| 319 | + <antcall target="iterate-tests"> |
| 320 | + <param name="test-jvm" value="${java7-exec}" /> |
| 321 | + <param name="test-tools" value="${java7-tools}" /> |
| 322 | + <param name="test-force-disable-concjunit" value="true" /> |
299 | 323 | </antcall> |
300 | 324 | </target> |
301 | 325 |
|
|
304 | 328 | <antcall target="iterate-tests"> |
305 | 329 | <param name="test-jvm" value="${java6-exec}" /> |
306 | 330 | <param name="test-tools" value="${java6-tools}" /> |
| 331 | + <param name="test-force-disable-concjunit" value="false" /> |
307 | 332 | </antcall> |
308 | 333 | </target> |
309 | 334 |
|
|
312 | 337 | <antcall target="iterate-tests"> |
313 | 338 | <param name="test-jvm" value="${java5-exec}" /> |
314 | 339 | <param name="test-tools" value="${java5-tools}" /> |
| 340 | + <param name="test-force-disable-concjunit" value="false" /> |
315 | 341 | </antcall> |
316 | 342 | </target> |
317 | 343 |
|
|
401 | 427 |
|
402 | 428 |
|
403 | 429 | <target name="do-test" depends="resolve-jvm-args, resolve-junit-jar"> |
404 | | - <echo message="Running all tests matching '${test-filter-string}' with command '${test-jvm}', using '${junit-jar}'" /> |
| 430 | + <echo message="Running all tests matching '${test-filter-string}' with command '${test-jvm}', using '${junit-jar}' and '${test-tools}'" /> |
405 | 431 | <extendclasspath path="${junit-jar}" /> |
406 | 432 | <junit haltonfailure="${test-halt}" failureproperty="test-failed" |
407 | 433 | fork="yes" forkmode="perTest" maxmemory="800M" jvm="${test-jvm}" dir="${basedir}"> |
|
442 | 468 | </antcall> |
443 | 469 | </target> |
444 | 470 |
|
| 471 | + <target name="run-7" depends="compile, resolve-java7-exec" |
| 472 | + description="Run the main class under Java 7 (after compiling)"> |
| 473 | + <antcall target="do-run"> |
| 474 | + <param name="run-jvm" value="${java7-exec}" /> |
| 475 | + </antcall> |
| 476 | + </target> |
| 477 | + |
445 | 478 | <target name="run-6" depends="compile, resolve-java6-exec" |
446 | 479 | description="Run the main class under Java 6 (after compiling)"> |
447 | 480 | <antcall target="do-run"> |
|
481 | 514 | </antcall> |
482 | 515 | </target> |
483 | 516 |
|
| 517 | + <target name="run-jar-7" depends="jar, resolve-java7-exec" |
| 518 | + description="Run the jar file under Java 7 (after building it)"> |
| 519 | + <antcall target="do-run-jar"> |
| 520 | + <param name="run-jvm" value="${java7-exec}" /> |
| 521 | + </antcall> |
| 522 | + </target> |
| 523 | + |
484 | 524 | <target name="run-jar-6" depends="jar, resolve-java6-exec" |
485 | 525 | description="Run the jar file under Java 6 (after building it)"> |
486 | 526 | <antcall target="do-run-jar"> |
|
592 | 632 | <target name="clover" depends="clean, setup-clover, test, report-clover" |
593 | 633 | description="Generate a Clover test coverage report" /> |
594 | 634 |
|
| 635 | + <target name="clover-7" depends="clean, setup-clover, test-7, report-clover" |
| 636 | + description="Generate a Clover test coverage report under Java 7" /> |
| 637 | + |
595 | 638 | <target name="clover-6" depends="clean, setup-clover, test-6, report-clover" |
596 | 639 | description="Generate a Clover test coverage report under Java 6" /> |
597 | 640 |
|
|
1209 | 1252 | Property-resolution Targets |
1210 | 1253 | *************************** --> |
1211 | 1254 |
|
| 1255 | + <target name="resolve-java7-runtime"> |
| 1256 | + <!-- We rely on "location" to generate a platform-specific path; note that properties |
| 1257 | + are immutable and so java7-runtime will only be set the *first* time. --> |
| 1258 | + |
| 1259 | + <property name="java7-runtime-1" location="${java7-home}/lib/rt.jar" /> |
| 1260 | + <available property="java7-runtime" value="${java7-runtime-1}" file="${java7-runtime-1}" /> |
| 1261 | + |
| 1262 | + <property name="java7-runtime-2" location="${java7-home}/jre/lib/rt.jar" /> |
| 1263 | + <available property="java7-runtime" value="${java7-runtime-2}" file="${java7-runtime-2}" /> |
| 1264 | + |
| 1265 | + <property name="java7-runtime-3" location="${java7-home}/../Classes/classes.jar" /> |
| 1266 | + <available property="java7-runtime" value="${java7-runtime-3}" file="${java7-runtime-3}" /> |
| 1267 | + |
| 1268 | + <fail message="Can't find rt.jar in the Java 7 home: ${java7-home}" unless="java7-runtime" /> |
| 1269 | + </target> |
| 1270 | + |
| 1271 | + <target name="resolve-java7-exec"> |
| 1272 | + <!-- We rely on "location" to generate a platform-specific path --> |
| 1273 | + |
| 1274 | + <property name="java7-exec-1" location="${java7-home}/bin/java.exe" /> |
| 1275 | + <condition property="java7-exec" value="${java7-exec-1}"> |
| 1276 | + <and> |
| 1277 | + <available file="${java7-exec-1}" /> |
| 1278 | + <os family="windows" /> |
| 1279 | + </and> |
| 1280 | + </condition> |
| 1281 | + |
| 1282 | + <property name="java7-exec-2" location="${java7-home}/bin/java" /> |
| 1283 | + <available property="java7-exec" value="${java7-exec-2}" file="${java7-exec-2}" /> |
| 1284 | + |
| 1285 | + <fail message="Can't find the java executable in the Java 7 home: ${java7-home}" unless="java7-exec" /> |
| 1286 | + </target> |
| 1287 | + |
1212 | 1288 | <target name="resolve-java6-runtime"> |
1213 | 1289 | <!-- We rely on "location" to generate a platform-specific path; note that properties |
1214 | 1290 | are immutable and so java6-runtime will only be set the *first* time. --> |
|
1275 | 1351 | <fail message="Can't find the java executable in the Java 5 home: ${java5-home}" unless="java5-exec" /> |
1276 | 1352 | </target> |
1277 | 1353 |
|
| 1354 | + <target name="resolve-java7-tools"> |
| 1355 | + <property name="java7-tools-1" location="${java7-home}/lib/tools.jar" /> |
| 1356 | + <available property="java7-tools" value="${java7-tools-1}" file="${java7-tools-1}" /> |
| 1357 | + |
| 1358 | + <property name="java7-tools-2" location="${java7-home}/../lib/tools.jar" /> |
| 1359 | + <available property="java7-tools" value="${java7-tools-2}" file="${java7-tools-2}" /> |
| 1360 | + |
| 1361 | + <property name="java7-tools-3" location="${java7-home}/../Classes/classes.jar" /> |
| 1362 | + <available property="java7-tools" value="${java7-tools-3}" file="${java7-tools-3}" /> |
| 1363 | + |
| 1364 | + <fail message="Can't find tools.jar in the Java 7 home: ${java7-home}" unless="java7-tools" /> |
| 1365 | + </target> |
| 1366 | + |
1278 | 1367 | <target name="resolve-java6-tools"> |
1279 | 1368 | <property name="java6-tools-1" location="${java6-home}/lib/tools.jar" /> |
1280 | 1369 | <available property="java6-tools" value="${java6-tools-1}" file="${java6-tools-1}" /> |
|
1468 | 1557 | ***************** --> |
1469 | 1558 | <target name="resolve-junit-jar"> |
1470 | 1559 | <if> |
1471 | | - <istrue value="${use-concjunit}" /> |
| 1560 | + <and> |
| 1561 | + <istrue value="${use-concjunit}" /> |
| 1562 | + <isfalse value="${test-force-disable-concjunit}" /> |
| 1563 | + </and> |
1472 | 1564 | <then> |
1473 | 1565 | <property name="junit-jar-1" location="lib/buildlib/concutest-junit-4.7-withrt-nodep.jar" /> |
1474 | 1566 | <available property="junit-jar" value="${junit-jar-1}" file="${junit-jar-1}" /> |
|
0 commit comments