Upgrade to Pro — share decks privately, control downloads, hide ads and more …

CocoaPods Dependency Resolution

CocoaPods Dependency Resolution

This is a talk I gave at Stripe on the work I've done building Molinillo, the new CocoaPods dependency resolver. The page detailing the event is at https://stripe.com/blog/open-source-retreat-meetup, and the source for this presentation is at https://github.com/segiddins/Stripe-OSR-Talk.

A video is available at https://www.youtube.com/watch?v=-vMLpUD2Jw0.

4d6be90af74894fd132fb06dacec04d7?s=128

Samuel E. Giddins

October 21, 2014
Tweet

More Decks by Samuel E. Giddins

Other Decks in Programming

Transcript

  1. COCOAPODS DEPENDENCY RESOLUTION: INTRODUCING Molinillo SAMUEL E. GIDDINS @SEGIDDINS

  2. None
  3. RELEASES 0.34.0.RC1, 0.34.0, 0.34.1, 0.34.2, 0.34.4

  4. Molinillo DEPENDENCY RESOLUTION GEM

  5. BUT FIRST, A DETOUR

  6. THE PODSPEC Pod::Spec.new do |s| s.name = 'PromiseKit-AFNetworking' s.version =

    '0.1.4' s.dependency 'AFNetworking', '~> 2.0' s.dependency 'PromiseKit/Promise' end
  7. THE PODFILE source 'https://github.com/CocoaPods/Specs' platform, :ios, '8.1' pod 'AFNetworking', '<

    1.3' pod 'RestKit', '~> 0.23.0' pod 'SEGModules', git: 'https://github.com/segiddins/SEGModules.git'
  8. HOW IT WORKS

  9. ENCAPSULATION ▸ SpecificationProvider ▸ UI

  10. THE ALGORITHM ▸ Constrainst Solving Problem ▸ Backtracking ▸ Forward

    Checking
  11. STACK OF States AND ➿

  12. SORT DEPENDENCIES HANDLE ONE CREATE A POSSIBILITY STATE

  13. SEE IF IT WORKS

  14. YES => MOVE ON NO => UNWIND FOR CONFLICT

  15. STOP WHEN ALL REQUIREMENTS ARE ACTIVATED

  16. RAISE WHEN THERE ARE NO POSSIBIBLE STATES LEFT

  17. EXAMPLES

  18. platform :ios, "7.0" inhibit_all_warnings! pod 'RestKit' pod 'AFNetworking', '~> 1.2.0'

    Before: [!] Unable to satisfy the following requirements: - `AFNetworking (~> 1.3.0)` required by `RestKit/Network (0.23.3)` - `AFNetworking (~> 1.2.0)` required by `Podfile`
  19. platform :ios, "7.0" inhibit_all_warnings! pod 'RestKit' pod 'AFAmazonS3Client' pod 'CargoBay'

    pod 'AFOAuth2Client' Before: [!] Unable to satisfy the following requirements: - `AFNetworking (~> 1.3.0)` required by `RestKit/Network (0.23.3)` - `AFNetworking (~> 1.2.0)` required by `Podfile`
  20. platform :ios, "7.0" inhibit_all_warnings! pod 'AFAmazonS3Client' pod 'CargoBay' pod 'AFOAuth2Client'

    Before: [!] Unable to satisfy the following requirements: - `AFNetworking (~> 2.0)` required by `AFAmazonS3Client (2.0.0)` - `AFNetworking/Serialization` required by `AFNetworking (2.4.1)` - `AFNetworking/Security` required by `AFNetworking (2.4.1)` - `AFNetworking/Reachability` required by `AFNetworking (2.4.1)` - `AFNetworking/NSURLConnection` required by `AFNetworking (2.4.1)` - `AFNetworking/NSURLSession` required by `AFNetworking (2.4.1)` - `AFNetworking/UIKit` required by `AFNetworking (2.4.1)` - `AFNetworking/Serialization` required by `AFNetworking/NSURLConnection (2.4.1)` - `AFNetworking/Reachability` required by `AFNetworking/NSURLConnection (2.4.1)` - `AFNetworking/Security` required by `AFNetworking/NSURLConnection (2.4.1)` - `AFNetworking/Serialization` required by `AFNetworking/NSURLSession (2.4.1)` - `AFNetworking/Reachability` required by `AFNetworking/NSURLSession (2.4.1)` - `AFNetworking/Security` required by `AFNetworking/NSURLSession (2.4.1)` - `AFNetworking/NSURLConnection` required by `AFNetworking/UIKit (2.4.1)` - `AFNetworking/NSURLSession` required by `AFNetworking/UIKit (2.4.1)` - `AFNetworking (~> 2.2)` required by `CargoBay (2.1.0)` - `AFNetworking (~> 1.3)` required by `AFOAuth2Client (0.1.2)`
  21. After: it just works !

  22. ! STRIPE ! ❤

  23. SAMUEL E. GIDDINS COCOAPODS CORE TEAM @SEGIDDINS