https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
d

darkmoon_uk

02/25/2019, 2:48 AM
I want to build a multi-platform library with separate platform-specific source-sets for Android Mobile and JavaFX Desktop. Since both of these would fall under the default
jvmMain
source set - I'm assuming I want to define additional JVM targets to separate the Android/JavaFX dependencies (e.g.
androidMain
and
javafxMain
and avoid using
jvmMain
to avoid ambiguity) ? Can anyone confirm this the way to go + any caveats/suggestions?
r

russhwolf

02/25/2019, 3:36 AM
Typically you’d use an
android
target rather than a
jvm
one for your Android sources
👍 1
g

GarouDan

02/25/2019, 12:11 PM
Yes, in this case, you can use an jvm and android targets. But, if you need to use the jvm target twice you will need to disambiguate this in the consumer and producer sides. I asked something like these some time ago on this stackoverflow link: https://stackoverflow.com/questions/54503916/is-it-possible-to-create-a-kotlin-multiplatform-project-referencing-the-correct If you want, you can have, for your purpose, jvm(“desktop”), android as targets and commonMain, commonTest, jvmMain, jvmTest, desktopMain, desktopTest, androidMain, androidTest source sets if you want to. In this case you can use deppendsOn relation
👌 1
2 Views