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

napperley

12/23/2019, 9:39 PM
Does Kotlin Multiplatform have a way to share code between multiple Platform modules (eg linuxX64, linuxARMV7) where the OS (eg Linux) is the same?
i

ian.shaun.thomas

12/23/2019, 9:44 PM
yes you can create shared source sets that top level source sets depend on much like common is a predefined source set for all targets
in the 2nd example those show a
desktopTest
source set that is depended on by min and linux test targets
d

Dominaezzz

12/24/2019, 11:03 AM
Small Tip: Don't be fooled by the IDE saying no. It will build just fine. There are workarounds to make the IDE happy.
h

h0tk3y

12/24/2019, 3:24 PM
We are working on proper support for the IDE that requires no workarounds and reusing declarations from a library’s shared platform-specific source set of this kind. Stay tuned!
🎉 6
💯 1
d

Dominaezzz

12/24/2019, 3:25 PM
Woo! \o/
n

napperley

12/24/2019, 9:24 PM
If i'm reading this correctly there is a single source set used (part of a Platform module) that the other source sets (part of Platform modules) depend on for shared platform logic. This doesn't sound logical from the onset.