Hello KMP aficionados, I’d like to better understa...
# multiplatform
h
Hello KMP aficionados, I’d like to better understand KMP packages like
Copy code
sarif4k/                                                         -         -
sarif4k-jvm/                                                     -         -
sarif4k-linuxarm64/                                              -         -
sarif4k-linuxx64/                                                -         -
sarif4k-macosarm64/                                              -         -
sarif4k-macosx64/                                                -         -
sarif4k-mingwx64/                                                -         -
Is
sarif4k
what in JVM we’d call a
-parent
package? It doesn’t include a lot of (useful) code, it usually just points Gradle/Maven to the “correct” dependency?
🚫 2
👌 1
c
If you mean the Gradle term it's a “target” in the KMP Gradle plugin. https://kotlinlang.org/docs/multiplatform/multiplatform-discover-project.html#targets
blob ty sign 1
e
if you mean "parent" as in the parent POM used in many Maven groups… a parent POM helps set common properties and versions, but it doesn't actually point to the ""correct" dependency"
in this KMP publication, the unifying
sarif4k
contains metadata about which targets are available, and also leads Gradle's dependency resolution to follow to the specific target artifact for each platform
it doesn't work with Maven
h
ok clear, thank you. So in practice, you don’t need it - if you want to manually specify that you want the jvm and the macosarm64, you can do it and never use the “base”
sarif4k
right?
c
If it is an internal lib, I guess you can. As a user of your public library I would not expect to declare the individual dependencies myself but just consume the “parent” and depending on the targets I define in my KMP project, let Gradle pull in the concrete dependencies.
e
if you're creating a multiplatform library targeting multiple platforms, you definitely want to use it, so that your downstream consumers can resolve the common metadata for your dependecy
h
Clear, thank you both 🙂