-
Notifications
You must be signed in to change notification settings - Fork 61
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
The problem of 2 atomicfu gradle plugins #370
Comments
* Atomicfu compiler plugin should be manually added to the classpath by the user, otherwise the error is thrown by the plugin * All kotlin-stdlib transitive dependencies are removed This commit is part of the solution to the problem described in #370
* Atomicfu compiler plugin should be manually added to the classpath by the user, otherwise the error is thrown by the plugin * All kotlin-stdlib transitive dependencies are removed This commit is part of the solution to the problem described in #370
* Atomicfu compiler plugin should be manually added to the classpath by the user, otherwise the error is thrown by the plugin * All kotlin-stdlib transitive dependencies are removed * Old atomicfu-gradle-plugin tests are removed, as they are now replaced with integration tests This commit is part of the solution to the problem described in #370
I see 2 possible options to address this problem:
1 Solution. Remove the compiler plugin from kotlin repo and stick to the gradle plugin: Pros:
Cons:
2 Solution. Remove the gradle plugin and migrate all the logic to the compiler plugin: Pros:
Cons:
After these thoughts I decided to stick to the 2 solution, and the migration plan may be as follows:
plugins {
kotlin("jvm") version "1.9.21"
kotlin("plugin.atomicfu“) version "1.9.21"
}
atomicfu {
isJsIrTransformationEnabled = false
isJvmIrTransformationEnabled = true
isNativeIrTransformationEnabled = true
}
// if necessary and the transformation is disabled users provide a runtime dependency to atomicfu
dependencies {
implementation "org.jetbrains.kotlinx:atomicfu:0.25.0"
}
🤔 |
After some discussion, it was decided to postpone moving The reason is that we’ll get into the situation when 2 different entities are deprecated simultaneously: To avoid a situation, when a new non-stable solution is proposed as default and the old one already is deprecated, it's decided to keep up with this plan:
To pay attention 👀:
Regarding the problem that this solution was initially supposed to solve:
may be resolved with a warning message in case the wrong plugin is applied.
should already be resolved with gradle version resolution in favor of the newer version present on the classpath (#386), though some problems are still present (#399). |
Hello, thank you for these updates. Can you please clarify in a few words, which |
For now,
And then |
…ary starting from Kotlin 1.9.0 Fixes #370
There are 2 atomicfu gradle plugins:
kotlinx.atomicfu:atomicfu-gradle-plugin
provided by the library andkotlin:atomicfu
compiler plugin, the latter is not supposed to be applied directly and is applied by theatomicfu-gradle-plugin
.They not only create confusion among users but also serve as the cause of an important issue:
atomicfu-gradle-plugin
, when applied to the user project, should apply compiler plugin of the kotlin version used in the user project, not the kotlin version that was used to buildatomicfu-gradle-plugin
itself. That is not the case currently.The reason: compiler plugin is found in the classpath of the user project, because it is stated as the implementation dependency of the
atomicfu-gradle-plugin
and hence leaks into the user project transitively, though with the kotlin version used in kotlinx.atomicfu.The fast solution: for now the behaviour is correct when kotlin versions used in a user project and kotlinx.atomicfu are equal. Otherwise,
atomicfu-gradle-plugin
should ask a user to add the compiler plugin with the kotlin version used in the project directly:The right solution: getting rid of the gradle plugin on the side of the compiler and leaving only one gradle plugin in the library may help. To be further investigated.
The text was updated successfully, but these errors were encountered: