FYI <Gradle 9.0.0-M9> is now published. It include...
# gradle
o
FYI Gradle 9.0.0-M9 is now published. It includes updates to Kotlin 2 and the K2 Compiler, as well as bumping to Java 17 as a minimum version, and most of the deprecation removals. Testers and any feedback are welcome! More about the upcoming Gradle 9 release: https://gradle.org/whats-new/gradle-9/
👀 1
🎉 10
gradle intensifies 17
s
Does Kotlin Multiplatform build work correctly with Gradle 9.0? In a sample project I tested, some tasks produced the following error (regardless of whether the configuration cache was used). For wasm target,
Copy code
* What went wrong:
Configuration cache state could not be cached: field `__packageJsonFiles__` of task `:wasmRootPackageJson` of type `org.jetbrains.kotlin.gradle.targets.js.npm.tasks.RootPackageJsonTask`: error writing value of type 'org.gradle.api.internal.provider.DefaultListProperty'
> Resolution of the configuration ':web:wasmJsNpmAggregated' was attempted without an exclusive lock. This is unsafe and not allowed.
@tapchicoma do you have any info on 9.0 support?
h
IMHO the whole JS Gradle stuff should be revisited to not use the root project as value storage and a global lock file but a sourceSet/compilation per project based lockfile like you can in Java. And setting up the repositories in the settings file is complex.
t
We are planning to improve some JS parts later this year - mostly for isolated project feature support. But this will require redoing npm dependencies integration.
@tapchicoma do you have any info on 9.0 support?
Kotlin/JVM 2.1.21 should work with Gradle 9.0. Kotlin/KMP 2.1.21 has some issues which we are planning to address either in 2.2.10 or 2.2.20 releases.
👍 2
Update: KMP in general should also work fine with Gradle 9.0 if
kotlin.kmp.isolated-projects.support
is enabled (default is enabled)
h
Yeah, but Gradle isolated project won't work with Kotlin/JS due to https://github.com/gradle/gradle/issues/30745#issuecomment-2932529079
t
This mode is also enabled if isolated projects are not enabled. It changes how KMP works with intra-projects dependencies
s
This mode is also enabled if isolated projects are not enabled.
org.gradle.unsafe.isolated-projects=false
in my project, but still getting the same error for kotlin/js, wasm targets.