Skip to content

Working on a pod

Matthew Baranowski edited this page May 29, 2013 · 4 revisions

Requirements

  • A library with a podspec file stored in the root of its directory.

Warnings

  • CocoaPods will not touch a Local Pod, however this feature is relatively young. Be sure that you can restore the library where you want to work on in case something goes wrong.

Workflow

Lets say that you are working on AFNetworking.

pod 'AFNetworking'

Then you decide that you want to contribute:

$ cd ~/Desktop
$ git clone https://github.com/AFNetworking/AFNetworking
pod 'AFNetworking', :path => '~/Desktop/AFNetworking'
$ pod install

Now CocoaPods is using the podspec in the root of ~/Desktop/AFNetworking referencing the files in that folder (CocoaPods will not clean or touch the folder). In the Pods.xcodeproj a new Local Pods folder appears where you can find AFNetworking and develop it in tandem with your application. When you are done you can commit (actually the local option is SCM agnostic).

Finally if you don't intend to work on it anymore, you can switch back to a remote:

pod 'AFNetworking', :git => 'https://github.com/AFNetworking/AFNetworking' # if the patch has been merged
# pod 'AFNetworking'  # if the patch has been released

Notes

If a file of a linked library is added or removed it is necessary to run pod install again in order for the Pods project to pickup the changes. In any case the podspec at the root of the library is used, so it might be necessary to adjust the patterns of the source_files attribute to match new files.


The library is relatively referenced so teams can agree in a file structure for working in tandem with internal libraries. If multiple members of a team follow the same file structure the can keep :path and everything will work. However they should manage manually the checked out revision of the linked library.

~/Code/Applications/MyApp
~/Code/Pods/MyLibrary