-
Notifications
You must be signed in to change notification settings - Fork 70
Atomicfu Js/Ir compiler plugin supported in the gradle plugin #215
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
Conversation
d0554a2
to
2fd0ad2
Compare
@mvicsokolova just for curiosity, what is the main difference between JS and IR variants? |
Hi, @olme04! Whereas, for |
Atomicfu compiler plugin for Kotlin/JS IR backend will be supported since Kotlin |
@mvicsokolova, thx for the answer! |
2fd0ad2
to
9bdc603
Compare
9bdc603
to
33317bb
Compare
33317bb
to
173220b
Compare
c008910
to
4cebe94
Compare
// apply the compiler plugin, if IR transformation should be applied to KotlinJsIrTarget compilations | ||
plugins.apply(AtomicfuKotlinGradleSubplugin::class.java) | ||
} | ||
plugins.apply(AtomicfuKotlinGradleSubplugin::class.java) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’ve figured, that we can only obtain values passed to the atomic {}
extension after project evaluation, though jsVariant
option was supposed to define whether to apply the compiler plugin (AtomicfuKotlinGradleSubplugin
) and compiler plugin should be applied before project evaluation is completed.
For now, compiler plugin is applied by default.
Maybe there is some other way to create a user flag, that can be resolved before the project is evaluated?
val pluginVersion = rootProject.buildscript.configurations.findByName("classpath") | ||
?.allDependencies?.find { it.name == "atomicfu-gradle-plugin" }?.version | ||
extensions.add(EXTENSION_NAME, AtomicFUPluginExtension(pluginVersion)) | ||
if (rootProject.findProperty(ENABLE_IR_TRANSFORMATION).toString().toBoolean()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You probably need toBooleanStrict
here to prevent typos coercing into false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gradle seems to force stdlib version to 1.4, the same as bundled in it's runtime. So using toBooleanStrict()
fails with unresolved reference. And forcing stdlib version in atomicfu-gradle-plugin
does not help. Maybe we should update gradle version?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe it's safer to copy-paster toBooleanStrict
implementation here
atomicfu-gradle-plugin/src/main/kotlin/kotlinx/atomicfu/plugin/gradle/AtomicFUGradlePlugin.kt
Show resolved
Hide resolved
Co-authored-by: Vsevolod Tolstopyatov <qwwdfsad@gmail.com>
Co-authored-by: Vsevolod Tolstopyatov <qwwdfsad@gmail.com>
80b75a3
to
a2b3270
Compare
a2b3270
to
4fc4d1e
Compare
AtomicfuGradlePlugin
.atomicfu-gradle-plugin
test projects are ignored for a while. I'm going to create a PR with new test projects soon.1.7.0-dev-565
, built from the1.6.20-M1-release branch