-
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 specifying the Java toolchain for invoking R8 #9
Comments
Good callout 👍 . Any idea what options to expose override this? I guess it should take a path? gr8 {
javaHome.set("path/to/java/home")
} |
ideally should expose setting the toolchain launcher itself, while defaulting to the https://docs.gradle.org/current/userguide/toolchains.html#sec:plugins that way if someone does something like java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
vendor.set(JvmVendorSpec.AZUL)
}
} you can get that toolchain picked up automatically. If you have a val javaHome = launcher.get().executablePath.asFile.parentFile.parentFile |
Thanks that sounds perfect 👍 Do we want to be able to run R8 using e.g. Java 20 while still passing it Java 11 runtime jars? That'd save launching a new JVM if your main build is using 20. But maybe it's not worth it? |
I forked the task (only needed a handy R8 invoke task :)), that's exactly what I'm doing (invoking on Gradle the JVM Gradle is running on) while runtime jars are passed in from the launcher. I guess it would make sense to name it differently or actually use it for launching? For invoking afaik the Worker APIs had nice facilities to create isolated tasks that run on a different JVM. |
Nice. I think that's a good default, no need to downgrade the JVM just to get the runtime jars. |
I can make a PR for this later in the evening today |
Awesome, thanks! |
Closed with #16 |
It would be awesome if this:
https://docs.gradle.org/current/userguide/toolchains.html#sec:plugins
There's a comment in
Gr8Task
as well that this could be helpful -gr8/plugin-common/src/main/kotlin/com/gradleup/gr8/Gr8Task.kt
Line 86 in c1a4086
The text was updated successfully, but these errors were encountered: