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

feat(gradle-wrapper): add support for gradle daemon JVM discovery #31319

Merged
merged 7 commits into from
Sep 15, 2024

Conversation

Churro
Copy link
Collaborator

@Churro Churro commented Sep 10, 2024

Changes

Adds support for an incubating Gradle functionality that allows users to configure the JVM used to run a Gradle build. This was first introduced with Gradle 8.8 (see here).

This PR extends the Java constraint evaluation to check if gradle/gradle-daemon-jvm.properties exists and if so, to extract the toolChainVersion property value as the major version to use for the constraint.

Context

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

Test repo: https://github.com/renovate-demo/30165-gradle-jvm

  • Before this PR, running renovate on this repo to update the gradle-wrapper fails with an error:
> "stderr": "\nFAILURE: Build failed with an exception.\n\n* What went wrong:\nCannot find a Java installation on your machine matching the Daemon JVM defined requirements: Compatible with Java 21 (from gradle/gradle-daemon-jvm.properties).\n\n*,
  • With this change, the Java 21 constraint is detected:
DEBUG: Resolved stable matching version (repository=renovate-demo/30165-gradle-jvm, branch=renovate/gradle-8.x)
       "toolName": "java",
       "constraint": "^21.0.0",
       "resolvedVersion": "21.0.4+7.0.LTS"
DEBUG: Executing command (repository=renovate-demo/30165-gradle-jvm, branch=renovate/gradle-8.x)
       "command": "install-tool java 21.0.4+7.0.LTS"
DEBUG: exec completed (repository=renovate-demo/30165-gradle-jvm, branch=renovate/gradle-8.x)
       "durationMs": 483,
       "stdout": "[21:51:04.834] INFO (1077): Installing tool [email protected]+7.0.LTS...\n",
       "stderr": ""
DEBUG: Executing command (repository=renovate-demo/30165-gradle-jvm, branch=renovate/gradle-8.x)
       "command": "./gradlew :wrapper --gradle-distribution-url https://services.gradle.org/distributions/gradle-8.10.1-bin.zip --gradle-distribution-sha256-sum 1541fa36599e12857140465f3c91a97409b4512501c26f9631fb113e392c5bd1"
DEBUG: exec completed (repository=renovate-demo/30165-gradle-jvm, branch=renovate/gradle-8.x)

rarkins
rarkins previously approved these changes Sep 12, 2024
@rarkins rarkins requested a review from viceice September 13, 2024 14:03
@rarkins rarkins added this pull request to the merge queue Sep 15, 2024
Merged via the queue into renovatebot:main with commit 32a13f6 Sep 15, 2024
38 checks passed
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 38.80.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gradle: Support installation of JDK version requested by Gradle Daemon JVM Discovery
6 participants