i use listOf, arrayListOf, mutableListOf, etc. to ...
# multiplatform
k
i use listOf, arrayListOf, mutableListOf, etc. to define lists that work on all 3 targets
s
kyonifer: What stdlib are you using, and what plugin for your multi platform module? How are you compiling to the different targets? Could you describe your setup?
k
The project is here: https://github.com/kyonifer/koma. I'm using gradle to target all 3. You can build on js with
./gradlew build -Ptarget=js
and native with
./gradlew build -Ptarget=native
, and
./gradlew build
for jvm. I only depend on the kotlin stdlib (and libm.so on native for some basic math stuff).
im using all 3 gradle plugins to target each platform respectively and using settings.gradle to configure the one im using for that language. check out
buildscripts/
folder, you'll see theres one per target
s
thanks for the sample. I'll look at this closely.
k
no problem. i've also got pluggable backends that only work on this or that platform, but you can just look at
core/
(which builds on all 3)
the pieces that turned out to be platform specific in core i put in target specific folders, e.g.
core/srcjvm
and
core/srcjs
, which are conditionally compiled by the respective build script
hopefully the new module stuff they are working on will get rid of that last bit...
👍 1
s
What new module stuff they are working on?
k
see above in channel, the message from Kiran Rao. they're working a header/implementation type deal where stuff thats platform specific is an implementation of a common header