Skip to content

Instantly share code, notes, and snippets.

@atomkirk
Created May 27, 2013 20:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save atomkirk/5659032 to your computer and use it in GitHub Desktop.
Save atomkirk/5659032 to your computer and use it in GitHub Desktop.
Cocoapod dependency trees

After wresting the traditional git submodule + static library dependency chain, it became a giant headache. I tried to get it all to work for a long time. You must:

  1. Create a workspace and drag your child projects in.
  2. Add their targets as binary linked libraries.
  3. Manually add header search paths.
  4. And all your dependency projects must be set up a certain way for this to work too. So that's a lot of work.

A much better way is to use submodules to include the child projects into the parent project and then use cocoapods to include those child projects (instead of linking them in statically and dealing with the millions of headaches that brings).

For example, I've added my dependency tree as a series of git submodules and then I have a Podfile that looks like this:

platform :ios, '6.0'

# local (submodules)
pod 'FirehoseCocoa',                path: "FirehoseCocoa"
pod 'MTAnimation',                  path: "MTAnimation"
pod 'MTDates',                      path: "FirehoseCocoa/MTDates"
pod 'MTPocket',                     path: "FirehoseCocoa/MTPocket"
pod 'Base64',                       path: "FirehoseCocoa/MTPocket/Base64"
pod 'XMLDictionary',                path: "FirehoseCocoa/MTPocket/XMLDictionary"
pod 'MTJSONUtils',                  path: "FirehoseCocoa/MTPocket/MTJSONUtils"

# ours
pod 'MTQueue',                      :head
pod 'MTGeometry',                   :head
pod 'MTStringAttributes',           :head


# third-party (customized)
pod 'BlocksKit',                    git: "https://github.com/atomkirk/BlocksKit.git"
pod 'REMenu',                       git: "https://github.com/atomkirk/REMenu.git"
pod 'GetGravatar',                  git: "https://github.com/atomkirk/GetGravatar.git"


# third-party
pod 'JASidePanels',                 '~> 1.3.1'
pod 'SVProgressHUD',                :head
pod 'SVPullToRefresh',              '~> 0.4.1'
pod 'TestFlightSDK',                '~> 1.3.0-beta.5'
pod 'FrameAccessor',                '~> 1.1.0'
pod 'GCNetworkReachability',        '~> 1.3.0'
pod 'GVUserDefaults',               '~> 0.9.0'
pod 'SORelativeDateTransformer',    '~> 1.1.5'
pod 'libPusher',                    '~> 1.4'
pod 'GCPlaceholderTextView',        '~> 1.0.1'
pod 'KISSmetrics',                  '~> 1.0.0'

I suggest this route.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment