Reputation: 340
I have a Kotlin Multiplatform project that targets both Jvm and Android.
Creating separate javafx and android sample projects, but for my javafx module when I add the dependency for my multiplatform module, it is importing the -android
variant.
// sample-javafx build.gradle.kts
plugins {
kotlin("jvm")
// javafx plugins
id("application")
}
// gradle stuff...
dependencies {
// this imports the -android variant
implementation(project("my-multiplatform-module"))
}
For example, when importing a published multiplatform library you can specify the -jvm
variant, like:
// build.gradle.kts
dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.6.0")
}
How can I configure the dependency for my javafx sample to import the -jvm
variant of my kmp library project module?
Upvotes: 1
Views: 1093
Reputation: 7700
My wild guess is that in this case the multiplatform library is not exposing a jvm artifact explicitly, this could be a potential feature request
Alternatively you could try publishToMavenLocal()
and consume it from local maven
Upvotes: 1