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

Shan

04/18/2019, 10:22 PM
From the MPP guide: "By default, a sources JAR is added to each publication in addition to its main artifact." Does this mean I don't need to include
from(components["java"])
and
artifact(tasks["sourcesJar"])
within my maven publication in my MPP build file?
s

serebit

04/18/2019, 10:56 PM
Correct, so long as you add the generated maven publication it’ll include the sources jar
s

Shan

04/19/2019, 1:43 PM
Do you happen to know what the generated publication names are? I can't seem to find it in the documentation and I need them for the signing plugin
going to try with just
sign(publishing.publications)
and see if that works for now
h

h0tk3y

04/19/2019, 3:04 PM
The publication names match the target names. There is one publication per target that you define, plus, a publication named
metadata
for the built-in target of the same name, plus, if you publish a library with Gradle module metadata, there is a 'root' publication named
kotlinMultiplatform
(this one does not have a sources JAR). You can get the existing publications from the project through debug output from the build script, like:
println(publishing.publications.names)
sign(publishing.publications)
should work just fine.
There are sources JARs, indeed, but no Javadoc JARs that are required by Maven Central.
Here's my sample project that is set up for publishing to Maven Central. Shame on me, I never tried to actually publish it to Maven Central, but I did set it up using the tutorials: https://github.com/h0tk3y/k-new-mpp-samples/tree/master/publish-to-maven-central
❤️ 1