Hi I've been doing Java for a few years now and f...
# multiplatform
c
Hi I've been doing Java for a few years now and fell in love with Kotlin this summer. To continue my training I'd like to begin a project in Kotlin Multiplatform as a personal proof of concept. The idea is to have an API that is an abstraction around JSON in general, and in which each platform can delegate to an existing JSON API (I don't want to reinvent the wheel, I just want a common interface). I have read the main articles about Multiplatform, but there are a few things I don't understand. What is the type of the artifacts of the common module? In JVM the artifacts are JARs and are published to MavenCentral. In the JS world it's not possible to use JARs as dependencies... So what does the common project generates? As far as I know there isn't a Kotlin specific type of artifact?
k
the common components don't have targets. they're included in the platform specific targets
j
@CLOVIS If you'd like to know the details of how the multiplatform artifacts work, you can go take a look in existing repositories like ktor's (http://central.maven.org/maven2/io/ktor/). If you look in a common module's artifact, you'll see that it actually has JARs too, it's just that instead of containing
.java
files they contain
.kotlin_metadata
files.
n
Kotlin-specific type of artifact you could be dealing with is
klib
.