Skip to content

Commit 86febe1

Browse files
authored
Test on JDK 24 (#1187)
1 parent 059b90b commit 86febe1

File tree

4 files changed

+21
-6
lines changed

4 files changed

+21
-6
lines changed

buildSrc/src/main/groovy/nullaway.java-test-conventions.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ plugins {
2020
}
2121

2222
jacoco {
23-
toolVersion = "0.8.12"
23+
toolVersion = "0.8.13"
2424
}
2525

2626
// Do not generate reports for individual projects
@@ -65,7 +65,7 @@ test {
6565
}
6666

6767
// Tasks for testing on other JDK versions; see https://jakewharton.com/build-on-latest-java-test-through-lowest-java/
68-
[21, 23].each { majorVersion ->
68+
[21, 24].each { majorVersion ->
6969
def jdkTest = tasks.register("testJdk$majorVersion", Test) {
7070
onlyIf {
7171
// Only run when using the latest Error Prone version

gradle/dependencies.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,11 @@ def test = [
115115
commonsLang3 : "org.apache.commons:commons-lang3:3.8.1",
116116
commonsLang : "commons-lang:commons-lang:2.6",
117117
jsr305Annotations : "com.google.code.findbugs:jsr305:3.0.2",
118-
lombok : "org.projectlombok:lombok:1.18.34",
118+
lombok : "org.projectlombok:lombok:1.18.38",
119119
springBeans : "org.springframework:spring-beans:5.3.7",
120120
springContext : "org.springframework:spring-context:5.3.7",
121121
grpcCore : "io.grpc:grpc-core:1.15.1", // Should upgrade, but this matches our guava version
122-
mockito : "org.mockito:mockito-core:5.13.0",
122+
mockito : "org.mockito:mockito-core:5.16.1",
123123
javaxAnnotationApi : "javax.annotation:javax.annotation-api:1.3.2",
124124
assertJ : "org.assertj:assertj-core:3.23.1",
125125
]

jar-infer/jar-infer-lib/build.gradle

+5
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,9 @@ tasks.withType(JavaCompile).configureEach {
5050
options.compilerArgs += "--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED"
5151
}
5252

53+
tasks.getByName('testJdk24').configure {
54+
// Will not work until WALA is updated to support JDK 24; see https://github.com/uber/NullAway/issues/1189
55+
onlyIf { false }
56+
}
57+
5358
apply plugin: 'com.vanniktech.maven.publish'

jdk-recent-unit-tests/build.gradle

+12-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ plugins {
2222
// We must null out sourceCompatibility and targetCompatibility to use toolchains.
2323
java.sourceCompatibility = null
2424
java.targetCompatibility = null
25-
java.toolchain.languageVersion.set JavaLanguageVersion.of(23)
25+
java.toolchain.languageVersion.set JavaLanguageVersion.of(24)
2626

2727
configurations {
2828
// We use this configuration to expose a module path that can be
@@ -51,7 +51,17 @@ tasks.withType(Test).configureEach { test ->
5151
]
5252
}
5353

54+
// Disable tasks for specific JDK versions; we only run on the recent JDK version specified above
5455
tasks.getByName('testJdk21').configure {
55-
// We don't need this task since we already run the tests on JDK 21
5656
onlyIf { false }
5757
}
58+
tasks.getByName('testJdk24').configure {
59+
onlyIf { false }
60+
}
61+
62+
tasks.getByName('test').configure {
63+
// older EP versions don't work on JDK 24+
64+
onlyIf {
65+
deps.versions.errorProneApi == deps.versions.errorProneLatest
66+
}
67+
}

0 commit comments

Comments
 (0)