Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Decouple JDK running Gradle from JDK building project
Gradle will by default use the same JDK for building the project as it does for running Gradle. Newer JDKs are assumed to be more performant, contain fewer bugs and to come with desirable features that we would like to utilize in our build, but doing so should not endanger backwards compatibility for the plugin itself. We can do that now by utilizing Gradle toolchains, which allows us to use one JDK/JRE for running Gradle and the other for building the project, i.e. executing `javac`. Doing this requires us to make multiple JDKs available to the Gradle build action for each individual execution of the build. The setup-java action doesn't support this at the moment, and the multiple build steps configured for actions/setup-java in this commit is at best a workaround for this, and at worst a bad assumption with respect to no environment variables or other settings being overwritten. Also, there's no handling of duplicate invocations of the action with the end result being duplicate JDKs installed. Hopefully both actions/setup-java and gradle/gradle-build-action will handle this case gracefully. For more details, see: - actions/setup-java#44 - gradle/gradle#14903
- Loading branch information