Integrating products from targets in multiple projects is hard
Context 🕵️♀️
I've recently had to work on a configuration where a target in a project depends on a product produced by a target in a different project. The process of setting up the relationships between targets in separate projects was a bit more involved than I hoped it would.
The built products configuration that I was trying to achieve looked like this
where ModuleWithResources.bundle is produced by a target within ModuleWithResources.xcodeproj and AppModule.app is produced by a target within AppModule.xcodeproj.
What 🌱
As far as I can tell there isn't any API to do achieve this easily right now, is there?
To set up such build configuration the user of XcodeProj library would be required to know about PBXReferenceProxy, PBXContainerItemProxy and how to integrate these objects with other PBX objects.
Proposal 🎉
One way XcodeProj could make this process simpler is by providing documentation. I made a sample project which generates the above-mentioned ModuleWithResources.xcodeproj and AppModule.xcodeproj. I could try to make it into a guide for the Documentation if that sounds useful.
Another way to simplify things is to make an API that would enable a user to add dependencies between targets from different projects and to integrate products of the targets between projects.