Closed joffrey-bion closed 1 year ago
Current plan - support multiplatform
plugin only.
Please use multiplatform
plugin instead of js
.
I don't understand. This project is meant to help with Kotlin wrapper projects for Kotlin JS. Why focus on the multiplatform plugin if the main consumers are js-only projects?
Do you mean that as a general rule we should prefer using the Kotlin Multiplatform Gradle plugin over the Kotlin JS Gradle plugin, even for projects that only target the JS platform?
Got my answer here: https://kotlinlang.org/docs/multiplatform-compatibility-guide.html#migration-from-kotlin-js-gradle-plugin-to-kotlin-multiplatform-gradle-plugin
So yes, we're supposed to use the kotlin-multiplatform
plugin only now.
It seems that the Karakum Gradle plugin assumes the Kotlin multiplatform plugin is applied. In my project where I apply
kotlin("js")
, I'm getting the following:This is due to this line: https://github.com/karakum-team/karakum/blob/master/gradle-plugin/karakum-gradle-plugin/src/main/kotlin/io/github/sgrishchenko/karakum/gradle/plugin/tasks/Tasks.kt#L14
I think it should be modified to get the Kotlin JS compilation from either the MPP plugin or the K/JS plugin depending on which one is present.
Also, note that this is called during the constructor of the
KarakumGenerate
task, which might cause problems with plugin application ordering (this forces users to apply the Kotlin MPP plugin before the Karakum plugin). It would be best to configure the Karakum plugin using conventions and plugin application "reaction" blocks likewithPlugin
.