[Topic] Kotlin Multiplatform Library: Fat-AAR vs M...
# multiplatform
d
[Topic] Kotlin Multiplatform Library: Fat-AAR vs Multi-Module Publishing Hi everyone, I'm working on creating a library for a Kotlin Multiplatform project. Currently, the project is structured into four separate modules: • Core • Common • Network • FeatureX The goal is to build and distribute a library starting from the
FeatureX
module. I've tried two different approaches so far: 1. Publish all modules locally, then import only the
FeatureX
module in the consumer app. ◦ Pros: It works as expected. ◦ Cons: If the number of modules increases, I'll have to publish each one individually to Maven, which adds complexity and maintenance overhead. 2. Build a fat-AAR that includes everything
FeatureX
needs. ◦ Pros: Only one module to publish. ◦ Cons: Requires manually excluding unnecessary dependencies, packaging is more complex, and ultimately, this approach doesn't work reliably. Do you have any suggestions on how to move forward? Would it be better to publish each module individually, even if only one is needed by the consumer? Or is there a cleaner way to package and publish the whole dependency tree more efficiently? Thanks in advance!