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

Introduction to Cocoapods

Introduction to Cocoapods

Slides for the talk on Cocoapods I gave at Mobel in Brussels (VRT, Oct 2013).

Avatar for Alex Manarpies

Alex Manarpies

October 15, 2013

Other Decks in Programming

Transcript

  1. platform :ios, '6.0’ pod 'JSONKit' pod 'POViewFrameBuilder' pod 'AFNetworking', '~>

    1.3.1’ target :test, :exclusive => true do pod 'Kiwi' end 1 2 3 4 5 6 7
  2. +

  3. _

  4. NEW

  5. ~

  6. DIY ⤻ COPY PROJECT ⤻ ADD TARGET DEPENDENCY (BUILD PHASES

    TAB) ⤻ LINK BINARY WITH LIBS (+ ADD ANY FRAMEWORKS) ⤻ COPY BUNDLE RESOURCES ⤻ ADD TO HEADER SEARCH PATH ⤻ ADD ‘OTHER LINKER FLAGS’ (E.G. -all_load, -ObjC) ⤻ #IMPORT HEADER FILE
  7. GIT $ git submodule add git@somehost:repo path/to/submodule $ git commit

    $ git submodule update $ cd path/to/submodule $ git checkout branch $ git pull … ⤻ ADD GIT SUBMODULE
  8. GIT $ git submodule add git@somehost:repo path/to/submodule $ git commit

    $ git submodule update $ cd path/to/submodule $ git checkout branch $ git pull … ⤻ ADD GIT SUBMODULE ⤻ GO BACK 2 SLIDES ⤻ REPEAT FOR EACH DEPENDENCY
  9. ✓

  10. ?

  11. PUBLIC SPEC REPO LOCAL SPECS LIB REPO LIB REPO LIB

    REPO LIB REPO LIB REPO GIT CLONE GIT CLONE GITHUB
  12. Pod::Spec.new do |s| s.name = "PayPal-iOS-SDK" s.version = "1.3.4" s.summary

    = "Accept credit cards and PayPal.." s.description = “The PayPal iOS SDK provides a..” s.homepage = "https://developer.paypal.com/webap..” s.author = 'Paypal' s.source = { :git => "https://github.com/paypal/PayPal-iOS-SDK.git", :tag => "1.3.4" } s.platform = :ios, '5.0' s.public_header_files = 'PayPalMobile/*.h' s.source_files = 'PayPalMobile/*.h' s.preserve_paths = "PayPalMobile/libPayPalMobile.a" s.frameworks = 'AVFoundation', 'AudioToolbox', s.libraries = 'stdc++', 'xml2', 'PayPalMobile' s.xcconfig = {'OTHER_LDFLAGS' => '-lc++ -ObjC' , 'HEADER_SEARCH_PATHS' => '$(SDKROOT)/usr/include/libxml2’, 'LIBRARY_SEARCH_PATHS' => '"$(PODS_ROOT)/PayPal-iOS-.."' } end 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
  13. LIB REPO LIB REPO CONFIG LIB REPO LIB REPO FRAME

    WORKS ⤻ GIT CLONE PUBLIC & LOCAL LIBS ⤻ APPLY CONFIG ⤻ APPLY HEADER PATHS, ETC
  14. CREATE GIT REPO TO HOLD PRIVATE SPECS git init ADD

    TO REPO LIST pod repo add CREATE+PUSH SPECS TO PRIVATE SPEC REPO pod spec create