Skip to content

Commit 91ad577

Browse files
committed
Updated test script to use Java 9 classes if specified
Set the property below in the local.properties to the path with Java 9 javac to run tests with Java 9 class files: javac.executable=/opt/java/jdk-9/bin/javac
1 parent d519211 commit 91ad577

File tree

1 file changed

+22
-14
lines changed

1 file changed

+22
-14
lines changed

findbugsTestCases/build.xml

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<taskdef name="printBugs" classname="edu.umd.cs.findbugs.anttask.ConvertXmlToTextTask" classpath="${fb-ant.jar}"/>
4343
</target>
4444

45-
<target name="build" depends="classes,runfindbugs,runEffort" />
45+
<target name="build" depends="clean,runfindbugs,runEffort" />
4646

4747
<target name="init">
4848
<echo>findbugs.home is ${findbugs.home}</echo>
@@ -91,29 +91,35 @@
9191
<target name="classes0" if="javac.executable">
9292
<echo message="Compiling with ${javac.executable}"/>
9393
<mkdir dir="build/classes"/>
94-
<javac destdir="build/classes" source="1.7" target="1.7" debug="on" encoding="UTF-8" includeantruntime="false"
95-
>
96-
<src path="src/java"/>
97-
<include name="jsr305/validation/*.java"/>
98-
<classpath>
99-
<path refid="build.classpath"/>
100-
</classpath>
101-
<compilerarg value="-Xlint:none"/>
102-
</javac>
103-
<javac destdir="build/classes" source="1.8" target="1.8" debug="on" encoding="UTF-8" includeantruntime="false"
94+
<echo>Compiling with 1.9, 'javac.executable' should be specified in local.properties</echo>
95+
<javac destdir="build/classes" source="1.9" target="1.9" debug="on" encoding="UTF-8" includeantruntime="false"
96+
failonerror="false"
10497
fork="yes"
10598
executable="${javac.executable}"
10699
>
107-
<src path="src/java"/>
108100
<src path="src/fakeAnnotations"/>
109101
<src path="src/fakeLibraries"/>
102+
<src path="src/java"/>
110103
<exclude name="jsr305/validation/*.java"/>
111104
<classpath>
112105
<path refid="build.classpath"/>
113106
</classpath>
114107
<compilerarg value="-Xlint:none"/>
115108
</javac>
109+
<echo message="Compiling with ant default javac and 1.8 target"/>
110+
<javac destdir="build/classes" source="1.8" target="1.8" debug="on" encoding="UTF-8" includeantruntime="false"
111+
>
112+
<src path="src/fakeAnnotations"/>
113+
<src path="src/fakeLibraries"/>
114+
<src path="src/java"/>
115+
<include name="jsr305/validation/*.java"/>
116+
<classpath>
117+
<path refid="build.classpath"/>
118+
</classpath>
119+
<compilerarg value="-Xlint:none"/>
120+
</javac>
116121
<mkdir dir="build/classes-jdk7"/>
122+
<echo message="Compiling with ant default javac and 1.7 target"/>
117123
<javac destdir="build/classes-jdk7" source="1.7" target="1.7" debug="on" encoding="UTF-8" includeantruntime="false"
118124
>
119125
<src path="src/java"/>
@@ -156,7 +162,9 @@
156162

157163
<target name="clean">
158164
<delete dir="build/classes"/>
165+
<delete dir="build/classes-jdk7"/>
159166
<mkdir dir="build/classes" />
167+
<mkdir dir="build/classes-jdk7" />
160168
<delete file="build/all.jar"/>
161169
<delete failonerror="false">
162170
<fileset dir="build" includes="*.xml"/>
@@ -185,7 +193,7 @@
185193
</findbugs>
186194
</target>
187195

188-
<target name="runEffort" depends="classes,defineTasks">
196+
<target name="runEffort" depends="defineTasks">
189197
<echo>Test expected warnings with *min* effort</echo>
190198
<findbugs home="${findbugs.home}" jvmargs="-ea ${maxHeap}"
191199
jvm="${java.executable}"
@@ -275,7 +283,7 @@
275283
</target>
276284

277285

278-
<target name="runNormal" depends="classes,defineTasks">
286+
<target name="runNormal" depends="defineTasks">
279287
<echo>Test expected warnings with ${ant.java.version} javac bytecode</echo>
280288
<findbugs home="${findbugs.home}" jvmargs="-ea ${maxHeap} -Dfindbugs.sf.comment=false"
281289
output="xml:withMessages" timestampNow="true" reportLevel="low"

0 commit comments

Comments
 (0)