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

Private pods - best practices

Private pods - best practices

A pretty opinionated talk for CocoaPods state of the union (WWDC) event.

The talk is a result of some practices applied after dealing with private pods in a bigger team for quite awhile. Opinions are my own and you shouldn't take them as facts.

Marin Usalj

June 09, 2014
Tweet

More Decks by Marin Usalj

Other Decks in Programming

Transcript

  1. LOCAL PODS
    BEST PRACTICES

    View full-size slide

  2. MARIN USALJ
    @SUPERMARIN

    View full-size slide

  3. MARIN USALJ
    @SUPERMARIN

    View full-size slide

  4. DEVELOPER! DEVELOPER!
    DEVELOPER!
    @YAMMER

    View full-size slide

  5. Alcatraz
    Kiwi
    xcpretty
    Objective[Sugar,Record]
    ...

    View full-size slide

  6. DITCH THE SPEC SERVER
    WRITE MODULAR CODE
    TEST COMPONENTS TOGETHER

    View full-size slide

  7. DITCH THE SPEC SERVER

    View full-size slide

  8. PRIVATE SPEC SERVER
    edit source
    commit
    tag
    publish podspec

    View full-size slide

  9. NO PRIVATE SPEC SERVER
    edit source
    commit
    tag

    View full-size slide

  10. NEW DEVELOPERS NEED TO
    ADD THE PRIVATE SERVER
    WHERE DOES THE POD COME FROM?

    View full-size slide

  11. NO PRIVATE SPEC SERVER
    USE :GIT
    pod 'SiliconKit', :git => 'pods.local/siliconkit.git'
    OPTIONALLY, USE :TAGS
    pod 'SiliconKit', :git => '...', :tag => '1.0.3'

    View full-size slide

  12. MODULAR CODE

    View full-size slide

  13. !"" Source
    # !"" Data
    # !"" Investors
    # !"" Networking
    # # !"" Authentication
    # # !"" Companies
    # # !"" Investitions
    # $"" Presenters

    View full-size slide

  14. VALUES AS
    BOUNDRIES
    TAKE A VALUE, RETURN A VALUE. NO DEPS.

    View full-size slide

  15. SCDTHREAD -> SCDFORMATTER ->
    NSSTRING

    View full-size slide

  16. SCDTHREAD.RECIPIENTS -> NSARRAY ->
    SCDFORMATTER -> NSSTRING

    View full-size slide

  17. TESTING
    DHH IS DEAD. LONG LIVE TDD

    View full-size slide

  18. HOW DO WE RUN
    THEM?

    View full-size slide

  19. XCPROJCEPTION

    View full-size slide

  20. TWO PODSPECS
    SILICONKIT.PODSPEC
    SILICONKITTESTS.PODSPEC

    View full-size slide

  21. CAN WE DO BETTER?

    View full-size slide

  22. EXCLUSIVE PODSPECS
    s.subspec 'ARC' do |arc|
    arc.source_files = 'SiliconKit/**/*.{h,m}'
    arc.requires_arc = true
    end
    s.test_spec do |test|
    test.source_files = 'SiliconKitTests/**/*.{h,m}'
    test.framework = 'XCTest'
    test.dependency 'Kiwi/ARC'
    test.dependency 'Kiwi/NonARC'
    end

    View full-size slide

  23. CONTINUOUS
    INTEGRATION
    TEST ALL THE COMPONENTS SEPARATELY
    TEST ALL THE COMPONENTS TOGETHER

    View full-size slide

  24. SEPARATELY
    QUICK FEEDBACK
    EASY TO SPOT A PROBLEM

    View full-size slide

  25. TOGETHER
    SLOWER
    SLEEP WELL

    View full-size slide

  26. THANKS
    @ORTA
    TWILIO
    ALTCONF

    View full-size slide