Marin Tolić
01/15/2022, 9:56 PMZach Klippenstein (he/him) [MOD]
01/16/2022, 3:34 AMspierce7
01/16/2022, 6:01 AMMichael Paus
01/16/2022, 10:25 AMMarin Tolić
01/16/2022, 8:12 PMBrian Guertin
01/16/2022, 10:28 PMspierce7
01/16/2022, 10:46 PMSo if I’m reading you correctly, I’m still supposed to have 3 different librariesSo I’d make sure you have a good understanding of how Kotlin Multiplatform libraries work. You should be able to create a single Kotlin multiplatform Gradle moudle with most, if not all of the code in the
commonMain
directory.
Anything inside of commonMain
is compiled to any target platform. Theoretically when all this is released, you’ll be able to target android
`jvm`(desktop), ios
, tvos
, and `js`(browser). Any code in commonMain
should easily compile to all those targets with little modification.spierce7
01/16/2022, 10:49 PMandroid
and jvm
and share code between them via commonMain
source set.
When you publish the results to a maven repository, Kotlin Multiplatform will automatically handle creating the different artifacts of <your lib>-android
<your lib>-jvm
, and when you add more targets it will automatically add the others as well. It’s a very convenient system.
Then when people use your lib, you can point them to your <your lib>
artifact, and based on their targets, it will automatically pull in the correct platform artifacts.spierce7
01/16/2022, 10:50 PMMarin Tolić
01/16/2022, 11:36 PMGreg Steckman
04/14/2022, 2:35 PM