skip to Main Content

I have the following situation:

  • an app A that embeds a framework F,
  • this framework F is a private pod, and embeds a static library S,
  • this static library S is also a private pod.

Here is my app A Podfile:

platform :ios, '12.0'
use_frameworks!

source '{my_private_pod_repo}.git'

target `A` do
    pod 'F', :source => '{my_private_pod_repo}.git'
end

This works since it creates a A.xcworkspace which contains my app A and an embedded Pods_A.framework.

But what I would like to do, instead, would be to have a workspace that would contain these three projects. The idea is to be able to have access to the source code of every app/framework/lib, open in the same workspace – but still, I want the app to reference only Pods_A.framework and not each lib/framework locally. Is there any way to do so with CocoaPods?

Thank you for your help

2

Answers


  1. I believe it is not possible, im sorry. You could link multiple podfiles together so that if you change one, all of the other ones change. This is done in macOS by right-clicking on the file and pressing make alias.

    Login or Signup to reply.
  2. Yes you can add multiple projects in a single workspace.

    Let’s say you the following directory structure. (If your projects F and S are separate repos, you can even add them as git submodules)

    |-- A
    |   |-- A.xcodeproj
    |   |-- A.xcworkspace
    |   |-- F
    |   |   |-- F.xcodeproj
    |   |   `-- ...
    |   `-- S
    |   |   |-- S.xcodeproj
    |   |   `-- ...
    
    • Open the A.xcworkspace

    • Drag and drop A/F/F.xcodeproj in workspace

    • Drag and drop A/S/S.xcodeproj in workspace

    • Now open the PodFile (In root folder A) and do the similar changes.

        workspace 'A.xcworkspace'
      
        target 'A' do
          use_frameworks!
      
          # Pods for A
          pod 'F', :source => './F'
        end
      
        target 'F' do
          use_frameworks!
      
          project 'F/F' # project local path
          # Pods for F
          pod 'S', :source => './S'
      
        end
      
        target 'S' do
          use_frameworks!
      
          project 'S/S' # project local path
          # Pods for S
      
        end
      
      
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search