Are there any examples of a Kotlin Multiplatform project that has platform-specific build targets (e.g.
js
) but also builds a multiplatform library that can be imported into another Kotlin Multiplatform project?
Basically I have KMP libraries
A
and
B
.
Library
A
is imported directly by an external
js
project.
Library
B
- which is used by native iOS and Android apps, requires library
A
as a dependency.
Both libraries are for internal use only so I wouldn't be publishing anything to public maven.
Any pointers would be much appreciated!
r
russhwolf
06/03/2020, 12:37 PM
Is the external js project a pure-js thing or kotlin/js? For the latter you should be able to use project dependencies and have it just work. Here's a project that does something similar, with one shared module using jvm/js/android/native and another on top of it with just js/android/native: https://github.com/russhwolf/multiplatform-hello
m
Martin Gagnon
06/07/2020, 10:44 PM
I’m late, but we definitely have a project in production that is configured exactly like you mentioned. Let me know if you need advice 🙂