This message was deleted.
# community-support
s
This message was deleted.
e
it's overwritten by kotlinDslPluginOptions because Gradle plugins are expected to target 8 like the rest of Gradle
s
Aha, that makes sense. I am guessing I don’t even need to target 11 here, since this is part of a module which holds some convention plugins. But was changed as we changed everything else after following the android docs to move to java 11. Does that mean for such gradle files which are
kotlin-dsl
one shouldn’t really change the java source/target compatibility and the KotlinCompile jvmTarget? Treading on waters I am really not familiar with over here. Maybe a bit unrelated, but for a full Kotlin project, I wonder if this is even something one would want to do over just using 8 still. I wonder if there’s any section explaining that.
e
usually any
kotlin-dsl
projects would be in a separate build (possibly
includeBuild
) than your Android projects anyway
it is possible to create Gradle plugins that target newer JVMs if you're ok with limiting which Java environments can be used to run the consuming build beyond Gradle's limitations
so you could
kotlinDslPluginOptions { jvmTarget.set("11") }
. but unless there's a good reason to, I'd just leave the target at 1.8 for all Gradle-related code. it's fine to do that and bump to 11 for projects that target Android or the host
s
Yes this one is in fact a
includeBuild("build-logic")
, similarly to how now in Android is doing it, I am playing around with convention plugins to learn. What you are saying makes the most sense, I don’t have a reason why I’d want to target 11 anyway aside from “we’re targeting 11 everything else so I thought I’d do the same here”, but I now understand how it does not apply in this particular case and why I am just not going to do that, thanks a lot! Back to my side-track before, do you know of any references I can read about what it even means to target java 11 for a Kotlin only project? I couldn’t find any docs regarding that while searching. If not no problem 🙌
e
as far as I am aware, the only features Kotlin uses above Java 8 are indy lambdas and string concatenation, https://youtrack.jetbrains.com/issue/KT-45375 https://youtrack.jetbrains.com/issue/KT-42522
thank you 1
(if your Android minSdk is below API 26, D8 is going to desugar all those invokedynamics into pre-indy code anyway)
til 1
s
Alright, so in general not even that much of a gain to target 11. I guess it doesn’t hurt to keep it that way since we’ve already set it up like that, good to know!