You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The existing kotlinx.coroutines Gradle config does not currently follow Gradle best practices and so this might cause issues. It could do with a big ol' refactor
The text was updated successfully, but these errors were encountered:
Setting a Gradle Toolchain is not compatible with setting Java source/target compatibility
Could you please elaborate on what it means in detail? I would expect setting toolchain to 8 to be more or less identical to having source/target compatibility being 8 as well.
Refactoring of scripts is welcome, but it might bring quite a lot of trouble. For various reasons, both its structure and artifacts layout are quite non-standard and consist of tweaks that might be already unneeded (as coroutines were one of the earliest adopters of MPP and HMPP plugins)
Could you please elaborate on what it means in detail? I would expect setting toolchain to 8 to be more or less identical to having source/target compatibility being 8 as well.
org.gradle.api.InvalidUserDataException: The new Java toolchain feature cannot be used at the project level in combination with source and/or target compatibility
Instead it would have to be
plugins {
kotlin("jvm") version "1.8.10"
}
kotlin {
jvmToolchain(8)
}
What do we have now?
The Gradle config adds a hard dependency on JVM 11
kotlinx.coroutines/buildSrc/src/main/kotlin/jdk-convention.gradle.kts
Lines 7 to 14 in 4116d4a
This caused an error in the Dokka integration tests when Dokka migrated to use Gradle Toolchains.
What should be instead?
Gradle introduced Java Toolchains in version 6.7. This will automatically detect and configure a compatible Java version.
https://github.com/Kotlin/dokka/blob/14c05d70b52814fe48e930b3f61fed5e8586718c/buildSrc/src/main/kotlin/org/jetbrains/conventions/base-java.gradle.kts
Why?
https://docs.gradle.org/current/userguide/toolchains.html
Why not?
kotlinx.coroutines/buildSrc/src/main/kotlin/kotlin-jvm-conventions.gradle.kts
Lines 13 to 16 in 4116d4a
The text was updated successfully, but these errors were encountered: