Skip to content
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

Daemon toolchain auto-provisioning updateDaemonJvm generates download URLs #29022

Draft
wants to merge 2 commits into
base: release
Choose a base branch
from

Conversation

vmadalin
Copy link
Contributor

@vmadalin vmadalin commented May 2, 2024

Context

The Daemon toolchain auto-provisioning mechanism is part of Phase 2 of toolchain support for Gradle Daemon, where the motivation behind it and other technical details can be found on the public spec document. This
PR allows the updateDaemonJvm to populates the gradle-daemon-jvm.properties with the download info by getting this info from JavaToolchainResolverRegistry (that was moved from toolchain-jvm to toolchain-jvm-shared together with minimum required dependencies, so it can be reused from the Launcher) following the format toolchainUrl . The ToolchainRepositoriesResolver.java class created on build-configuration is responsible to resolve the download URL for each platform and in case there are multiple applied JavaToolchainRepository just the first valid URL is taken into consideration similar to the already existing implementation.

NOTE: This change was built on top of #28931 to avoid merge conflicts.

Testing

Unit tests:
UpdateDaemonJvmModifierTest.groovy
ToolchainRepositoriesResolverTest.groovy

Integration tests:
UpdateDaemonJvmIntegrationTest.groovy

Demo

Simple demo exposing how updateDaemonJvm task populates the gradle/gradle-daemon-jvm.properties with the download toolchain url based on the applied foojay resolve plugin.

UpdateDaemonJvm.generates.download.URLs.mov

Contributor Checklist

  • Review Contribution Guidelines
  • Make sure that all commits are signed off to indicate that you agree to the terms of Developer Certificate of Origin.
  • Make sure all contributed code can be distributed under the terms of the Apache License 2.0, e.g. the code was written by yourself or the original code is licensed under a license compatible to Apache License 2.0.
  • Check "Allow edit from maintainers" option in pull request so that additional changes can be pushed by Gradle team
  • Provide integration tests (under <subproject>/src/integTest) to verify changes from a user perspective
  • Provide unit tests (under <subproject>/src/test) to verify logic
  • Update User Guide, DSL Reference, and Javadoc for public-facing changes
  • Ensure that tests pass sanity check: ./gradlew sanityCheck
  • Ensure that tests pass locally: ./gradlew <changed-subproject>:quickTest

Signed-off-by: Madalin Valceleanu <vmadalin@google.com>
@vmadalin vmadalin requested review from a team as code owners May 2, 2024 15:43
@vmadalin vmadalin requested review from jvandort and cobexer and removed request for a team May 2, 2024 15:43
@bot-gradle bot-gradle added from:contributor PR by an external contributor to-triage labels May 2, 2024
@vmadalin vmadalin marked this pull request as draft May 2, 2024 15:44
@vmadalin vmadalin changed the title Add JavaToolchainResolverRegistry to updateDaemonJvm task to generate download URLs on the daemon jvm properties Daemon toolchain auto-provisioning updateDaemonJvm generate download URLs May 2, 2024
@vmadalin vmadalin changed the title Daemon toolchain auto-provisioning updateDaemonJvm generate download URLs Daemon toolchain auto-provisioning updateDaemonJvm generates download URLs May 2, 2024
@vmadalin vmadalin force-pushed the daemon-toolchain-auto-provisioning-resolve-download-urls branch 4 times, most recently from 8ca37de to 590b827 Compare May 6, 2024 19:06
… download URLs on the build properties

Signed-off-by: Madalin Valceleanu <vmadalin@google.com>
@vmadalin vmadalin force-pushed the daemon-toolchain-auto-provisioning-resolve-download-urls branch from 590b827 to bf3d7c2 Compare May 7, 2024 11:17
@vmadalin vmadalin changed the base branch from master to release May 7, 2024 11:18
@ov7a ov7a removed the to-triage label May 14, 2024
@cobexer cobexer requested review from ljacomet and removed request for cobexer May 16, 2024 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
from:contributor PR by an external contributor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants