Skip to content

Commit a216392

Browse files
committed
Add Java 25 support
1 parent b2b652b commit a216392

4 files changed

Lines changed: 66 additions & 2 deletions

File tree

.github/workflows/nix.yaml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,64 @@ jobs:
122122
- name: scip-kotlinc tests
123123
run: gradle :scip-kotlinc:test --no-daemon
124124

125+
jdk25-plugin:
126+
runs-on: ubuntu-latest
127+
name: scip-javac plugin (JDK 25)
128+
steps:
129+
- uses: actions/checkout@v4
130+
131+
- uses: DeterminateSystems/nix-installer-action@v22
132+
with:
133+
summarize: false
134+
135+
- uses: DeterminateSystems/magic-nix-cache-action@v13
136+
137+
# The plugin jar targets `--release 11`, so it is built with the default
138+
# toolchain (Gradle 8.14 cannot run on JDK 25) and then exercised against a
139+
# JDK 25 `javac` below.
140+
- name: Build scip-javac plugin jar
141+
run: gradle :scip-javac:shadowJar --no-daemon
142+
143+
- name: Index a fixture with JDK 25 javac
144+
env:
145+
NIX_DEVELOP: ${{ github.workspace }}#jdk25
146+
run: |
147+
java -version
148+
javac -version
149+
shopt -s nullglob
150+
jars=(scip-javac/target/gradle/libs/scip-javac-*-all.jar)
151+
if [ "${#jars[@]}" -eq 0 ]; then
152+
echo "scip-javac shadow jar not found" >&2
153+
exit 1
154+
fi
155+
jar="${jars[0]}"
156+
work="$(mktemp -d)"
157+
mkdir -p "$work/src" "$work/out" "$work/classes"
158+
printf '%s\n' \
159+
'public class Hello {' \
160+
' public static void main(String[] args) {' \
161+
' System.out.println("hello from JDK 25");' \
162+
' }' \
163+
'}' > "$work/src/Hello.java"
164+
javac \
165+
-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
166+
-J--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED \
167+
-J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED \
168+
-J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
169+
-J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \
170+
-cp "$jar" \
171+
-processorpath "$jar" \
172+
-d "$work/classes" \
173+
"-Xplugin:scip -sourceroot:$work/src -targetroot:$work/out" \
174+
"$work/src/Hello.java"
175+
shards=("$work"/out/META-INF/scip/*.scip)
176+
if [ "${#shards[@]}" -eq 0 ]; then
177+
echo "no SCIP shard produced under $work/out" >&2
178+
find "$work/out" -type f >&2 || true
179+
exit 1
180+
fi
181+
echo "SCIP shard generated: ${shards[0]}"
182+
125183
snapshots:
126184
runs-on: ubuntu-latest
127185
name: Snapshots

bin/docker-setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ rm gradle.zip
1616
mv /opt/gradle/*/* /opt/gradle
1717

1818
# pre-install JDK for all major versions
19-
for JVM_VERSION in 21 17 11
19+
for JVM_VERSION in 25 21 17 11
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: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ 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 11, Java 17, and Java 21.
38+
> because it includes pre-installed versions of Java 11, Java 17, Java 21, and
39+
> Java 25.
3940
> The `sourcegraph/scip-java` image has slow performance because it needs to
4041
> download all external dependencies of your codebase on every invocation.
4142
>
@@ -55,6 +56,9 @@ docker run -v $(pwd):/sources --env JVM_VERSION=17 sourcegraph/scip-java:latest
5556
# Java 21
5657
docker run -v $(pwd):/sources --env JVM_VERSION=21 sourcegraph/scip-java:latest scip-java index
5758

59+
# Java 25
60+
docker run -v $(pwd):/sources --env JVM_VERSION=25 sourcegraph/scip-java:latest scip-java index
61+
5862
```
5963

6064
### Java launcher
@@ -207,6 +211,7 @@ of Java versions.
207211
| Java 11 || |
208212
| Java 17 | ✅, requires `--add-exports` | |
209213
| Java 21 | ✅, requires `--add-exports` | |
214+
| Java 25 | ✅, requires `--add-exports` | |
210215

211216
For Java 17 and newer versions, the following JVM options are required:
212217

flake.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@
9696
jdk11 = mkDevShell pkgs.temurin-bin-11;
9797
jdk17 = mkDevShell pkgs.jdk17;
9898
jdk21 = mkDevShell pkgs.jdk21;
99+
jdk25 = mkDevShell pkgs.jdk25;
99100
};
100101
}
101102
);

0 commit comments

Comments
 (0)