How to publish multi-platform libraries?


#1

Hey, I’m working on an isomorphic web framework for Kotlin. Can somebody point me to any docs which describe how to publish libraries for multi-platform projects? The only docs I’ve found describe the process of publishing libraries targeting JVM.


#2

I don’t know about any docs and I have not published multiplatform projects myself but I am pretty sure you do it just the way you publish for JVM. You just need to publish each of your gradle projects (common, jvm, js).

You could also take a look at the build files for some of the kotlin internal projects. The of kotlinx.serialization seems to be easy to understand: https://github.com/Kotlin/kotlinx.serialization/blob/master/build.gradle


#3

Thanks! I’ll take a look at it.


#4

Here’s one of my projects that I publish for multiple platforms: https://github.com/cretz/pb-and-k (see the runtime sub project). It doesn’t include a Kotlin Native version though one is planned (sorry, JetBrains doesn’t make it easy to develop for all 3 platforms in the same IDE).


#5

Thanks @cretz!