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

dazza5000

10/30/2020, 5:35 PM
is there a plan to support android + jvm targets at the same time - noticed this in the kotlin mp docs
Copy code
We don't currently support sharing a source set for these combinations:

    Several JVM targets
    JVM + Android targets
    Several JS targets
b

Big Chungus

10/30/2020, 5:38 PM
sharing != depending on. so even now you can have androidMain & jvmMain depend on jvmishMain
❤️ 1
d

dazza5000

10/30/2020, 5:38 PM
I ask because im trying to target android and then use jvm to target desktop - but maybe it would be better to use native to target desktop
ahhhh
i get it now
thank you
b

Big Chungus

10/30/2020, 5:40 PM
That text refers to the new commonizer tool for K/N which allows compiling a single sourceSet to multiple native targets.
k

Kris Wong

10/30/2020, 5:42 PM
⏸️ Sharing code between JVM and Android •
a

andylamax

10/30/2020, 6:01 PM
you can have android and jvm target in one project
You can have several JVM targets You can have JVM and Android targets You can have Several JS targets What you can't have is more than one Android Target
k

Kris Wong

10/30/2020, 6:05 PM
and you can't share source sets between Android and JVM
b

Big Chungus

10/30/2020, 6:05 PM
Wait what? @Kris Wong?
You mean if you have android and jvm targets commonMain breaks?
k

Kris Wong

10/30/2020, 6:06 PM
see first message in this thread
a

andylamax

10/30/2020, 6:06 PM
You can share Source Sets, Just last time I checked, IDE wen't bizarre when you did. But gradle couls compile well
something in the lines of commonMain, allJvmMain, androidMain, jvmMain allJvmMain would depend on commonMain, while androidMain and jvmMain would each depend on allJvmMain
t

travis

10/30/2020, 9:37 PM
I think this is the related ticket: https://youtrack.jetbrains.com/issue/KT-42466 Probably worth voting up?