Skip to content

Commit 16ee5d9

Browse files
authored
Add Java 25 support (#936)
1 parent 050dbca commit 16ee5d9

22 files changed

Lines changed: 551 additions & 57 deletions

File tree

‎.bazelrc‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
common --java_language_version=17
22
common --tool_java_language_version=17
3-
common --java_runtime_version=remotejdk_21
4-
common --tool_java_runtime_version=remotejdk_21
3+
common --java_runtime_version=remotejdk_25
4+
common --tool_java_runtime_version=remotejdk_25

‎.github/workflows/nix.yaml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
strategy:
4040
fail-fast: false
4141
matrix:
42-
java: [17, 21]
42+
java: [17, 21, 25]
4343
steps:
4444
- uses: actions/checkout@v4
4545

@@ -135,7 +135,7 @@ jobs:
135135
strategy:
136136
fail-fast: false
137137
matrix:
138-
java: [17, 21]
138+
java: [17, 21, 25]
139139
steps:
140140
- uses: actions/checkout@v4
141141

‎CONTRIBUTING.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ The recommended way to get a working development environment is via
1212
nix develop # default shell (JDK 17)
1313
nix develop .#jdk17 # JDK 17
1414
nix develop .#jdk21 # JDK 21
15+
nix develop .#jdk25 # JDK 25
1516
```
1617

1718
This drops you into a shell with `gradle`, `maven`, `bazelisk`, `nodejs`,

‎MODULE.bazel‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
99
maven.install(
1010
artifacts = [
1111
"com.google.protobuf:protobuf-java-util:4.34.2",
12-
"org.projectlombok:lombok:1.18.22",
12+
"org.projectlombok:lombok:1.18.46",
1313
"org.scip-code:scip-java-bindings:0.8.0",
1414
],
1515
known_contributing_modules = ["protobuf"],

‎bin/docker-setup.sh‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ unzip -d /opt/gradle gradle.zip
1515
rm gradle.zip
1616
mv /opt/gradle/*/* /opt/gradle
1717

18-
# pre-install JDK for all major versions
19-
for JVM_VERSION in 21 17
18+
# pre-install JDK for all supported major versions
19+
for JVM_VERSION in 25 21 17
2020
do
2121
coursier java --jvm $JVM_VERSION --jvm-index https://github.com/coursier/jvm-index/blob/master/index.json -- -version
2222
done

‎docs/getting-started.md‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,26 @@ finished indexing the project.
3535

3636
> The `sourcegraph/scip-java` Docker image is made available for convenience at
3737
> the cost of performance. The `sourcegraph/scip-java` image is a big download
38-
> because it includes pre-installed versions of Java 17 and Java 21.
38+
> because it includes pre-installed versions of Java 17, Java 21, and Java 25.
3939
> The `sourcegraph/scip-java` image has slow performance because it needs to
4040
> download all external dependencies of your codebase on every invocation.
4141
>
4242
> For better performance, we recommend using your own Docker image together with
4343
> the [Java launcher](#java-launcher) option.
4444
45-
Java 17 is the default Java version in the `sourcegraph/scip-java` Docker image.
46-
Use the following commands to use a different JVM version:
45+
By default, the `sourcegraph/scip-java` Docker image tries Java 21 and falls
46+
back to Java 17. Use the following commands to select a specific JVM version:
4747

4848
```sh
49-
# Java 17 (default)
49+
# Java 17
5050
docker run -v $(pwd):/sources --env JVM_VERSION=17 sourcegraph/scip-java:latest scip-java index
5151

5252
# Java 21
5353
docker run -v $(pwd):/sources --env JVM_VERSION=21 sourcegraph/scip-java:latest scip-java index
5454

55+
# Java 25
56+
docker run -v $(pwd):/sources --env JVM_VERSION=25 sourcegraph/scip-java:latest scip-java index
57+
5558
```
5659

5760
### Java launcher
@@ -196,7 +199,8 @@ com.sourcegraph.scip_java.ScipJava.INSTANCE.printHelp(Console.out)
196199
The `scip-java` indexer is implemented as a Java compiler plugin that runs as
197200
part of your regular compilation in the build tool. By using Java compiler APIs,
198201
`scip-java` is able to generate accurate indexing information for a broad range
199-
of Java versions.
202+
of Java versions. The project targets support for the three most recent Java LTS
203+
releases.
200204

201205
| Java version | Support | Tracking issue |
202206
| ------------ | ---------------------------- | -------------- |
@@ -205,6 +209,7 @@ of Java versions.
205209
| Java 11 | ❌ | |
206210
| Java 17 | ✅, requires `--add-exports` | |
207211
| Java 21 | ✅, requires `--add-exports` | |
212+
| Java 25 | ✅, requires `--add-exports` | |
208213

209214
For Java 17 and newer versions, the following JVM options are required:
210215

‎flake.nix‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
default = mkDevShell pkgs.jdk17;
6666
jdk17 = mkDevShell pkgs.jdk17;
6767
jdk21 = mkDevShell pkgs.jdk21;
68+
jdk25 = mkDevShell pkgs.jdk25;
6869
};
6970
}
7071
);

‎gradle/libs.versions.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ kctfork = "0.7.1"
66
kotest = "4.6.3"
77
kotlin = "2.2.0"
88
kotlinx-serialization = "1.9.0"
9-
lombok = "1.18.22"
9+
lombok = "1.18.46"
1010
maven-plugin-annotations = "3.6.4"
1111
maven-plugin-api = "3.6.3"
1212
maven-project = "2.2.1"

‎scip-java/src/test/kotlin/tests/BuildToolHarness.kt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ abstract class BuildToolHarness {
115115
substitutions: Map<String, String> = emptyMap(),
116116
): DynamicTest =
117117
dynamicTest(name) {
118-
// Some build tools cap the JDK they support (e.g. Gradle 8.10 tops
119-
// out at JDK 21); skip rather than fail when the JDK is too new.
118+
// Some build tools cap the JDK they support; skip rather than fail
119+
// when the JDK running the test is too new.
120120
assumeTrue(
121121
maxJdk == null || currentJavaVersion <= maxJdk,
122122
"Test $name ignored: JDK $currentJavaVersion exceeds max $maxJdk",

‎scip-java/src/test/kotlin/tests/GradleBuildToolTest.kt‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ import java.nio.file.StandardOpenOption
55
import org.junit.jupiter.api.DynamicTest
66
import org.junit.jupiter.api.TestFactory
77

8-
private const val GRADLE_VERSION = "8.10"
8+
private const val GRADLE_VERSION = "9.1.0"
99

10-
// Gradle 8.10 runs on JDK 8 through 21.
10+
// Gradle 9.1.0 runs on JDK 17 through 25.
1111
// See https://docs.gradle.org/current/userguide/compatibility.html
12-
private const val GRADLE_MAX_JDK = 21
12+
private const val GRADLE_MAX_JDK = 25
1313

1414
class GradleBuildToolTest : BuildToolHarness() {
1515

0 commit comments

Comments
 (0)