0

I have two apps (xcode projects) that i want to have in one workspace. Since Cocoapods usually generates the workspace, i looked to see if it was possible to do this and found some answer. The recommended Podfile would look like:

workspace 'TestWorkspace'

   target 'TestApp1' do
   xcodeproj 'testApp1/testApp1.xcodeproj'
   workspace 'TestWorkspace'
       pod 'AFNetworking'
   end

   workspace 'TestWorkspace'

   target 'TestApp2' do
   xcodeproj 'TestApp2/TestApp2.xcodeproj'
       pod 'MBProgressHUD'
   end

(sorry wasn't sure how to have SO format the Ruby code)

So my folder structure looks like a TestWorkspace folder, with the two App projects folders, and the Podfile. Running pod install

[!] xcodeproj was renamed to project. Please update your Podfile accordingly.

and..

[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target TestApp1 to ../Pods/Target Support Files/Pods-TestApp1/Pods-TestApp1.debug.xcconfig or include the ../Pods/Target Support Files/Pods-TestApp1/Pods-TestApp1.debug.xcconfig in your build configuration (TestApp1/Pods/Target Support Files/Pods-TestApp1/Pods-TestApp1.debug.xcconfig).

So my question is what changes must be made to wind up with my TestWorkspace workspace having three projects: TestApp1, TestApp2, and Pods?

(btw, i changed the true names of my projects/workspaces to pseudo-aliases for the purposes of posting here. Hopefully, I changed everything faithfully.)


EDIT: Ok so i fixed the first warning (just a change in podfile syntax from xcodeproj to project). However, my workspace is definitely not being configured properly. I don't even see a Pod project after pod installing.

EDIT2: OK so i fixed the second warning by setting both project configuration files (debug and release) to "none". So now I have no errors, but the Pod project is still no where to be found. (Sorry if i'm solving parts of the question but I think its better to add edits than to create a new question).

Alex Bollbach
  • 4,370
  • 9
  • 32
  • 80

1 Answers1

3

Use the targets as scopes for the xcproject/workspaces. Update the podfile to something like this:

workspace 'TestWorkspace'

   target 'TestApp1' do
   xcodeproj 'testApp1/testApp1.xcodeproj'
   workspace 'TestWorkspace'
       pod 'AFNetworking'
   end

   target 'TestApp2' do
   xcodeproj 'TestApp2/TestApp2.xcodeproj'
   workspace 'TestWorkspace'
       pod 'MBProgressHUD'
   end

Now run pod install --verbose

ystack
  • 1,785
  • 12
  • 23
  • so basically "scope" the two target-do's within a workspace? So I changed my podfile to that.. I'm seeing all good things in the verbose log (not sure if I want to share it -- as it doesn't have redactions) but still no Pod project in "TestWorkspace". Seems the two projects have been configured seemingly properly as they have Pods groups with non-red xcconfigs. However the framework group for both has a red `libPods-TestApp*.a` – Alex Bollbach Feb 21 '17 at 20:53