|
40 | 40 | <property name="drjava.test.config" value="testFiles/drjava.basic.config" /> |
41 | 41 |
|
42 | 42 | <property environment="env" /> |
| 43 | + <property name="java8-home" value="${env.JAVA8_HOME}" /> |
43 | 44 | <property name="java7-home" value="${env.JAVA7_HOME}" /> |
44 | 45 | <property name="java6-home" value="${env.JAVA6_HOME}" /> |
45 | 46 | <property name="java5-home" value="${env.JAVA5_HOME}" /> |
|
107 | 108 | <echo message=" '-6' targets)" /> |
108 | 109 | <echo message="JAVA7_HOME: Home folder of the Java 7 JRE or JDK (required for" /> |
109 | 110 | <echo message=" '-7' targets)" /> |
| 111 | + <echo message="JAVA8_HOME: Home folder of the Java 8 JRE or JDK (required for" /> |
| 112 | + <echo message=" '-8' targets)" /> |
110 | 113 | <echo message="LAUNCH4J_HOME: Location of the Launch4j installation (used to " /> |
111 | 114 | <echo message=" release a Windows application)" /> |
112 | 115 | <echo message="CLOVER_JAR: Location of the Clover jar file" /> |
|
215 | 218 | Compilation Targets |
216 | 219 | ******************* --> |
217 | 220 |
|
| 221 | + <!-- The following target assumes that javac resolves a Java 8 compiler --> |
218 | 222 | <target name="compile" depends="generate-source, do-compile, copy-resources, unjar-libs" |
219 | 223 | description="Compile all source files (after generating the source)"> |
220 | 224 | </target> |
221 | 225 |
|
222 | | - <target name="do-compile" depends="resolve-java7-runtime, resolve-java7-tools"> |
| 226 | + <target name="do-compile" depends="resolve-java8-runtime, resolve-java8-tools"> |
223 | 227 |
|
224 | 228 | <echo message="Compiling src directory to classes/base and classes/test with command 'javac'" /> |
225 | 229 |
|
|
231 | 235 | <fileset dir="classes/test" includes="**/*" /> |
232 | 236 | </move> |
233 | 237 |
|
234 | | - <javac srcdir="src" destdir="classes/base" source="1.5" target="1.5" |
235 | | - bootclasspath="${java7-runtime}" sourcepath="" includeAntRuntime="no" |
236 | | - executable="javac" fork="yes" memoryMaximumSize="512M" |
| 238 | + <javac srcdir="src" destdir="classes/base" source="1.6" target="1.6" |
| 239 | + bootclasspath="${java8-runtime}" sourcepath="" includeAntRuntime="no" |
| 240 | + executable="javac" fork="yes" memoryMaximumSize="1024M" |
237 | 241 | debug="on" optimize="off" deprecation="on" > |
238 | 242 | <classpath> |
239 | 243 | <!-- TODO: Remove this dependency on tools.jar by refactoring and moving all the dependent |
240 | 244 | debugger code into the "platform" module --> |
241 | | - <pathelement location="${java7-tools}" /> |
| 245 | + <pathelement location="${java8-tools}" /> |
242 | 246 | <fileset refid="libs" /> |
243 | 247 | <pathelement location="lib/buildlib/junit.jar" /> |
244 | 248 | <pathelement location="lib/buildlib/netbeans-memory-leak-utils.jar" /> |
|
265 | 269 | </move> |
266 | 270 |
|
267 | 271 | </target> |
| 272 | + |
| 273 | + <!-- The following target assumes that javac resolves to a Java 6 javac compiler --> |
| 274 | + <target name="compile-6" depends="generate-source, do-compile-6, copy-resources, unjar-libs" |
| 275 | + description="Compile all source files (after generating the source)"> |
| 276 | + </target> |
268 | 277 |
|
| 278 | + <target name="do-compile-6" depends="resolve-java6-runtime, resolve-java6-tools"> |
269 | 279 |
|
| 280 | + <echo message="Compiling src directory to classes/base and classes/test with command 'javac'" /> |
| 281 | + |
| 282 | + <mkdir dir="classes/base" /> |
| 283 | + <mkdir dir="classes/test" /> |
| 284 | + |
| 285 | + <!-- Move any test classes back to base to prevent recompilation --> |
| 286 | + <move todir="classes/base"> |
| 287 | + <fileset dir="classes/test" includes="**/*" /> |
| 288 | + </move> |
| 289 | + |
| 290 | + <javac srcdir="src" destdir="classes/base" source="1.6" target="1.6" |
| 291 | + bootclasspath="${java6-runtime}" sourcepath="" includeAntRuntime="no" |
| 292 | + executable="javac" fork="yes" memoryMaximumSize="1024M" |
| 293 | + debug="on" optimize="off" deprecation="on" > |
| 294 | + <classpath> |
| 295 | + <!-- TODO: Remove this dependency on tools.jar by refactoring and moving all the dependent |
| 296 | + debugger code into the "platform" module --> |
| 297 | + <pathelement location="${java6-tools}" /> |
| 298 | + <fileset refid="libs" /> |
| 299 | + <pathelement location="lib/buildlib/junit.jar" /> |
| 300 | + <pathelement location="lib/buildlib/netbeans-memory-leak-utils.jar" /> |
| 301 | + <pathelement location="classes/base" /> |
| 302 | + </classpath> |
| 303 | + <compilerarg value="-Xlint" /> |
| 304 | + <!-- Ignore serial warnings, because they occur for every Throwable definition (among others) --> |
| 305 | + <compilerarg value="-Xlint:-serial" /> |
| 306 | + <!-- Use the next line to compile against other sources, ignoring any unneeded classes. |
| 307 | + This can be useful in creating a pruned version of a jar file for the lib directory. |
| 308 | + (You must also clear the sourcepath="" option.) |
| 309 | + <include name="${src-working-dir}/**/*.java" /> --> |
| 310 | + </javac> |
| 311 | + |
| 312 | + <mkdir dir="classes/test" /> <!-- May be deleted by the previous move --> |
| 313 | + <move todir="classes/test"> |
| 314 | + <fileset dir="classes/base"> |
| 315 | + <include name="**/*Test.class" /> |
| 316 | + <include name="**/*Test$*.class" /> |
| 317 | + <include name="**/*TestCase.class" /> |
| 318 | + <include name="**/*TestCase$*.class" /> |
| 319 | + <!-- Additional test classes should be listed here --> |
| 320 | + </fileset> |
| 321 | + </move> |
| 322 | + |
| 323 | + </target> |
| 324 | + |
| 325 | + <!-- The following target assumes that javac resolves to a Java 7 javac compiler --> |
| 326 | + <target name="compile-7" depends="generate-source, do-compile-7, copy-resources, unjar-libs" |
| 327 | + description="Compile all source files (after generating the source)"> |
| 328 | + </target> |
| 329 | + |
| 330 | + <target name="do-compile-7" depends="resolve-java7-runtime, resolve-java7-tools"> |
| 331 | + |
| 332 | + <echo message="Compiling src directory to classes/base and classes/test with command 'javac'" /> |
| 333 | + |
| 334 | + <mkdir dir="classes/base" /> |
| 335 | + <mkdir dir="classes/test" /> |
| 336 | + |
| 337 | + <!-- Move any test classes back to base to prevent recompilation --> |
| 338 | + <move todir="classes/base"> |
| 339 | + <fileset dir="classes/test" includes="**/*" /> |
| 340 | + </move> |
| 341 | + |
| 342 | + <javac srcdir="src" destdir="classes/base" source="1.6" target="1.6" |
| 343 | + bootclasspath="${java7-runtime}" sourcepath="" includeAntRuntime="no" |
| 344 | + executable="javac" fork="yes" memoryMaximumSize="1024M" |
| 345 | + debug="on" optimize="off" deprecation="on" > |
| 346 | + <classpath> |
| 347 | + <!-- TODO: Remove this dependency on tools.jar by refactoring and moving all the dependent |
| 348 | + debugger code into the "platform" module --> |
| 349 | + <pathelement location="${java7-tools}" /> |
| 350 | + <fileset refid="libs" /> |
| 351 | + <pathelement location="lib/buildlib/junit.jar" /> |
| 352 | + <pathelement location="lib/buildlib/netbeans-memory-leak-utils.jar" /> |
| 353 | + <pathelement location="classes/base" /> |
| 354 | + </classpath> |
| 355 | + <compilerarg value="-Xlint" /> |
| 356 | + <!-- Ignore serial warnings, because they occur for every Throwable definition (among others) --> |
| 357 | + <compilerarg value="-Xlint:-serial" /> |
| 358 | + <!-- Use the next line to compile against other sources, ignoring any unneeded classes. |
| 359 | + This can be useful in creating a pruned version of a jar file for the lib directory. |
| 360 | + (You must also clear the sourcepath="" option.) |
| 361 | + <include name="${src-working-dir}/**/*.java" /> --> |
| 362 | + </javac> |
| 363 | + |
| 364 | + <mkdir dir="classes/test" /> <!-- May be deleted by the previous move --> |
| 365 | + <move todir="classes/test"> |
| 366 | + <fileset dir="classes/base"> |
| 367 | + <include name="**/*Test.class" /> |
| 368 | + <include name="**/*Test$*.class" /> |
| 369 | + <include name="**/*TestCase.class" /> |
| 370 | + <include name="**/*TestCase$*.class" /> |
| 371 | + <!-- Additional test classes should be listed here --> |
| 372 | + </fileset> |
| 373 | + </move> |
| 374 | + |
| 375 | + </target> |
| 376 | + |
270 | 377 | <target name="copy-resources"> |
271 | 378 | <copy todir="classes/base"> |
272 | 379 | <fileset dir="src"> |
|
301 | 408 | </unjar> |
302 | 409 | </target> |
303 | 410 |
|
304 | | - |
305 | 411 |
|
306 | 412 | <!-- *************** |
307 | 413 | Testing Targets |
|
316 | 422 | </antcall> |
317 | 423 | </target> |
318 | 424 |
|
| 425 | + <target name="test-8" depends="compile, resolve-java8-exec, resolve-java8-tools" unless="skip-test" |
| 426 | + description="Run all tests under Java 8 (after compiling); use -Dtest-spec=... to filter"> |
| 427 | + <echo message="ConcJUnit is currently incompatible with Java 7."/> |
| 428 | + <antcall target="iterate-tests"> |
| 429 | + <param name="test-jvm" value="${java8-exec}" /> |
| 430 | + <param name="test-tools" value="${java8-tools}" /> |
| 431 | + <param name="test-force-disable-concjunit" value="true" /> |
| 432 | + </antcall> |
| 433 | + </target> |
| 434 | + |
319 | 435 | <target name="test-7" depends="compile, resolve-java7-exec, resolve-java7-tools" unless="skip-test" |
320 | 436 | description="Run all tests under Java 7 (after compiling); use -Dtest-spec=... to filter"> |
321 | 437 | <echo message="ConcJUnit is currently incompatible with Java 7."/> |
|
433 | 549 | <echo message="Running all tests matching '${test-filter-string}' with command '${test-jvm}', using '${junit-jar}' and '${test-tools}'" /> |
434 | 550 | <extendclasspath path="${junit-jar}" /> |
435 | 551 | <junit haltonfailure="${test-halt}" failureproperty="test-failed" |
436 | | - fork="yes" forkmode="perTest" maxmemory="1G" jvm="${test-jvm}" dir="${basedir}"> |
| 552 | + fork="yes" forkmode="perTest" maxmemory="2G" jvm="${test-jvm}" dir="${basedir}"> |
437 | 553 | <classpath> |
438 | 554 | <pathelement location="${test-tools}" /> |
439 | 555 | <pathelement location="${junit-jar}" /> |
|
471 | 587 | </antcall> |
472 | 588 | </target> |
473 | 589 |
|
| 590 | + <target name="run-8" depends="compile, resolve-java8-exec" |
| 591 | + description="Run the main class under Java 8 (after compiling)"> |
| 592 | + <antcall target="do-run"> |
| 593 | + <param name="run-jvm" value="${java8-exec}" /> |
| 594 | + </antcall> |
| 595 | + </target> |
| 596 | + |
474 | 597 | <target name="run-7" depends="compile, resolve-java7-exec" |
475 | 598 | description="Run the main class under Java 7 (after compiling)"> |
476 | 599 | <antcall target="do-run"> |
|
517 | 640 | </antcall> |
518 | 641 | </target> |
519 | 642 |
|
| 643 | + <target name="run-jar-8" depends="jar, resolve-java8-exec" |
| 644 | + description="Run the jar file under Java 7 (after building it)"> |
| 645 | + <antcall target="do-run-jar"> |
| 646 | + <param name="run-jvm" value="${java8-exec}" /> |
| 647 | + </antcall> |
| 648 | + </target> |
| 649 | + |
520 | 650 | <target name="run-jar-7" depends="jar, resolve-java7-exec" |
521 | 651 | description="Run the jar file under Java 7 (after building it)"> |
522 | 652 | <antcall target="do-run-jar"> |
|
1255 | 1385 | Property-resolution Targets |
1256 | 1386 | *************************** --> |
1257 | 1387 |
|
| 1388 | + <target name="resolve-java8-runtime"> |
| 1389 | + <!-- We rely on "location" to generate a platform-specific path; note that properties |
| 1390 | + are immutable and so java8-runtime will only be set the *first* time. --> |
| 1391 | + |
| 1392 | + <property name="java8-runtime-1" location="${java8-home}/lib/rt.jar" /> |
| 1393 | + <available property="java8-runtime" value="${java8-runtime-1}" file="${java8-runtime-1}" /> |
| 1394 | + |
| 1395 | + <property name="java8-runtime-2" location="${java8-home}/jre/lib/rt.jar" /> |
| 1396 | + <available property="java8-runtime" value="${java8-runtime-2}" file="${java8-runtime-2}" /> |
| 1397 | + |
| 1398 | + <property name="java8-runtime-3" location="${java8-home}/../Classes/classes.jar" /> |
| 1399 | + <available property="java8-runtime" value="${java8-runtime-3}" file="${java8-runtime-3}" /> |
| 1400 | + |
| 1401 | + <echo message="java8-runtime = ${java8-runtime}" /> |
| 1402 | + |
| 1403 | + <fail message="Can't find rt.jar in the Java 8 home: ${java8-home}" unless="java8-runtime" /> |
| 1404 | + </target> |
| 1405 | + |
1258 | 1406 | <target name="resolve-java7-runtime"> |
1259 | 1407 | <!-- We rely on "location" to generate a platform-specific path; note that properties |
1260 | 1408 | are immutable and so java7-runtime will only be set the *first* time. --> |
|
1273 | 1421 | <fail message="Can't find rt.jar in the Java 7 home: ${java7-home}" unless="java7-runtime" /> |
1274 | 1422 | </target> |
1275 | 1423 |
|
| 1424 | + <target name="resolve-java8-exec"> |
| 1425 | + <!-- We rely on "location" to generate a platform-specific path --> |
| 1426 | + |
| 1427 | + <property name="java8-exec-1" location="${java8-home}/bin/java.exe" /> |
| 1428 | + <condition property="java8-exec" value="${java8-exec-1}"> |
| 1429 | + <and> |
| 1430 | + <available file="${java8-exec-1}" /> |
| 1431 | + <os family="windows" /> |
| 1432 | + </and> |
| 1433 | + </condition> |
| 1434 | + |
| 1435 | + <property name="java8-exec-2" location="${java8-home}/bin/java" /> |
| 1436 | + <available property="java8-exec" value="${java8-exec-2}" file="${java8-exec-2}" /> |
| 1437 | + |
| 1438 | + <fail message="Can't find the java executable in the Java 8 home: ${java8-home}" unless="java8-exec" /> |
| 1439 | + </target> |
| 1440 | + |
1276 | 1441 | <target name="resolve-java7-exec"> |
1277 | 1442 | <!-- We rely on "location" to generate a platform-specific path --> |
1278 | 1443 |
|
|
1360 | 1525 | <fail message="Can't find the java executable in the Java 5 home: ${java5-home}" unless="java5-exec" /> |
1361 | 1526 | </target> |
1362 | 1527 |
|
| 1528 | + <target name="resolve-java8-tools"> |
| 1529 | + <property name="java8-tools-1" location="${java8-home}/lib/tools.jar" /> |
| 1530 | + <available property="java8-tools" value="${java8-tools-1}" file="${java8-tools-1}" /> |
| 1531 | + |
| 1532 | + <property name="java8-tools-2" location="${java8-home}/../lib/tools.jar" /> |
| 1533 | + <available property="java8-tools" value="${java8-tools-2}" file="${java8-tools-2}" /> |
| 1534 | + |
| 1535 | + <property name="java8-tools-3" location="${java8-home}/../Classes/classes.jar" /> |
| 1536 | + <available property="java8-tools" value="${java8-tools-3}" file="${java8-tools-3}" /> |
| 1537 | + |
| 1538 | + <fail message="Can't find tools.jar in the Java 8 home: ${java8-home}" unless="java8-tools" /> |
| 1539 | + </target> |
| 1540 | + |
1363 | 1541 | <target name="resolve-java7-tools"> |
1364 | 1542 | <property name="java7-tools-1" location="${java7-home}/lib/tools.jar" /> |
1365 | 1543 | <available property="java7-tools" value="${java7-tools-1}" file="${java7-tools-1}" /> |
|
0 commit comments