From 79c16dc883e9b486bae9159e9004ab86d31f97e7 Mon Sep 17 00:00:00 2001 From: Morgan Pretty Date: Thu, 8 Oct 2026 07:28:34 +1100 Subject: [PATCH 1/3] Run the Gradle daemon on any JDK 21 and download it from Adoptium The daemon JVM was pinned to JetBrains 21, fetched through api.foojay.io package-id redirects. foojay stopped serving those ids (foojayio/discoapi#165), and CI's setup-java Temurin 21 doesn't meet a JetBrains criterion, so every CI build failed provisioning the daemon before it started. Drop the vendor so any JDK 21 runs the daemon: CI's Temurin 21 is used as is, and locally Android Studio's JBR 21 still is. For machines with no JDK 21, the Linux/macOS/Windows URLs now go straight to Adoptium's API instead of through foojay; FreeBSD/Unix keep foojay, as Adoptium has no builds for them. Re-running updateDaemonJvm overwrites the file. --- gradle/gradle-daemon-jvm.properties | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/gradle/gradle-daemon-jvm.properties b/gradle/gradle-daemon-jvm.properties index 53c77678c1..54c33ed1b7 100644 --- a/gradle/gradle-daemon-jvm.properties +++ b/gradle/gradle-daemon-jvm.properties @@ -1,13 +1,15 @@ -#This file is generated by updateDaemonJvm +#Generated by updateDaemonJvm, then edited (re-running it overwrites this): any vendor's JDK 21 can +#run the daemon, so the JDK 21 that CI installs is used as is, and downloads go straight to Adoptium +#so they don't depend on the api.foojay.io index (see foojayio/discoapi#165). Adoptium has no +#FreeBSD/Unix builds, so those still go through foojay. toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/29ee363f71d060405f729a8f1b7f7aef/redirect toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/67a0fee3c4236b6397dcbe8575ca2011/redirect -toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/29ee363f71d060405f729a8f1b7f7aef/redirect -toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/ecd23fd7707c683afbcd6052998cb6a9/redirect -toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/10fc3bf1ee0001078a473afe6e43cfdb/redirect -toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/9c55677aff3966382f3d853c0959bfb2/redirect +toolchainUrl.LINUX.AARCH64=https\://api.adoptium.net/v3/binary/latest/21/ga/linux/aarch64/jdk/hotspot/normal/eclipse +toolchainUrl.LINUX.X86_64=https\://api.adoptium.net/v3/binary/latest/21/ga/linux/x64/jdk/hotspot/normal/eclipse +toolchainUrl.MAC_OS.AARCH64=https\://api.adoptium.net/v3/binary/latest/21/ga/mac/aarch64/jdk/hotspot/normal/eclipse +toolchainUrl.MAC_OS.X86_64=https\://api.adoptium.net/v3/binary/latest/21/ga/mac/x64/jdk/hotspot/normal/eclipse toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/29ee363f71d060405f729a8f1b7f7aef/redirect toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/67a0fee3c4236b6397dcbe8575ca2011/redirect -toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/39846e8427e64a3824c13e399d7d813c/redirect -toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/932015f6361ccaead0c6d9b8717ed96e/redirect -toolchainVendor=JETBRAINS +toolchainUrl.WINDOWS.AARCH64=https\://api.adoptium.net/v3/binary/latest/21/ga/windows/aarch64/jdk/hotspot/normal/eclipse +toolchainUrl.WINDOWS.X86_64=https\://api.adoptium.net/v3/binary/latest/21/ga/windows/x64/jdk/hotspot/normal/eclipse toolchainVersion=21 From 480cf9d869bbf78a1003fb679eafc6d90e22451b Mon Sep 17 00:00:00 2001 From: Morgan Pretty Date: Thu, 8 Oct 2026 09:51:49 +1100 Subject: [PATCH 2/3] Pin the daemon JDK downloads to Temurin 21.0.12.1+1 The api.adoptium.net 'latest' URLs would hand a different JDK to a fresh machine whenever Adoptium publishes a 21.x update. Point each platform at the 21.0.12.1+1 release asset instead, so a provisioned daemon JDK only changes when this file does. --- gradle/gradle-daemon-jvm.properties | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/gradle/gradle-daemon-jvm.properties b/gradle/gradle-daemon-jvm.properties index 54c33ed1b7..e8cf34ffad 100644 --- a/gradle/gradle-daemon-jvm.properties +++ b/gradle/gradle-daemon-jvm.properties @@ -1,15 +1,15 @@ #Generated by updateDaemonJvm, then edited (re-running it overwrites this): any vendor's JDK 21 can -#run the daemon, so the JDK 21 that CI installs is used as is, and downloads go straight to Adoptium -#so they don't depend on the api.foojay.io index (see foojayio/discoapi#165). Adoptium has no -#FreeBSD/Unix builds, so those still go through foojay. +#run the daemon, so the JDK 21 that CI installs is used as is, and downloads are pinned to Adoptium's +#own Temurin 21.0.12.1+1 release so they don't depend on the api.foojay.io index (see +#foojayio/discoapi#165). Adoptium has no FreeBSD/Unix builds, so those still go through foojay. toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/29ee363f71d060405f729a8f1b7f7aef/redirect toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/67a0fee3c4236b6397dcbe8575ca2011/redirect -toolchainUrl.LINUX.AARCH64=https\://api.adoptium.net/v3/binary/latest/21/ga/linux/aarch64/jdk/hotspot/normal/eclipse -toolchainUrl.LINUX.X86_64=https\://api.adoptium.net/v3/binary/latest/21/ga/linux/x64/jdk/hotspot/normal/eclipse -toolchainUrl.MAC_OS.AARCH64=https\://api.adoptium.net/v3/binary/latest/21/ga/mac/aarch64/jdk/hotspot/normal/eclipse -toolchainUrl.MAC_OS.X86_64=https\://api.adoptium.net/v3/binary/latest/21/ga/mac/x64/jdk/hotspot/normal/eclipse +toolchainUrl.LINUX.AARCH64=https\://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.12.1%2B1/OpenJDK21U-jdk_aarch64_linux_hotspot_21.0.12.1_1.tar.gz +toolchainUrl.LINUX.X86_64=https\://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.12.1%2B1/OpenJDK21U-jdk_x64_linux_hotspot_21.0.12.1_1.tar.gz +toolchainUrl.MAC_OS.AARCH64=https\://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.12.1%2B1/OpenJDK21U-jdk_aarch64_mac_hotspot_21.0.12.1_1.tar.gz +toolchainUrl.MAC_OS.X86_64=https\://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.12.1%2B1/OpenJDK21U-jdk_x64_mac_hotspot_21.0.12.1_1.tar.gz toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/29ee363f71d060405f729a8f1b7f7aef/redirect toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/67a0fee3c4236b6397dcbe8575ca2011/redirect -toolchainUrl.WINDOWS.AARCH64=https\://api.adoptium.net/v3/binary/latest/21/ga/windows/aarch64/jdk/hotspot/normal/eclipse -toolchainUrl.WINDOWS.X86_64=https\://api.adoptium.net/v3/binary/latest/21/ga/windows/x64/jdk/hotspot/normal/eclipse +toolchainUrl.WINDOWS.AARCH64=https\://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.12.1%2B1/OpenJDK21U-jdk_aarch64_windows_hotspot_21.0.12.1_1.zip +toolchainUrl.WINDOWS.X86_64=https\://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.12.1%2B1/OpenJDK21U-jdk_x64_windows_hotspot_21.0.12.1_1.zip toolchainVersion=21 From 52c59180300731edb6000761f9957d6355411fc8 Mon Sep 17 00:00:00 2001 From: Morgan Pretty Date: Thu, 8 Oct 2026 10:01:44 +1100 Subject: [PATCH 3/3] Configure updateDaemonJvm so regenerating keeps the daemon JDK settings The previous commits edited gradle-daemon-jvm.properties by hand, so running updateDaemonJvm (to move to a newer JDK, say) would have put the JetBrains vendor and foojay URLs back. Set languageVersion and the Temurin download URLs on the updateDaemonJvm task instead, leaving the vendor unset; the properties file is again plain generated output, and regenerating it reproduces it exactly. Adoptium has no FreeBSD or other Unix builds, so those platforms get the Linux ones. That matches what the generated foojay entries did (FREE_BSD/UNIX shared the Linux package ids), and those ids now return 400 as well. --- build.gradle.kts | 36 +++++++++++++++++++++++++++++ gradle/gradle-daemon-jvm.properties | 13 ++++------- 2 files changed, 41 insertions(+), 8 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 117fb76066..c3517a6120 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,3 +1,7 @@ +import org.gradle.platform.Architecture +import org.gradle.platform.BuildPlatformFactory +import org.gradle.platform.OperatingSystem + buildscript { repositories { google() @@ -57,3 +61,35 @@ allprojects { } } } + +// Generates gradle/gradle-daemon-jvm.properties. Any vendor's JDK 21 can run the daemon, so CI's +// setup-java JDK and Android Studio's JBR are used as they are; a machine without one downloads +// Adoptium's Temurin release directly rather than through the api.foojay.io index. Adoptium has no +// FreeBSD or other Unix builds, so those get the Linux ones, as Gradle's own foojay lookup does. +tasks.updateDaemonJvm { + val temurin = "21.0.12.1+1" + val release = "https://github.com/adoptium/temurin21-binaries/releases/download/" + + "jdk-${temurin.replace("+", "%2B")}/OpenJDK21U-jdk" + val file = temurin.replace("+", "_") + val linuxAarch64 = uri("${release}_aarch64_linux_hotspot_$file.tar.gz") + val linuxX64 = uri("${release}_x64_linux_hotspot_$file.tar.gz") + + languageVersion = JavaLanguageVersion.of(21) + toolchainDownloadUrls = mapOf( + BuildPlatformFactory.of(Architecture.AARCH64, OperatingSystem.LINUX) to linuxAarch64, + BuildPlatformFactory.of(Architecture.X86_64, OperatingSystem.LINUX) to linuxX64, + BuildPlatformFactory.of(Architecture.AARCH64, OperatingSystem.FREE_BSD) to linuxAarch64, + BuildPlatformFactory.of(Architecture.X86_64, OperatingSystem.FREE_BSD) to linuxX64, + BuildPlatformFactory.of(Architecture.AARCH64, OperatingSystem.UNIX) to linuxAarch64, + BuildPlatformFactory.of(Architecture.X86_64, OperatingSystem.UNIX) to linuxX64, + BuildPlatformFactory.of(Architecture.AARCH64, OperatingSystem.MAC_OS) to + uri("${release}_aarch64_mac_hotspot_$file.tar.gz"), + BuildPlatformFactory.of(Architecture.X86_64, OperatingSystem.MAC_OS) to + uri("${release}_x64_mac_hotspot_$file.tar.gz"), + BuildPlatformFactory.of(Architecture.AARCH64, OperatingSystem.WINDOWS) to + uri("${release}_aarch64_windows_hotspot_$file.zip"), + BuildPlatformFactory.of(Architecture.X86_64, OperatingSystem.WINDOWS) to + uri("${release}_x64_windows_hotspot_$file.zip"), + ) + toolchainPlatforms = toolchainDownloadUrls.get().keys +} diff --git a/gradle/gradle-daemon-jvm.properties b/gradle/gradle-daemon-jvm.properties index e8cf34ffad..741a249745 100644 --- a/gradle/gradle-daemon-jvm.properties +++ b/gradle/gradle-daemon-jvm.properties @@ -1,15 +1,12 @@ -#Generated by updateDaemonJvm, then edited (re-running it overwrites this): any vendor's JDK 21 can -#run the daemon, so the JDK 21 that CI installs is used as is, and downloads are pinned to Adoptium's -#own Temurin 21.0.12.1+1 release so they don't depend on the api.foojay.io index (see -#foojayio/discoapi#165). Adoptium has no FreeBSD/Unix builds, so those still go through foojay. -toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/29ee363f71d060405f729a8f1b7f7aef/redirect -toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/67a0fee3c4236b6397dcbe8575ca2011/redirect +#This file is generated by updateDaemonJvm +toolchainUrl.FREE_BSD.AARCH64=https\://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.12.1%2B1/OpenJDK21U-jdk_aarch64_linux_hotspot_21.0.12.1_1.tar.gz +toolchainUrl.FREE_BSD.X86_64=https\://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.12.1%2B1/OpenJDK21U-jdk_x64_linux_hotspot_21.0.12.1_1.tar.gz toolchainUrl.LINUX.AARCH64=https\://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.12.1%2B1/OpenJDK21U-jdk_aarch64_linux_hotspot_21.0.12.1_1.tar.gz toolchainUrl.LINUX.X86_64=https\://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.12.1%2B1/OpenJDK21U-jdk_x64_linux_hotspot_21.0.12.1_1.tar.gz toolchainUrl.MAC_OS.AARCH64=https\://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.12.1%2B1/OpenJDK21U-jdk_aarch64_mac_hotspot_21.0.12.1_1.tar.gz toolchainUrl.MAC_OS.X86_64=https\://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.12.1%2B1/OpenJDK21U-jdk_x64_mac_hotspot_21.0.12.1_1.tar.gz -toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/29ee363f71d060405f729a8f1b7f7aef/redirect -toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/67a0fee3c4236b6397dcbe8575ca2011/redirect +toolchainUrl.UNIX.AARCH64=https\://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.12.1%2B1/OpenJDK21U-jdk_aarch64_linux_hotspot_21.0.12.1_1.tar.gz +toolchainUrl.UNIX.X86_64=https\://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.12.1%2B1/OpenJDK21U-jdk_x64_linux_hotspot_21.0.12.1_1.tar.gz toolchainUrl.WINDOWS.AARCH64=https\://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.12.1%2B1/OpenJDK21U-jdk_aarch64_windows_hotspot_21.0.12.1_1.zip toolchainUrl.WINDOWS.X86_64=https\://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.12.1%2B1/OpenJDK21U-jdk_x64_windows_hotspot_21.0.12.1_1.zip toolchainVersion=21