Skip to content

Add ~/.gradle/jdks to cache #245

Description

@devminded

Description:
Convenience: Be able to cache JDKs for projects that uses the built in toolchain support in Gradle.

Having the action configure cache for ~/.gradle/jdks (perhaps under a different cache-key?) in addition to .gradle/caches, .gradle/wrapper and gradle-wrapper.properties would avoid the unnecessary step of:

- name: Setup gradle JDK cache
  uses: actions/cache@v2
  with:
    path: ~/.gradle/jdks
    key: gradle-${{ runner.os }}-jdks

Justification:
Many of us have complicated multi-module builds targeting different JDK versions. For this Gradle supports toolchains that manages and downloads JDKs on demand if the required JDK versions are not found on the path. Using cache for JDKs as well is important to reduce built times. Also note that relying on matrix jobs isn't always an option and also not reproductible when doing local development builds.

Activity

  1. dmitry-shibanov commented on Dec 23, 2021

    @dmitry-shibanov
    Contributor

    Hello @alsutton. Sorry for the late response. We'll investigate the issue.

  2. dmitry-shibanov commented on May 24, 2022

    @dmitry-shibanov
    Contributor

    Hello @devminded. We would not like to implement such kind of logic, because the initial caching logic for setup-java should cover the most often use cases. If you want to use some more complex caching logic we would recommend you to use actions/cache. It's relevant to setup-node ADR.

    For now I'm closing the issue.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestNew feature or request to improve the current logic

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions