The case:
- There is a main project which uses CocoaPods.
- I have started a supplementary project which source code meant to be re-used in the main project.
- The supplementary project has been added as a git submolude to the repository of the main project.
- The supplementary project also uses CocoaPods.
The problem: I cannot get the main project actually re-use the source code or build products of the supplementary project.
What I tried and that didn't work:
Organizing the sources of the supplementary project to build as a static library and then get linked to the main project. That does not work because supplementary project is using CocoaPods. The problem with this approach is that CocoaPods also builds as a static library, and supplementary project's static library simply cannot compile because static library cannot be linked to another static library.
Adding the supplementary project as a sub-project to the main project (drag-n-drop the *.xcodeproj file into the sources). The idea was to make the source files of the supplementary project visible to the main project to that I can add them to a build target of the main project. As it turned out Xcode sub-project cannot see build targets of the project containing the sub-project.
Adding the source files of the supplementary project directly to the main project. That actually works, but any new files added to the supplementary project would have to be also added manually to the main project, obviously I treat this as a last resort solution.