Skip to content

Commit a53f1fb

Browse files
runningcodeclaude
andauthored
build: Pin the Gradle daemon to JDK 21 (#6364)
* build: Pin the Gradle daemon to JDK 21 Since #6242 the build needs JDK 21 to run Gradle. Daemon JVM criteria let Gradle pick an installed JDK 21 regardless of JAVA_HOME. Also write a heap dump on daemon OOM instead of crashing, and silence Gradle's welcome message and Android Studio's AGP upgrade prompt. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * build: Drop the JDK 21 check now that the daemon JVM is pinned The daemon JVM criteria only accept JDK 21, so the check can't fail. CONTRIBUTING.md no longer claims a newer JDK runs the build. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent b875f50 commit a53f1fb

4 files changed

Lines changed: 9 additions & 8 deletions

File tree

‎CONTRIBUTING.md‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@ You are welcome to use whatever tools you prefer for making a contribution. Howe
3636

3737
# Requirements
3838

39-
The project requires you to run JDK 21 or newer. Compilation and tests always happen on JDK 21
40-
through a [toolchain](https://docs.gradle.org/current/userguide/toolchains.html), so a newer JDK
41-
runs the build but never changes its output.
39+
The project requires JDK 21. Gradle finds it through
40+
[toolchain auto-detection](https://docs.gradle.org/current/userguide/toolchains.html#sec:auto_detection)
41+
(SDKMAN!, asdf, IntelliJ, ...) and uses it for the build, compilation and tests, whatever JDK
42+
`JAVA_HOME` points to.
4243

4344
## Android
4445

‎build.gradle.kts‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@ plugins {
2929
alias(libs.plugins.sentry) apply false
3030
}
3131

32-
check(JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_21)) {
33-
"This build requires JDK 21 or newer, but runs on JDK ${JavaVersion.current()}."
34-
}
35-
3632
buildscript {
3733
repositories {
3834
google()

‎gradle.properties‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# Daemons heap size
2-
org.gradle.jvmargs=-Xmx8g -XX:MaxMetaspaceSize=2g -XX:+CrashOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseParallelGC
2+
org.gradle.jvmargs=-Xmx8g -XX:MaxMetaspaceSize=2g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseParallelGC
33
org.gradle.caching=true
44
org.gradle.parallel=true
55
org.gradle.configureondemand=true
66
org.gradle.configuration-cache=true
77
org.gradle.configuration-cache.parallel=true
8+
org.gradle.welcome=never
89

910
org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled
1011

@@ -15,6 +16,8 @@ android.builtInKotlin=false
1516
android.newDsl=false
1617
android.experimental.lint.version=9.4.0
1718

19+
android.disableAgpUpgradePrompt=true
20+
1821
# Release information
1922
versionName=8.61.1
2023

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
toolchainVersion=21

0 commit comments

Comments
 (0)