Does anyone have experience building their KMP lib...
# multiplatform
m
Does anyone have experience building their KMP library on multiple hosts (Linux, Mac, Windows) and then merging + publishing all their artifacts from a single host? We're doing this and have run into a few issues, particularly around KMP metadata. When combining the platform artifacts on the single host, we have to do deep merges of: • *kotlin-tooling-metadata.json • *.module • root module jar (
my-kmp-project-1.0.jar
) • root module sources jar (
my-kmp-project-1.0-sources.jar
) ... and I'm wondering if there is a better way this could be handled than performing these manual merges. From what I can tell, the root module (no platform suffix) contains critical KMP metadata that's needed to declare supported targets and resolve the correct platform module (such as
my-kmp-project-linuxx64-1.0.klib
).
For more context, we don't use cross compilation so the Windows host only has mingw enabled, Linux only has Linux targets enabled, etc... It may be simpler if we had all targets enabled on all hosts since the entire target metadata would be populated on every host
m
You could enable all cross compilation with a gradle flag, so normal development keeps it not enabled, but when doing a release you enable it.
m
Yeah that might work. We have a cinterop dependency and need to be careful to not actually build the cross-compile targets, just get their metadata