Skip to content

Commit c6d2ba3

Browse files
authored
Enable building NullAway on JDK 25 (#1315)
1 parent 0a2e2b0 commit c6d2ba3

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

build.gradle

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ buildscript {
2222
}
2323

2424
dependencies {
25-
classpath 'com.android.tools.build:gradle:8.7.2'
25+
classpath 'com.android.tools.build:gradle:8.13.0'
2626
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.34.0'
2727
}
2828
}
2929
plugins {
30-
id "com.diffplug.spotless" version "6.25.0"
31-
id "net.ltgt.errorprone" version "4.1.0" apply false
30+
id "com.diffplug.spotless" version "8.0.0"
31+
id "net.ltgt.errorprone" version "4.3.0" apply false
3232
id "com.gradleup.shadow" version "8.3.8" apply false
3333
id "me.champeau.jmh" version "0.7.1" apply false
3434
id "com.github.ben-manes.versions" version "0.51.0"
@@ -42,7 +42,14 @@ repositories {
4242

4343
apply from: "gradle/dependencies.gradle"
4444

45-
if (JavaVersion.current() == JavaVersion.VERSION_21) {
45+
def currentJavaVersion = JavaVersion.current()
46+
if (!currentJavaVersion.isCompatibleWith(JavaVersion.VERSION_21)) {
47+
throw new GradleException(
48+
"NullAway only builds on JDK 21 or higher now. Detected ${System.getProperty('java.version')}. Please upgrade to JDK 21 or later."
49+
)
50+
}
51+
52+
if (currentJavaVersion == JavaVersion.VERSION_21) {
4653
def runtimeVersion = Runtime.version()
4754
if (runtimeVersion.feature() == 21 && runtimeVersion.update() < 8) {
4855
throw new GradleException(
@@ -129,7 +136,7 @@ spotless {
129136
groovyGradle {
130137
target '**/*.gradle'
131138
greclipse()
132-
indentWithSpaces(4)
139+
leadingTabsToSpaces(4)
133140
trimTrailingWhitespace()
134141
endWithNewline()
135142
}

gradle/dependencies.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def versions = [
5959
autoValue : "1.10.2",
6060
autoService : "1.1.1",
6161
javaparser : "3.26.2",
62-
googlejavaformat : "1.24.0",
62+
googlejavaformat : "1.30.0",
6363
]
6464

6565
def apt = [

0 commit comments

Comments
 (0)