Does anyone know if it's possible for multiplatfor...
# library-development
e
Does anyone know if it's possible for multiplatform libraries to work w/ maven without requiring users to explicitly depend on the
-jvm
artifact? It seems to me that both Arrow and Kotlinx.serialization have somehow resolved this.
a
e
Thanks Adam! I'll check if we can apply that in Kotest too. If anyone from JB stumbles upon this, would it make sense to make this the default behaviour when packaging multiplatform publications? It seems to be an annoying gotcha that Maven users always stumble into when using multiplatform libraries.. See https://github.com/kotest/kotest/pull/3858
a
I have a vague memory that the reason that Coroutines and Serialization have this hack is because they predate the -jvm suffix convention, and so they retained it to maintain backwards compatibility when the -jvm suffix was introduced. Adding the -jvm suffix is the planned default for Maven-based resolution
personally I'd rather tell all non-Gradle users to use -jvm than risk hacking around with Gradle 🙃
1
e
Then I think it would make sense to add a section regarding multiplatform dependencies on https://kotlinlang.org/docs/maven.html 🙂
Either way I sort of like the rewrite hack.. It makes sense not to surprise users, and it is kinda hard to tell if a library is JVM-only or multiplatform at first glance.
a
good idea for a YouTrack issue :) https://kotl.in/issue
and yeah it's pretty clever
and it helps out Kotlin scripting too, because it uses Maven coordinates
apparently the Gradle artifact resolution logic is too embedded and can't be split out to be used standalone, which is a shame
e
Published a YT issue
👍 2
m
I opened that one some time ago. Would be really nice to have