Big Chungus

    Big Chungus

    1 year ago
    is it possible to publish MPP artefact with no sources? My use-case is a "marker" artefact that declares dependencies on all library modules to make it easy to get them all via transitive dependencies.
    russhwolf

    russhwolf

    1 year ago
    I think the Kotlin Native compiler gets mad if there's nothing in any source dirs but you can get away with a single empty file
    Big Chungus

    Big Chungus

    1 year ago
    That's what I'm doing at the moment, however that still results with a class being generated for JVM
    louiscad

    louiscad

    1 year ago
    You can put it in nativeMain or alike instead of commonMain
    Big Chungus

    Big Chungus

    1 year ago
    but then jvm kotlin jvm compiler complains
    The only thing I'm interested in from that artefact is gradle module file and pom.xml
    louiscad

    louiscad

    1 year ago
    It's weird, I have no issues making artifacts grouping dependencies in Splitties, and I'm using the KMP Gradle plugin
    Big Chungus

    Big Chungus

    1 year ago
    Are they with empty sourceSets?
    louiscad

    louiscad

    1 year ago
    Yes
    No code. Published to a maven repo
    Big Chungus

    Big Chungus

    1 year ago
    Hmm, something might've changed then. Last I tried it was on kotlin 1.3 tbh. Let me give it a go with 1.5.30 😄
    No dice, klib is not being generated if there are no sources
    > java.io.FileNotFoundException: \\wsl$\Ubuntu\home\mpetuska\IdeaProjects\template-kmp-library\build\classes\kotlin\androidNativeArm32\main\klib\template-kmp-library.klib (No such file or directory)
    louiscad

    louiscad

    1 year ago
    Fails only on native it seems
    Worth a kotl.in/issue report IMO, because this is a use case that you'll not be the only one to encounter
    Big Chungus

    Big Chungus

    1 year ago
    Do you have any native targets in your project?
    louiscad

    louiscad

    1 year ago
    Yep, but the grouping artifacts currently target Android only, so that's most likely why I don't encounter the issue.
    Big Chungus

    Big Chungus

    1 year ago
    Seems to be native specific, then
    louiscad

    louiscad

    1 year ago
    I think the Kotlin/Native part rests on wrong assumptions, so an issue report would be helpful to have these removed.
    I think you'll not get the issue if you publish the grouping for JVM only, or Android only. I don't know for JS(IR) and JS legacy.
    Big Chungus

    Big Chungus

    1 year ago
    https://youtrack.jetbrains.com/issue/KT-47345 Although this behaviour seems to have been implemented intentionally.