Can I have more than one common artifacts build fr...
# multiplatform
r
Can I have more than one common artifacts build from one MPP project?
k
what do you mean by common artifact?
r
jar artifact published on maven/bintray, containing metadata from common sources
k
so you want multiple JVM targets?
r
multiple js + multiple jvm targets
i'm using currently old mpp project structure with gradle subprojects
I'm trying to migrate to new mpp with multiple sourcesets
k
yes, you can do that
r
any example how to do this?
k
jvm("target-1") jvm("target-2")
r
i have something like this, but it doesn't create common artifacts
jvm artifacts (and js too) are created ok
but I don't know how can i configure commons
only one
*-metadata-*.jar
is build and it's empty
k
i'm still not sure what you mean by common artifacts. are you referring to the artifact for gradle metadata?
n
@Robert Jaros are you referring to "building universal frameworks" from this document? https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#publishing-a-multiplatform-library
r
no, I'm not using K/N
I don't know if I understand this correctly, but perhaps I don't need common artifacts at all if I use experimental gradle metadata publishing mode?
k
let me ask this - what do you expect to be included in a "common" artifact?
r
currently it contains some *.kotlin_metadata files
I've got these three artifacts now
But I'm not really sure what are they used for ;-)
k
those are not necessary, unless you have some specific reason for them
you will typically have 1 artifact per target (or maybe one per build variant), along with 2 artifacts for gradle metadata
r
ok, thx - I'll just try to ignore this and continue the migration - soon I'll be able to test app compilation so I'll know if it works