is it possible to publish MPP artefact with no sou...
# multiplatform
b
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.
r
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
b
That's what I'm doing at the moment, however that still results with a class being generated for JVM
l
You can put it in nativeMain or alike instead of commonMain
b
but then jvm kotlin jvm compiler complains
The only thing I'm interested in from that artefact is gradle module file and pom.xml
l
It's weird, I have no issues making artifacts grouping dependencies in Splitties, and I'm using the KMP Gradle plugin
b
Are they with empty sourceSets?
l
Yes
No code. Published to a maven repo
b
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 :D
No dice, klib is not being generated if there are no sources
Copy code
> 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)
l
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
b
Do you have any native targets in your project?
l
Yep, but the grouping artifacts currently target Android only, so that's most likely why I don't encounter the issue.
b
Seems to be native specific, then
l
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.
b
https://youtrack.jetbrains.com/issue/KT-47345 Although this behaviour seems to have been implemented intentionally.