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

Scaling CocoaPods

Scaling CocoaPods

A lightning talk given at Square's OSCON party

Samuel E. Giddins

July 18, 2018
Tweet

More Decks by Samuel E. Giddins

Other Decks in Technology

Transcript

  1. Mobile Developer Experience ➡ Owns the build system, dependency manager,

    interface with CI ➡ Maintains the (open source) tools used to build the app Scaling CocoaPods @ Square 3
  2. Mobile Developer Experience ➡ Owns the build system, dependency manager,

    interface with CI ➡ Maintains the (open source) tools used to build the app ➡ Keeps developers as productive as possible Scaling CocoaPods @ Square 3
  3. Mobile Developer Experience ➡ Owns the build system, dependency manager,

    interface with CI ➡ Maintains the (open source) tools used to build the app ➡ Keeps developers as productive as possible ➡ Cross platform: iOS & Android Scaling CocoaPods @ Square 3
  4. Mobile Developer Experience ➡ Owns the build system, dependency manager,

    interface with CI ➡ Maintains the (open source) tools used to build the app ➡ Keeps developers as productive as possible ➡ Cross platform: iOS & Android ➡ Develops CocoaPods features Scaling CocoaPods @ Square 3
  5. CocoaPods @ Square ➡ 265 total pods ➡Pods directory is

    1005 MB Scaling CocoaPods @ Square 4
  6. CocoaPods @ Square ➡ 265 total pods ➡Pods directory is

    1005 MB ➡Over 10,000 source files Scaling CocoaPods @ Square 4
  7. CocoaPods @ Square ➡ 265 total pods ➡Pods directory is

    1005 MB ➡Over 10,000 source files ➡ Swift, Objective-C Scaling CocoaPods @ Square 4
  8. CocoaPods @ Square ➡ 265 total pods ➡Pods directory is

    1005 MB ➡Over 10,000 source files ➡ Swift, Objective-C ➡ Dynamic Frameworks, Static Libraries, Static Frameworks Scaling CocoaPods @ Square 4
  9. CocoaPods @ Square ➡ 265 total pods ➡Pods directory is

    1005 MB ➡Over 10,000 source files ➡ Swift, Objective-C ➡ Dynamic Frameworks, Static Libraries, Static Frameworks ➡ Monorepo & Multirepo Scaling CocoaPods @ Square 4
  10. CocoaPods at home in a monorepo Generating a scratch workspace

    for a single pod $ pod gen Frameworks/SquareUIComponents --auto-open Describing tests in a podspec Pod::Spec.new do |s| s.test_spec 'Tests' do |ts| ts.source_files = 'Tests/**/*.{h,m}' end end Scaling CocoaPods @ Square 6
  11. Automation Removing the depending on the open-source specs repo $

    pod whitelist NAME VERSION Whitelists a (pod, version) tuple for internal Square use Automatically generating pre-built binary pods on CI $ pod bin NAME.podspec [ARTIFACT_REPO_URL] Converts the provided `NAME.podspec` into a binary version. The process includes, installing a sandbox, building the sandbox using release configuration for both device and simulator, packing the output and generate a new podspec that uses `ARTIFACT_REPO_URL` as the source. The generated podspec is also validated. Scaling CocoaPods @ Square 7
  12. CocoaPods Performance ➡ Lots of profiling with rbspy ➡ Resolver

    refactoring to make graph traversal not take forever Scaling CocoaPods @ Square 8
  13. CocoaPods Performance ➡ Lots of profiling with rbspy ➡ Resolver

    refactoring to make graph traversal not take forever ➡ Build setting generation rewrite to memoize everything Scaling CocoaPods @ Square 8
  14. Investment in Monitoring ➡ chronometer to instrument method calls ➡

    Log durations to in-house logging system Scaling CocoaPods @ Square 9
  15. Investment in Monitoring ➡ chronometer to instrument method calls ➡

    Log durations to in-house logging system ➡ Roll up into dashboards visible to the entire organization Scaling CocoaPods @ Square 9
  16. Ownership of our Destiny ➡ The team owns our use

    of CocoaPods, not any individual contributors Scaling CocoaPods @ Square 11
  17. Ownership of our Destiny ➡ The team owns our use

    of CocoaPods, not any individual contributors ➡ No forks, few hacks, no helplessness Scaling CocoaPods @ Square 11
  18. Ownership of our Destiny ➡ The team owns our use

    of CocoaPods, not any individual contributors ➡ No forks, few hacks, no helplessness ➡ Open Source sharing expertise with therest of the industry Scaling CocoaPods @ Square 11
  19. Continuous Re-Evaluation ➡ Even though we have core contributors, we're

    open to not using CocoaPods Scaling CocoaPods @ Square 12
  20. Continuous Re-Evaluation ➡ Even though we have core contributors, we're

    open to not using CocoaPods ➡ Taking as many lessons as possible from other tools, such as Buck and Bazel Scaling CocoaPods @ Square 12
  21. Continuous Re-Evaluation ➡ Even though we have core contributors, we're

    open to not using CocoaPods ➡ Taking as many lessons as possible from other tools, such as Buck and Bazel ➡ CocoaPods is a tool, tools are replaceable. Our expertise is forever. Scaling CocoaPods @ Square 12
  22. CocoaPods: Scaled? ➡ Last year's crisis of confidence is over

    ➡ We've onboarded 2 new people to contribute to CocoaPods Scaling CocoaPods @ Square 14
  23. CocoaPods: Scaled? ➡ Last year's crisis of confidence is over

    ➡ We've onboarded 2 new people to contribute to CocoaPods ➡ Development has internal ownership (my team!) Scaling CocoaPods @ Square 14
  24. CocoaPods: Scaled? ➡ Last year's crisis of confidence is over

    ➡ We've onboarded 2 new people to contribute to CocoaPods ➡ Development has internal ownership (my team!) ➡ Performance has improved slightly, with a massive increase in: Scaling CocoaPods @ Square 14
  25. CocoaPods: Scaled? ➡ Last year's crisis of confidence is over

    ➡ We've onboarded 2 new people to contribute to CocoaPods ➡ Development has internal ownership (my team!) ➡ Performance has improved slightly, with a massive increase in: ➡features Scaling CocoaPods @ Square 14
  26. CocoaPods: Scaled? ➡ Last year's crisis of confidence is over

    ➡ We've onboarded 2 new people to contribute to CocoaPods ➡ Development has internal ownership (my team!) ➡ Performance has improved slightly, with a massive increase in: ➡features ➡# of modules Scaling CocoaPods @ Square 14
  27. CocoaPods: Scaled? ➡ Last year's crisis of confidence is over

    ➡ We've onboarded 2 new people to contribute to CocoaPods ➡ Development has internal ownership (my team!) ➡ Performance has improved slightly, with a massive increase in: ➡features ➡# of modules ➡amount of code managed by CocoaPods Scaling CocoaPods @ Square 14