https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
m

Maxime Vince

11/19/2023, 3:54 PM
Hello everyone, i'm learning how to work with multi module in a KMP project. I don't find the best practices about it. Have i to create the submodule in the Shared folder or outside (same level thant iosApp, androidApp & Shared). There is no compose multiplatform in my test project, i just try to share a "sdk". If you have any resource i take it 🙂
j

Joel Denke

11/19/2023, 5:24 PM
At the moment iOS is the limitation here, how link code together (However I think Jetbrains work on fix this). Hence right now need one shared module between iOS and Android. The folder structure doesnt really matter, but easiest create them as siblings imo. In Android/Gradle there is no limitation in amount of modules. Myself prefer using feature modules, which is in KMP used by the shared module. So shared module entry point for all app folders like iosApp, androidApp, desktop app, webApp etc.
Personally I like structure https://github.com/chrisbanes/tivi this project using :) Maybe quite large but I like it.
m

Maxime Vince

11/19/2023, 5:33 PM
Thank you Joel, I saw this repository but i was not sure that it was the good way. i will try. 🙂
j

Joel Denke

11/19/2023, 5:35 PM
Maybe a little complex start with however. https://www.jetbrains.com/help/kotlin-multiplatform-dev/multiplatform-samples.html Here first time I tested KMP I used imageviewer. However slightly not up to date with latest KMP changes I think.
2 Views