Skip to content

build: use standardized Gradle Daemon toolchain [JetBrainsRuntime/21]#20383

Open
david-allison wants to merge 2 commits intoankidroid:mainfrom
david-allison:gradle-daemon
Open

build: use standardized Gradle Daemon toolchain [JetBrainsRuntime/21]#20383
david-allison wants to merge 2 commits intoankidroid:mainfrom
david-allison:gradle-daemon

Conversation

@david-allison
Copy link
Member

@david-allison david-allison commented Mar 3, 2026

Purpose / Description

Android Studio proposed doing this, aligning the CLI and in-IDE invocations of gradle, and aligning the toolchain across developer machines.

Projects using Daemon toolchain allow builds to automatically detect installed toolchains given the defined JVM criteria or download a compatible one if cannot be found locally.
In addition, using the Daemon toolchain aligns the selection between CLI and IDE, avoiding spawning multiple Daemons improving performance but also makes it simple to handle the required toolchain on different machines.

Changelog with more details: https://developer.android.com/studio/releases/past-releases/as-panda-1-release-notes#daemon-jvm-criteria

Fixes

Approach

  • Open Android Studio
  • Click 'Migrate'
  • Read a lot of documentation, gathering sources. My conclusion:

How Has This Been Tested?

Trusting CI, project appears to still build and run

Learning

Checklist

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • UI Changes: You have tested your change using the Google Accessibility Scanner

using Gradle Daemon JVM Criteria: [JetBrainsRuntime/21]

This change was performed by Android Studio

https://developer.android.com/studio/releases/past-releases/as-panda-1-release-notes#daemon-jvm-criteria

I committed `gradle-daemon-jvm.properties` as it was done so in gradle:
https://github.com/gradle/gradle/commits/master/gradle/gradle-daemon-jvm.properties

This file standardizes the project, so invocations will use:
* https://github.com/JetBrains/JetBrainsRuntime
  * source: https://api.foojay.io/disco/v3.0/distributions
* toolchainVersion: 21

> Projects using Daemon toolchain allow builds to automatically detect
> installed toolchains given the defined JVM criteria or download a compatible
> one if cannot be found locally.
> In addition, using the Daemon toolchain aligns the selection between CLI and
> IDE, avoiding spawning multiple Daemons improving performance but also makes
> it simple to handle the required toolchain on different machines.

My conclusions:

* Standardizing the toolchain should help onboarding.
* Using the JetBrains runtime seems like a sensible JVM: https://github.com/JetBrains/JetBrainsRuntime
* If there are issues, we can revert this with little fallout

Glossary:
foojay: Friends of OpenJDK
Disco: Discovery API

Docs:
https://developer.android.com/studio/releases/past-releases/as-panda-1-release-notes#daemon-jvm-criteria
https://api.foojay.io/swagger-ui/
https://plugins.gradle.org/plugin/org.gradle.toolchains.foojay-resolver-convention
https://docs.gradle.org/current/userguide/gradle_daemon.html#daemon_jvm_criteria

Fixes 20382
* Fix 'foojay' being a typo
  * Friends of OpenJDK: https://foojay.io/
* Document plugin

Issue 20382
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Standardize Gradle Daemon toolchain using Gradle Daemon JVM Criteria

1 participant