Hey all. Is there a way to publish the artifacts g...
# multiplatform
s
Hey all. Is there a way to publish the artifacts generated from commonMain to Maven? And if so, should I be actually uploading the artifacts from commonMain to Maven? I might be thinking about this incorrectly, but if, for example, someone were to make a separate multiplatform project and wanted to call methods in their common code from my multiplatform project's common code. Is there a different way they should be doing this other than to have a dependency on my project's common code?
s
well first, the artifact you'd be uploading would be called
metadata
, not
common
. second, yes, you should
s
ooh, that's what the metadata bit is for! so I just call it with the
val metadata by getting {}
format within publications block?
s
yeah, the artifact produced from the
common
source set is called
metadata
. there's a reason for that, but it's not explained very well in the docs. you can access it like that, yes
p
Eh, probably want to use
commonMain
and
commonTest
, but yes
val target by getting {}
s
@pardom the source sets are called
commonMain
and
commonTest
, the artifact is called
metadata
s
^ that was what was confusing to me. project can find the publication fine now 🙂 thanks!
👍🏿 1
p
Ah, I missed the
publications
part of her question and assumed she was working in
sourceSets
.
BTW, that script I posted will publish metadata to
foo
and
foo-metadata