https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
p

pajatopmr

12/13/2018, 7:41 PM
When adding dependency information for using a multiplatform library, the platform targets are pretty obvious, e.g.
implementation "<http://com.pajato.io:KFile-jvm:0.0.1|com.pajato.io:KFile-jvm:0.0.1>"
or
implementation "<http://com.pajato.io:KFile-native:0.0.1|com.pajato.io:KFile-native:0.0.1>"
but how should
common
dependencies be written:
implementation "<http://com.pajato.io:KFile:0.0.1|com.pajato.io:KFile:0.0.1>"
or
implementation "<http://com.pajato.io:KFile-metadata:0.0.1|com.pajato.io:KFile-metadata:0.0.1>"
?
I tried both and each seems to work but I’m guessing that there is a clear preference by design.
c

coletz

12/13/2018, 7:43 PM
afaik common dependencies has the -common suffix
for example:
org.jetbrains.kotlin:kotlin-stdlib-common
,
org.jetbrains.kotlinx:kotlinx-coroutines-core-common
p

pajatopmr

12/13/2018, 8:46 PM
Hmmm. That’s interesting. I used maven-publish to get the four artifacts I see on Maven Central, one with no suffix and the other three having -metadata, -jvm and -native suffixes. Perhaps a JB or Gradle guru might comment. @olonho
s

serebit

12/13/2018, 10:12 PM
If I’m not mistaken, the
KFile
dependency auto-populates the other platform dependencies if GRADLE_METADATA is enabled. If specifying platform dependencies manually, then you should use the
-metadata
artifact instead.
2 Views