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

steenooo

11/20/2019, 12:08 PM
is it possible to have multiple multiplatform uhm... implementations that all target the same jvm version? But differ in implementation (fx for reusing code between plugins for different apps)
k

kpgalligan

11/20/2019, 12:11 PM
I guess you could, but would have trouble with dependency resolution. Why not just different gradle modules like “old school” java?
s

steenooo

11/20/2019, 12:13 PM
Is it possible to use expect/actual with that? I could use a simple interface for this. But I’d rather, if possible use actual/expect, to keep the common code platform agnostic, but dont keep an mutable instance of the interface
k

kpgalligan

11/20/2019, 12:15 PM
Between layers? Probably not. I don’t know what you’re doing, but I’d generally advise interfaces over expect/actual anyway. https://vimeo.com/371460823 I’m not sure what you mean by interfaces being less “platform agnostic”. If it has to be expect/actual, I think you’d need multiple jvm versions, or some other mechanism (like an init arg to switch between them at runtime). Not sure how you’d do multiple versions.