[iOS] dependency management

896e816a54b484b5233ed5f9ea5278a5?s=47 Florian
February 09, 2016

[iOS] dependency management

Talk held at mobile maultaschen, our local mobile developer user group

896e816a54b484b5233ed5f9ea5278a5?s=128

Florian

February 09, 2016
Tweet

Transcript

  1. dependency management

  2. iOS OS X watchOS tvOS

  3. why?

  4. lots of problems were solved by smarter people

  5. don’t reinvent the wheel

  6. unless you plan on learning more about wheels

  7. how to choose?

  8. forks?

  9. watchers?

  10. pull requests?

  11. open issues?

  12. releases?

  13. documentation?

  14. unit tests?

  15. metrics

  16. understand everything

  17. CocoaPods quality index

  18. bus factor !

  19. gem install github_bus_factor +-----+-----------------------------------------------------------+ | afnetworking/afnetworking | +-----+-----------------------------------------------------------+ | !

    | 7298 forks. | | " | 1684 watchers. | | # | 22999 stars. | | $ | Created over 4 years ago; last push about 10 hours ago. | | % | 1182 PRs: 1167 closed; 15 opened; 98.73% PRs are closed. | | & | Deletions to additions ratio: 74.72% (-136225/182307). | | ' | 34 releases; latest release "3.0.4": about 2 months ago. | | ( | Bus factor: 100.0%. Most likely one core contributor. | +-----+-----------------------------------------------------------+
  20. semantic versioning !!!

  21. 1.2.3

  22. how?

  23. None
  24. sets up everything for you

  25. actively maintained

  26. huge userbase

  27. Podfile

  28. source 'https://github.com/CocoaPods/Specs.git' source 'https://github.com/keslcod/specs.git' platform :ios, '7.0' inhibit_all_warnings! def common_pods

    pod 'Aspects', git: 'https://github.com/keslcod/Aspects', tag: '1.4.3' pod 'ISO8601DateFormatter', git: 'https://github.com/keslcod/iso-8601-date-formatter', tag: '0.7.1' pod 'Mantle', '~>1.5' pod 'NSDate-Escort', git: 'https://github.com/keslcod/NSDate-Escort', tag: '1.5.3' end target 'Apotheken', exclusive: true do common_pods pod 'ActionSheetPicker-3.0' pod 'DZNEmptyDataSet' pod 'FXReachability', '~> 1.1' pod 'GBDeviceInfo', '~> 3.0' pod 'GoogleAnalytics', '~> 3.0' pod 'GoogleMaps', '~>1.10' pod 'GRMustache', '~> 7.3' pod 'HockeySDK' pod 'LiveFrost' pod 'M13BadgeView', git: 'https://github.com/keslcod/M13BadgeView.git' pod 'MagicalRecord/Core+Logging', git: 'https://github.com/magicalpanda/MagicalRecord.git', commit: 'e1703233f141535263555ca154c559a86c127e23' pod 'MD5Digest' pod 'MDCalendar', git: 'https://github.com/keslcod/MDCalendar.git' pod 'MKMapViewZoom' pod 'MWPhotoBrowser', git: 'https://github.com/keslcod/MWPhotoBrowser.git' pod 'PSTAlertController' pod 'PureLayout' pod 'RHAddressBook', '~>1.1' pod 'SDWebImage', :head pod 'SMCalloutView', '~> 2.1' pod 'SVProgressHUD', :head pod 'SVWebViewController', '~>1.0' pod 'TFBarcodeScanner', '~>1.1' pod 'UIButton+TouchAreaInsets' pod 'XLForm', git: 'https://github.com/keslcod/XLForm.git' end target 'Apotheken Watch App Extension', :exclusive => true do platform :watchos, '2.0' common_pods end target 'Apotheken Watch App', :exclusive => true do platform :watchos, '2.0' common_pods end
  29. pod install

  30. it just works™

  31. unless it doesn’t

  32. CocoaPods !

  33. Unable to read CocoaPods-version.yml

  34. ruby

  35. hard to understand if something goes wrong

  36. .xcconfig files become difficult to use

  37. requires .podspec file

  38. breaking .podspec changes

  39. Carthage

  40. only manages dependencies

  41. Cartfile

  42. Cartfile github "ReactiveCocoa/ReactiveCocoa" >= 2.3.1 github "jspahrsummers/xcconfigs" github "Mantle/Mantle" ~>

    1.0 git "file:///directory/to/project" "branch"
  43. Cartfile.private

  44. Carthage !

  45. you must setup everything

  46. bugs in Apple’s toolchain

  47. Swift package manager

  48. Manager is still in early design and development (…) all

    details are subject to change and many important features are yet to be
  49. demo !

  50. tips adjust .gitignore git/svn add Carthage/Checkouts git/svn add Pods git

    commit -m 'Update Carthage/Pods'
  51. links 4 http://blog.codinghorror.com/dont- reinvent-the-wheel-unless-you-plan-on- learning-more-about-wheels/ 4 https://cocoapods.org 4 https://github.com/carthage/carthage 4

    https://guides.cocoapods.org/making/ quality-indexes.html 4 https://en.wikipedia.org/wiki/ Bus_factor
  52. links 4 https://github.com/zats/ github_bus_factor 4 https://swift.org/package-manager