-
Notifications
You must be signed in to change notification settings - Fork 6
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
add support for Java toolchains #16
Conversation
plugin-common/src/main/kotlin/com/gradleup/gr8/Gr8Configurator.kt
Outdated
Show resolved
Hide resolved
Very cool, thanks 👍 ! In the current state, usage should look like this, right? gr8 {
create("relocated") {
toolchain(java.toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
})
}
} Would it be possible to use a more java-like way to set it like so? gr8 {
create("relocated") {
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
}
}
}
I think this is fine. Users can stay on older version if really needed but I would expect most Gradle plugin developers to use more recent versions of Gradle. |
hm, I checked the docs and a better way is actually to ask for Launcher (or in this case Compiler) specifically: https://docs.gradle.org/current/userguide/toolchains.html#toolchains_for_tasks invoking gr8 {
create("relocated") {
toolchain(javaToolchains.compilerFor {
languageVersion.set(JavaLanguageVersion.of(11))
})
}
} and a convenience method that takes the gr8 {
create("relocated") {
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
}
}
} Looking at your comment we could easily hide the former and expose the latter. one thing that slightly bugs me here, the name |
Right, makes sense 👍
Agreed, this is better 👍 |
@madisp any objection to merging this as is? The plugin is still pre-1.0 so we can always change later and this is a nice change to ship |
@martinbonnin no objections now :D I updated to use the Added a note at the end of the |
Thanks for the quick turnaround ! |
Add support for specifying the Java toolchain to use for the R8 invoke.
The
JAVA_HOME
of the specified toolchain will be passed in to the R8 invoke as library jars. If notoolchain
is specified then the default one from Java plugin extension is used.NOTE: requires bumping Gradle api to 6.7, potentially breaking change for downstream consumers?