Open StefMa opened 8 months ago
Thanks, @StefMa, for submitting this PR! I'll need to look closer at the gradle docs. But at first glance, this seems like a valid and useful addition.
Hey @hartmut-co-uk, any chance to have a look at this?
So the data volumes written and read from cache is higher, also the JDK is downloaded with each and every workflow run.
I don't get this π€ Is it now downloaded or is it written into the cache? Or is it written to cache but additionally downloaded? π±
Normally, it should write it to the cache but not downloading again (but fetched from cache).
I'm not that familiar with the gradle/actions/setup-gradle
action.
However, I guess it should handle the jdk toolchain cache correctly π€
β Type of change
π Description, Motivation and Context
This PR moves the JVM Version selection from the machine to the build time. With that change, Gradle makes sure that the code will be compiled with the configured JVM ersion (21) from the configured vendor (Corretto/Amazon). There is "no need" to install a specific JVM version on CI or your dev machine. You only need "a" JVM installation that can start Gradle. Gradle will detect that the configuration say it should compile the code with Java 21/Corretto, it will install the respective toolchain and use that to compile the code and run tests with that.
More information can also be found here: https://docs.gradle.org/8.6/userguide/toolchains.html
π§ͺ How Has This Been Tested?
Remove your locally installed JVM version (21/Corretto). Then use another JVM version and kick of Gradle (
./gradlew check
). Wihin the configuration phase you will see an output like this: Indicating that the requested toolchain (was donwloaded) and now installing on the machine for later usage.π Checklist