patjackson52
11/06/2018, 1:16 PMh0tk3y
11/06/2018, 8:26 PMFor scenario #1 can we simply publish a jar to maven in the typical way without any target deps and have that work in a MPP project?No, it's not possible at the moment. The Kotlin platform binary compiler implementations require their dependencies to be available in the same binary format, e.g. JVM class files for Kotlin/JVM, JS code for Kotlin/JS. So publishing even a library that shares all of its sources between all platforms requires all of the platform artifacts to be published as well (which implies that the library author must define the set of platforms to target).
h0tk3y
11/06/2018, 8:28 PMkotlin-multiplatform
plugins already supports publishing with maven-publish
out-of-the-box, so that all of the platform implementations are published together. With Gradle module metadata enabled (experimental feature, see http://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#experimental-metadata-publishing-mode), this will work for consumers as if it's a single publication.h0tk3y
11/06/2018, 8:29 PMCurious, does the kotlin compile to native with a jar file?The Kotlin/Native libraries are packed into
*.klib
files. Those are basically ZIP archives, too, but their structure is different from that of conventional JARs.h0tk3y
11/06/2018, 8:32 PMdoes the compiler take class files and then transform them into IR before compiling into native?No, it does not do that. Kotlin/Native compiles the sources directly into
*.klib
and/or native binaries.patjackson52
11/07/2018, 12:26 PMpatjackson52
11/07/2018, 12:50 PM