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

CocoaPods SotU 2015 - Debugging CocoaPods

CocoaPods SotU 2015 - Debugging CocoaPods

CocoaPods State of the Union 2015 talk - giving a heads up on current restrictions and some hints what will happen about that in the near future, as well as general pointers on what can be done, if you're in trouble.

Marius Rackwitz

June 08, 2015
Tweet

More Decks by Marius Rackwitz

Other Decks in Technology

Transcript

  1. 8 Jun 2015 @mrackwitz USING EXTENSIONS Assume you have a

    project with an app target: MyApp a framework target: MyFramework an extension: MyWidget tests targets: MyAppTests, MyFrameworkTests
  2. 8 Jun 2015 @mrackwitz USING EXTENSIONS 1 2 3
 4

    5 6
 7
 8
 9 10 11 12 13 14 15 16 17 18 19
 20 #Podfile use_frameworks! platform :ios, '8.0' target :MyApp, :exclusive => true do pod 'Alamofire' end target :MyFramework, :exclusive => true do pod 'Alamofire' end target :MyAppTests, :exclusive => true do pod 'Alamofire' pod 'KIF' end target :MyFrameworkTests, :exclusive => true do pod 'Quick' end
  3. 8 Jun 2015 @mrackwitz USING EXTENSIONS De-duplicate your dependencies manually

    in the Podfile 1 2 3
 4 5 6
 7
 8
 9 10 11 12 13 14 15 #Podfile use_frameworks! platform :ios, '8.0' pod 'Alamofire' link_with 'MyApp', 'MyAppTests', 'MyFramework', 'MyFrameworkTests' target :MyAppTests, :exclusive => true do pod 'KIF' end target :MyFrameworkTests, :exclusive => true do pod 'Quick' end
  4. 8 Jun 2015 @mrackwitz USING EXTENSIONS We are working on

    de-duplicating targets, automatically.
 Subscribe to #3550, if you’re interested in the progress. Feedback is welcome!
  5. 8 Jun 2015 @mrackwitz DEPENDING ON OBJECTIVE-C FROM SWIFT PODS

    No dedicated Bridging Header by default Same as the Umbrella Header CocoaPods generates an own Umbrella Header for convenience, where all declared public headers are imported
  6. 8 Jun 2015 @mrackwitz SOLUTION A - USE MODULE IMPORTS

    Use import ObjectivePod from Swift. DISADVANTAGE You get the full Objective-C public API.
  7. 8 Jun 2015 @mrackwitz SOLUTION B - MAKE IT ALL

    PUBLIC Create a header Import all the Objective-C headers, you need,
 e.g. #import <ObjectivePod/A.h> Add the header to the public_header_files DISADVANTAGE Exposes the dependency in the public API.
  8. 8 Jun 2015 @mrackwitz SOLUTION C - CUSTOM MODULE MAP

    Create a modulemap with a private submodule. Declare it in the podspec 1 2 3
 4 5 6
 7
 8
 9 10 11 #module.modulemap framework module ResearchKit
 umbrella header "ResearchKit.h"
 
 module Private {
 umbrella header "ResearchKit_Private.h"
 export *
 }
 export *
 module * { export * } }
  9. 8 Jun 2015 @mrackwitz TROUBLESHOOTING - RESET YOUR INTEGRATION Some

    changes to your Podfile, require that you re-run the integration SOLUTION gem install cocoapods-deintegrate pod deintegrate pod install
  10. 8 Jun 2015 @mrackwitz TROUBLESHOOTING - RESET EVERYTHING rm -rf

    ~/Library/Caches/CocoaPods rm -rf ~/Library/Developer/Xcode/ DerivedData pod deintegrate || rm -rf Pods pod install
  11. 8 Jun 2015 @mrackwitz HOW YOU CAN HELP File and

    Improve Issues Respond to questions on StackOverflow Get involved and share your experiences