https://kotlinlang.org logo
a

araqnid

03/24/2020, 2:32 PM
I’ve just tried making a multiplatform library, and I can actually use it as a dependency in downstream apps, but the only thing missing is the sources when I click through into one of the library’s classes (both js and jvm downstream consumers) Searching here for mentions I found this: https://kotlinlang.slack.com/archives/C3PQML5NU/p1573209686439300 I had a look in my local maven repo, and indeed, the sourcesElements that Gradle usually puts in for a maven publication are missing from the module files published here. The library doesn’t specify any publishing configuration at all, the multiplatform plugin is synthesising the publications entirely- which is cool, as far as it goes, just not quite all the way there yet… This is with Gradle 6.2, and I get the same results with K 1.3.71 and 1.4-M1. Also, the sources in the sources jar that is written to the repo include the “commonMain/” prefix, is that expected?
youtrack 1
l

louiscad

03/24/2020, 3:32 PM
I have a smiliar issue with Kotlin 1.3.61 in #splitties where the source jars are empty for platform specific sources. I've yet to report it (priorities). If you report your issue, please link it here, I'll star it.
a

araqnid

03/24/2020, 3:38 PM
I found https://youtrack.jetbrains.com/issue/KT-36081 so I’m going to check whether this issue is specific to the use of mavenLocal for me
today I learned the “Similar Issues” search on creating a new YT seems to be the best way to find issues…
Right, it doesn’t occur when using a remote Maven repository that supports storing the Gradle module metadata (bintray doesn’t, which causes its own problems)
l

louiscad

03/24/2020, 5:17 PM
Bintray doesn't, mavenLocal doesn't it seems… what does support it?
a

araqnid

03/24/2020, 5:18 PM
mavenLocal does store the files, so I was classifying it as supporting it (it = storing .module files)
I uploaded them to our work Nexus to test a remote download
I wonder if there’s some bodge in place to try fetching sources jars by convention from a remote Maven repository. Still seems wierd to not implement that for local though.
l

louiscad

03/24/2020, 5:27 PM
Bintray supports Gradle metadata so long as you don't use their Gradle plugin but Gradle 6+ built-in plugin
maven-publish
a

araqnid

03/24/2020, 5:29 PM
ah ha, I’d just found a suggested hack to make their plugin do it
l

louiscad

03/24/2020, 5:31 PM
Seriously, don't use their plugin.
It's not been maintained for a while, and the hacks still leave edge cases
a

araqnid

03/24/2020, 5:33 PM
I’d love to drop it, I haven’t revisited using it for quite a while now. Should just be a case of figuring out the maven url and credentials manually, hopefully
ah-ha, it seems the key there is to ignore their Gradle instructions and just use the Maven ones
although it’s so far got their model a bit wrong so they see artifact names as versions sigh
l

louiscad

03/24/2020, 7:31 PM
That's a bintray issue that has workarounds: https://github.com/gradle/gradle/issues/11412
👍🏻 1
3 Views