171 Modularization, Managing SPM Targets & Dependencies #153
-
I'm leaving a question in the Discussion because there aren't many references for Local SPM. In the Package.swift file below, both 'AppFeature' and 'InventoryFeature' have 'Model' target as a dependency. In this case, does AppFeature, which has InventoryFeature as a dependency, copy Model twice redundantly? I'm confused due to the mixed concepts of static and dynamic libraries. Additionally, what's the reason for creating .library for each target in products? Is it to create a buildable scheme in Xcode by adding it to products?
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hi @JongHyunLee84, we prefer to be explicit with what modules a feature depends on rather than using a dependency's transitive dependencies (like InventoryFeature's Models). You can drop the Models from the AppFeature if you want, but I believe someday in the future SPM may become more strict in not allowing access to transitive dependencies like that.
Yes exactly, it is so that we can build each of those libraries in isolation in Xcode. |
Beta Was this translation helpful? Give feedback.
Yes, I believe what @mihaicris-adoreme said is correct, and I believe that has been part of the difficult work that Tuist has dealt with in trying to figure out Xcode+SPM's magic.