Closed mustafaozhan closed 11 months ago
This is an interesting idea, but I'm not sure it's easy to do or even necessary.
In general, there are 2 reasons that you might want to use setup-java
to configure a JDK.
I suspect that in the vast majority of cases, it's the second reason that's driving the use of setup-java
. But Gradle offers a better way to do this: specify the Java Toolchain version in your build logic. Java Toolchains tell Gradle which JDK to use for compiling sources and executing tests, and are supported by core Gradle plugins, as well as AGP and KGP.
So before adding any sort of java-version
support to the gradle-build-action
, I'd rather first address #561, and encourage users to leverage Java Toolchains to control the JDK for their build.
After that, we should consider if it's often necessary to use setup-java
at all, or if Gradle can run effectively on the default Java installed on each GitHub Actions runner.
We don't plan to add setup-java
functionality to this action.
I was wondering if we can put java setup into
gradle-build-action
with an extra parameter. I don't know if it is possible according to GitHub action rules and limitations.So currently, people with Java/Kotlin & Android world has to do this:
But If we could add a parameter to
gradle-build-action
iejava-version: X
and when this is appliedgradle-build-action
can apply theactions/setup-java@v3
under the hood.This will allow us having less lines of codes in GitHub Action yml files.