Tomáš Procházka
10/16/2024, 7:15 PMPablichjenkov
10/16/2024, 7:25 PMshared
framework that includes all your needs. These will avoid duplicate kmm runtime inclusion which will impact size mainly. Also having all modules together when compiling can take advantage of optimizations.
In your case you can have 2 shared(umbrella) modules as you mentioned. One shared3
importing 3 of your modules and the other sharedAll
which imports all of them.Tomáš Procházka
10/16/2024, 7:29 PMTomáš Procházka
10/16/2024, 7:31 PMTomáš Procházka
10/16/2024, 7:35 PMTomáš Procházka
10/16/2024, 7:57 PMshared
kmp module folder to existing iOS folder with all the librarries depenendencies that project needs and setup it in the way as normal kmp project is. It mean that XCode will run gradle task which will build native library locally from .klib dependencies.Pablichjenkov
10/17/2024, 1:25 AMjar
or an aar
, they need a pom.xml file so a build tool like maven or Gradle pull the dependencies into the compile/runtime whatever path.
Similarly in iOS, SPM or cocoapods or cartridge have their own mechanism to declare dependencies. But if you distribute a raw framework, your clients will have to manually add the other dependent frameworks in Xcode. This is the case for a dynamically compiled framework. On the other end, you can distribute a static framework which embeds its dependencies in the binary but it obviously will impact size. Because if the client also depends on the same transitive library you include the binary bulk twice in the final(App) binary. That's why dynamic compilation/linking is preferred over static compilation/linking.
Back to kotlin, KMP is not an iOS build tool so you can't tell it which iOS dependencies your library depends on. (The cocoapods KMP gradle plugin allows for this but enforces you to use cocoapods in iOS side, and FYI the cocoapods project just entered maintenance mode this year)
So the only thing KMP does is produce a framework. You can certainly depend on other KMP libs(.klib) but not other ios frameworks, they are not supported, at least yet.Pablichjenkov
10/17/2024, 1:29 AMshared
framework already compiled. For faster build times.