Skip to content

Commit c83d690

Browse files
Robert CartwrightRobert Cartwright
authored andcommitted
This commit updates build.xml in javalanglevels to use Java 8 instead
of Java 6/7. It also updates the javalanglevels-base.jar in drjava/lib to the current jar in the javalanglevels file tree. It appears that the build still contains some active debugging code for javalanglevels. All unit tests pass but I suspect that past debugging (suspended for months) was trying to resurrect some commented out unit tests in javalanglevels. In the interests of getting out a credible DrJasa update, I am suspending this debugging process in favor of using the current build which is working in practice for a student working on the "functional Java" exercises in "Elements of Object-Oriented Design". The code coverage section of the build.xml files appears to be working. But the integrated code coverage within DrJava appears to still have problems.
1 parent 44af0fc commit c83d690

File tree

5 files changed

+37
-45
lines changed

5 files changed

+37
-45
lines changed

drjava/build.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
<echo message="${extlibs}" />
7474
<!-- Use ConcJUnit if use-concjunit is not defined and we are not running Java 7. -->
7575
<!-- ConcJUnit is currently incompatible with Java 7. -->
76+
<!-- ConcJunit is causing problems with unit testing on Mac OS x platforms; defeating it here
7677
<if>
7778
<contains string="${java.version}" substring="1.7"/>
7879
<then>
@@ -83,7 +84,8 @@
8384
<property name="use-concjunit" value="true" />
8485
</else>
8586
</if>
86-
87+
-->
88+
<property name="use-concjunit" value="false" />
8789
<!-- ************
8890
Help Targets
8991
************ -->

drjava/lib/javalanglevels-base.jar

12.1 KB
Binary file not shown.

drjava/src/edu/rice/cs/drjava/model/junit/JUnitTestManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ public JUnitResultTuple getLastResult() {
126126

127127
/** Find the test classes among the given classNames and accumulate them in
128128
* TestSuite for junit. Returns null if a test suite is already pending.
129-
* @param classNames the class names that are test class candidates
130-
* @param files the files corresponding to classNames
129+
* @param classNames the (fully qualified) class names that are test class candidates
130+
* @param Java File objects for the source files corresponding to classNames
131131
* @param coverageMetadata metadata to be used to generate the coverage report
132132
* @return list of test class names
133133
*/

javalanglevels/build.xml

Lines changed: 30 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@
3030
<property name="link-source" value="yes" />
3131

3232
<property environment="env" />
33-
<property name="java7-home" value="${env.JAVA7_HOME}" />
34-
<property name="java6-home" value="${env.JAVA6_HOME}" />
35-
<property name="javacc-home" value="${env.JAVACC_HOME}" />
36-
<property name="clover-jar" value="${env.CLOVER_JAR}" />
33+
<property name="java7-home" value="${env.JAVA7_HOME}" />
34+
<property name="java8-home" value="${env.JAVA8_HOME}" />
35+
<property name="javacc-home" value="${env.JAVACC_HOME}" />
36+
<property name="clover-jar" value="${env.CLOVER_JAR}" />
3737
<property name="findbugs-home" value="${env.FINDBUGS_HOME}" />
3838

3939
<property name="is-development" value="yes" /> <!-- Development or stable release -->
@@ -72,10 +72,10 @@
7272
<echo message="variables may need to be defined (depending on the target invoked):" />
7373
<echo message="PATH: The 'javac' command is used for compilation;" />
7474
<echo message=" the 'java' command is used by default in testing/running; " />
75-
<echo message="JAVA6_HOME: Home folder of the Java 6 JRE or JDK (required for" />
76-
<echo message=" '-6' targets)" />
7775
<echo message="JAVA7_HOME: Home folder of the Java 7 JRE or JDK (required for" />
7876
<echo message=" compiling and '-7' targets)" />
77+
<echo message="JAVA8_HOME: Home folder of the Java 8 JRE or JDK (required for" />
78+
<echo message=" '-8' targets)" />
7979
<echo message="JAVACC_HOME: Top-level directory of JavaCC (version 6.0+ is preferred)" />
8080
<echo message="CLOVER_JAR: Location of the Clover jar file" />
8181
<echo message="FINDBUGS_HOME: Location of the FindBugs installation" />
@@ -203,7 +203,7 @@
203203
description="Compile all source files (after generating the source)">
204204
</target>
205205

206-
<target name="do-compile" depends="resolve-java7-runtime">
206+
<target name="do-compile" depends="resolve-java8-runtime">
207207

208208
<echo message="Compiling src directory to classes/base and classes/test with command 'javac'" />
209209

@@ -216,7 +216,7 @@
216216
</move>
217217

218218
<javac srcdir="src" destdir="classes/base" source="1.6" target="1.6"
219-
bootclasspath="${java7-runtime}" sourcepath="" includeAntRuntime="no"
219+
bootclasspath="${java8-runtime}" sourcepath="" includeAntRuntime="no"
220220
executable="javac" fork="yes" memoryMaximumSize="512M"
221221
debug="on" optimize="off" deprecation="on" >
222222
<classpath>
@@ -294,21 +294,13 @@
294294
</antcall>
295295
</target>
296296

297-
<target name="test-6" depends="compile, resolve-java6-exec" unless="skip-test"
298-
description="Run all tests under Java 6 (after compiling); use -Dtest-spec=... to filter">
297+
<target name="test-8" depends="compile, resolve-java8-exec" unless="skip-test"
298+
description="Run all tests under Java 8 (after compiling); use -Dtest-spec=... to filter">
299299
<antcall target="iterate-tests">
300-
<param name="test-jvm" value="${java6-exec}" />
300+
<param name="test-jvm" value="${java8-exec}" />
301301
</antcall>
302302
</target>
303303

304-
<target name="test-7" depends="compile, resolve-java7-exec" unless="skip-test"
305-
description="Run all tests under Java 7 (after compiling); use -Dtest-spec=... to filter">
306-
<antcall target="iterate-tests">
307-
<param name="test-jvm" value="${java7-exec}" />
308-
</antcall>
309-
</target>
310-
311-
312304
<target name="iterate-tests" depends="resolve-test-formatter-class">
313305
<!-- Calls do-test, unless that is overridden by the caller -->
314306
<property name="do-test-target" value="do-test" />
@@ -489,7 +481,7 @@
489481
<fileset refid="libs" />
490482
<pathelement location="lib/buildlib/junit.jar" />
491483
</classpath>
492-
<link href="http://java.sun.com/j2se/1.7/docs/api" />
484+
<link href="http://java.sun.com/j2se/1.8/docs/api" />
493485
<link href="http://junit.org/junit/javadoc/3.8.1" />
494486
<link href="http://drjava.org/javadoc/plt" />
495487
<!-- Additional external library APIs may be listed here -->
@@ -500,11 +492,8 @@
500492
<target name="clover" depends="clean, setup-clover, test, report-clover"
501493
description="Generate a Clover test coverage report" />
502494

503-
<target name="clover-6" depends="clean, setup-clover, test-6, report-clover"
504-
description="Generate a Clover test coverage report under Java 6" />
505-
506-
<target name="clover-7" depends="clean, setup-clover, test-7, report-clover"
507-
description="Generate a Clover test coverage report under Java 7" />
495+
<target name="clover-8" depends="clean, setup-clover, test-8, report-clover"
496+
description="Generate a Clover test coverage report under Java 8" />
508497

509498
<target name="report-clover" depends="resolve-version-tag">
510499
<echo message="Generating Clover report" />
@@ -775,37 +764,37 @@
775764
<fail message="Can't find the java executable in the Java 6 home: ${java6-home}" unless="java6-exec" />
776765
</target>
777766

778-
<target name="resolve-java7-runtime">
767+
<target name="resolve-java8-runtime">
779768
<!-- We rely on "location" to generate a platform-specific path; note that properties
780-
are immutable and so java7-runtime will only be set the *first* time. -->
769+
are immutable and so java8-runtime will only be set the *first* time. -->
781770

782-
<property name="java7-runtime-1" location="${java7-home}/lib/rt.jar" />
783-
<available property="java7-runtime" value="${java7-runtime-1}" file="${java7-runtime-1}" />
771+
<property name="java8-runtime-1" location="${java8-home}/lib/rt.jar" />
772+
<available property="java8-runtime" value="${java8-runtime-1}" file="${java8-runtime-1}" />
784773

785-
<property name="java7-runtime-2" location="${java7-home}/jre/lib/rt.jar" />
786-
<available property="java7-runtime" value="${java7-runtime-2}" file="${java7-runtime-2}" />
774+
<property name="java8-runtime-2" location="${java8-home}/jre/lib/rt.jar" />
775+
<available property="java8-runtime" value="${java8-runtime-2}" file="${java8-runtime-2}" />
787776

788-
<property name="java7-runtime-3" location="${java7-home}/../Classes/classes.jar" />
789-
<available property="java7-runtime" value="${java7-runtime-3}" file="${java7-runtime-3}" />
777+
<property name="java8-runtime-3" location="${java8-home}/../Classes/classes.jar" />
778+
<available property="java8-runtime" value="${java8-runtime-3}" file="${java8-runtime-3}" />
790779

791-
<fail message="Can't find rt.jar in the Java 7 home: ${java7-home}" unless="java7-runtime" />
780+
<fail message="Can't find rt.jar in the Java 8 home: ${java8-home}" unless="java8-runtime" />
792781
</target>
793782

794-
<target name="resolve-java7-exec">
783+
<target name="resolve-java8-exec">
795784
<!-- We rely on "location" to generate a platform-specific path -->
796785

797-
<property name="java7-exec-1" location="${java7-home}/bin/java.exe" />
798-
<condition property="java7-exec" value="${java7-exec-1}">
786+
<property name="java8-exec-1" location="${java8-home}/bin/java.exe" />
787+
<condition property="java8-exec" value="${java8-exec-1}">
799788
<and>
800-
<available file="${java7-exec-1}" />
789+
<available file="${java8-exec-1}" />
801790
<os family="windows" />
802791
</and>
803792
</condition>
804793

805-
<property name="java7-exec-2" location="${java7-home}/bin/java" />
806-
<available property="java7-exec" value="${java7-exec-2}" file="${java7-exec-2}" />
794+
<property name="java8-exec-2" location="${java8-home}/bin/java" />
795+
<available property="java8-exec" value="${java8-exec-2}" file="${java8-exec-2}" />
807796

808-
<fail message="Can't find the java executable in the Java 7 home: ${java7-home}" unless="java7-exec" />
797+
<fail message="Can't find the java executable in the Java 8 home: ${java8-home}" unless="java8-exec" />
809798
</target>
810799

811800

javalanglevels/src/edu/rice/cs/javalanglevels/LanguageLevelConverter.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,11 +461,12 @@ private void _addParseException(ParseException pe) {
461461
sf = jep.SourceFile(); // Does the SourceFile method parse the file f embedded in jep? NO!
462462
// Parse the classes in sf
463463
final Set<String> topLevelClasses = new HashSet<String>();
464+
final SourceFile fsf = sf;
464465
for (TypeDefBase t: sf.getTypes()) {
465466
t.visit(new JExpressionIFAbstractVisitor<Void>() {
466467
public Void forClassDef(ClassDef that) {
467468
String className = that.getName().getText();
468-
_log.log("Class '" + className + "' found in file " + sf):
469+
_log.log("Class '" + className + "' found in file " + fsf);
469470
topLevelClasses.add(className);
470471
return null;
471472
}

0 commit comments

Comments
 (0)