-
Notifications
You must be signed in to change notification settings - Fork 415
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stick with Java 17 on CI #2938
Stick with Java 17 on CI #2938
Conversation
Hi! What's the main motivation for using Java 17 everywhere? It probably doesn't matter in At the moment, Java 11 seems to be the default sweet spot between not too old and not too modern, and it's still supported, whereas Java 8 and Java 17 are checked additionally |
We enabled Java 8 as the default in tests via toolchain in #2918, and Java 8 as the compatibility before, now we can bump the running JDK to 17, see #2918 (comment). |
Oh, we have the toolchain now, right, completely forgot about it So basically Java 17 will be used for setting things up and some non-build java executions, and then the toolchain versions will be used for running the actual tests and whatnot? |
Yep. @aSemy WDYT? |
The Java toolchain used to build Dokka projects is set in dokka/build-logic/src/main/kotlin/org/jetbrains/conventions/base-java.gradle.kts Lines 15 to 19 in 3c3d2e4
The actual value is set using the Gradle property Line 3 in 3c3d2e4
When Gradle tries to build Dokka it will realise it needs JDK 8, and try and auto-detect an installed version. It's similar for the tests: they are configured to run using JDK 8, 11, or 17 via a toolchain, and so Gradle will try and auto-detect those versions too. Gradle doesn't automatically download JDKs, so they need to be pre-installed, and that's what the setup-java step is for. However, it looks like the latest GitHub runners have JDK 8, 11, and 17 pre-installed, so technically the setup-java step isn't needed for building/testing all (I suspect that the setup-java step was needed in older GitHub runners). However, Gradle itself is a JVM tool, so it needs Java installed and it the In summary:
The setup-java action does some caching, but I'm not sure how much impact that has (if any). If I've understood correctly, perhaps it would be good to add a small bit of docs in |
@IgnatBeresnev There are JDK 8 and 11 used in TeamCity runners, can we bump them also? https://scans.gradle.com/s/y4y6wdam2dtua#infrastructure |
Follow up #2918.