Thread
#multiplatform
    a

    araqnid

    2 years ago
    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?
    louiscad

    louiscad

    2 years ago
    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

    2 years ago
    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)
    louiscad

    louiscad

    2 years ago
    Bintray doesn't, mavenLocal doesn't it seems… what does support it?
    a

    araqnid

    2 years ago
    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.
    louiscad

    louiscad

    2 years ago
    Bintray supports Gradle metadata so long as you don't use their Gradle plugin but Gradle 6+ built-in plugin
    maven-publish
    a

    araqnid

    2 years ago
    ah ha, I’d just found a suggested hack to make their plugin do it
    louiscad

    louiscad

    2 years ago
    Seriously, don't use their plugin.
    It's not been maintained for a while, and the hacks still leave edge cases
    a

    araqnid

    2 years ago
    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
    louiscad

    louiscad

    2 years ago
    That's a bintray issue that has workarounds: https://github.com/gradle/gradle/issues/11412