Advanced dependencies    with CocoaPodsDenis Lebedev@delebedev
Why do we need it?
Drag & drop
Git submodule
3rd-party(do they exist at all?)
CocoaPodshttp://cocoapods.org
Install$ sudo gem install cocoapods
Create Podfileplatform :iospod AFNetworkingpod MBProgressHUDpod OHAttributedLabelpod MagicalRecord, = 1.8.3pod EGOImageLoad...
Add libs to the project       $ pod install
How it works
Write own specs$ pod spec create MySpec$vim MySpec.podspec$pod spec line MySpec.podspec
Spec example
Contribute(>650 podspecs already)
Podfile options
Platformplatform: ios, 4.0           Versioningpod ‘EgoImageView’, ‘<=1.2’pod ‘EgoImageView’, ‘:head’
Multiple targetspod RestKittarget :debug do   pod CocoaLumberjackendtarget :test, :exclusive => true do   link_with “MyApp...
Turn off all warnings in      lib sources      inhibit_all_warnings!
Podspec sources
Spec in the root         of lib repopod AFNetworking, :git => https://github.com/gowalla/AFNetworking.git, :commit => 082f...
Lib without podspecpod JSONKit, :podspec => https://raw.github.com/gist/1346394/1d26570f68ca2d72/JSONKit.podspec
Lib without any available        podspecpod do |spec|spec.name       = JSONKitspec.version    = 1.4spec.source     = { :gi...
Local pod pod libAwesome, :local => ~/path/libAwesome*podspec should be in the folder
Pod specification
Dependencies...s.dependency = ‘JSONKit’, ‘<1.4’...
Subspecspod ‘RestKit/JSON’Pod::Spec.new do |s|    s.name = RestKit    s.preferred_dependency = JSON    ...    s.subspec JS...
Moreweak_frameworkss.osx.source_files = ‘MyNSTableView.{h,m}’s.ios.source_files = ‘MySuperUITableView.{h,m}’
Share pod specifications
‘Private’ specs repo$ pod repo add my-spec-repo http://github.com/my-account/spec-repo.git$ pod push my-spec-repo$ cd ~/.c...
Public specs repo*  $ cd ~/.cocoapods/master  $ git remote set-url origin  git@github.com:CocoaPods/Specs.git*If you have ...
‘Appstore’ for libs
Thanks!Questions?
CocoaPods
Upcoming SlideShare
Loading in …5
×

CocoaPods

1,479 views

Published on

Published in: Technology
0 Comments
5 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,479
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
0
Comments
0
Likes
5
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • CocoaPods

    1. 1. Advanced dependencies with CocoaPodsDenis Lebedev@delebedev
    2. 2. Why do we need it?
    3. 3. Drag & drop
    4. 4. Git submodule
    5. 5. 3rd-party(do they exist at all?)
    6. 6. CocoaPodshttp://cocoapods.org
    7. 7. Install$ sudo gem install cocoapods
    8. 8. Create Podfileplatform :iospod AFNetworkingpod MBProgressHUDpod OHAttributedLabelpod MagicalRecord, = 1.8.3pod EGOImageLoadingpod AQGridViewpod Facebook-iOS-SDKpod DCIntrospectpod OCMock
    9. 9. Add libs to the project $ pod install
    10. 10. How it works
    11. 11. Write own specs$ pod spec create MySpec$vim MySpec.podspec$pod spec line MySpec.podspec
    12. 12. Spec example
    13. 13. Contribute(>650 podspecs already)
    14. 14. Podfile options
    15. 15. Platformplatform: ios, 4.0 Versioningpod ‘EgoImageView’, ‘<=1.2’pod ‘EgoImageView’, ‘:head’
    16. 16. Multiple targetspod RestKittarget :debug do pod CocoaLumberjackendtarget :test, :exclusive => true do link_with “MyAppTests” pod Kiwiend
    17. 17. Turn off all warnings in lib sources inhibit_all_warnings!
    18. 18. Podspec sources
    19. 19. Spec in the root of lib repopod AFNetworking, :git => https://github.com/gowalla/AFNetworking.git, :commit => 082f8319af
    20. 20. Lib without podspecpod JSONKit, :podspec => https://raw.github.com/gist/1346394/1d26570f68ca2d72/JSONKit.podspec
    21. 21. Lib without any available podspecpod do |spec|spec.name = JSONKitspec.version = 1.4spec.source = { :git => https://github.com/johnezang/JSONKit.git, :tag => v1.4 }spec.source_files = JSONKit.*end
    22. 22. Local pod pod libAwesome, :local => ~/path/libAwesome*podspec should be in the folder
    23. 23. Pod specification
    24. 24. Dependencies...s.dependency = ‘JSONKit’, ‘<1.4’...
    25. 25. Subspecspod ‘RestKit/JSON’Pod::Spec.new do |s| s.name = RestKit s.preferred_dependency = JSON ... s.subspec JSON do |js| js.dependency RestKit/ObjectMapping/JSON js.dependency RestKit/ObjectMapping/CoreData js.dependency RestKit/UI end s.subspec XML do |xs| ... end ...end
    26. 26. Moreweak_frameworkss.osx.source_files = ‘MyNSTableView.{h,m}’s.ios.source_files = ‘MySuperUITableView.{h,m}’
    27. 27. Share pod specifications
    28. 28. ‘Private’ specs repo$ pod repo add my-spec-repo http://github.com/my-account/spec-repo.git$ pod push my-spec-repo$ cd ~/.cocoapods/my-spec-repo$ git remote add upstream git://github.com/CocoaPods/Specs.git
    29. 29. Public specs repo* $ cd ~/.cocoapods/master $ git remote set-url origin git@github.com:CocoaPods/Specs.git*If you have push access to master-repo
    30. 30. ‘Appstore’ for libs
    31. 31. Thanks!Questions?

    ×