I have a project to develop a shared KMM library module. However, it needs to use both Sqldelight and Ktor, which are also used by our main shared common code module for the app. How can I use the same Sqlight and Ktor dependencies for both multiplatform library iOS frameworks and not duplicate the dependencies?
👀 1
k
kpgalligan
10/11/2022, 10:26 PM
2 Frameworks? You can’t. they are distinct at a binary level. You’d need to create an umbrella framework including both modules, or you have duplicates (however, the compiler only includes referenced code, so you don’t necessarily get the whole library as a duplicate, but in situations like sqldelight, I don’t imagine there would be much of a difference)
c
colintheshots
10/11/2022, 10:28 PM
Thanks, Kevin! Do you have any good examples of integrating umbrella frameworks like this for transitive dependencies?
k
kpgalligan
10/11/2022, 11:05 PM
None that are public. We’ve done this a bunch for clients. You basically create a kotlin module that has project dependencies on the other modules. Then export the modules, but I would not export transitively as that pulls in everything and will inflate the final binary with unnecessary code. If I think of a good public example I’ll send it along.
c
colintheshots
10/11/2022, 11:15 PM
Awesome, I'll look tomorrow as well. I spent this afternoon Googling for some.