Closed mvicsokolova closed 2 months ago
The last commit suggests an alternative solution to the problem of 2 atomicfu gradle plugins (#370):
the logic of the gradle plugin from the Kotlin repo (org.jetbrains.kotlinx.atomicfu.gradle.AtomicfuKotlinGradleSubplugin
) that applies atomicfu compiler plugin transformations may be moved to the library starting from Kotlin 1.9.0.
It's possible because the sources of the compiler plugin are being published since Kotlin 1.9.0: kotlin-atomicfu-compiler-plugin-embeddable
This will solve the problem of Kotlin version resolution "before" kotlinx-atomicfu
plugin application.
The current solution works in overall, but still has several issues to be solved:
kotlin.native.version
may be overriden by a user and differ from the KGP version, the Native part of the compiler plugin should be applied with kotlin version equal tokotlin.native.version
. For now, the Native part of the compiler plugin is separated from the JVM and JS parts but kotlin.native.version
is not extracted.atomicfu-gradle-plugin
we extract KGP version. Though there is no public API for that yet (I'll attach the issue here).kotlinx-atomicfu
is applied to the project that uses Kotlin version older than 1.9.0As the problems 1 and 2 are not critical now, and there were no actual user cases of version difference, I think it's reasonable to postpone their solution (#408) until we have public API to retrieve Kotlin compiler and Kotlin native compiler versions. Here is the corresponding ticket: KT-66384.
I'll remove the separation of JVM/JS and Native compiler plugins and use KGP version to get the compiler plugin artifact, as it was done before.
This is a reproducer for the problem #399
According to our last solution (https://github.com/Kotlin/kotlinx-atomicfu/pull/386),
atomicfu-gradle-plugin
provides a transitive atomicfu compiler plugin dependency and relies on the gradle version resolution. So, we provide compiler plugin with the lowest version and expect it to be resolved into the highest version present on the user's classpath.But this does not work for the project configuration presented in this PR. This is a minimized version of an MPP project created by a MPP Wizard, which uses
libs.versions.toml
file as a version catalog.How to reproduce the failure:
The build will fail with the error:
NOTE: if contents of
compiler-plugin-resolution-bug/build.gradle.kts
are removed, the build completes successfully: