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

ライブラリとSwiftLintの辛いお話

 ライブラリとSwiftLintの辛いお話

Kohei Tabata

February 14, 2017
Tweet

More Decks by Kohei Tabata

Other Decks in Programming

Transcript

  1. ϥΠϒϥϦͱSwiftLintͷ
    ਏ͍͓࿩
    2017/02/14
    SwiftѪ޷ձ@21Cafe

    View full-size slide

  2. ࣗݾ঺հ
    ɾKohei Tabata(@nerd0geek1)
    ɾSaib Studio LLC
    ɾiOS/MacOS/tvOS Developer
    ɾWAmazingɹɹ ͱ͍͏ελʔτΞοϓͰ
    ɹiOSΞϓϦ։ൃͷ͓ख఻͍
    Said Studio LLC Kohei Tabata
    Next! Remote quick-zip plus

    View full-size slide

  3. Έͳ͞Μɺ
    Swift͸޷͖Ͱ͢ΑͶʁ

    View full-size slide

  4. ϥΠϒϥϦ΋
    ॻ͍ͨΓ͠·͢ΑͶʁ

    View full-size slide

  5. ͦͯ͠ɺ
    SwiftLint΋޷͖Ͱ͢ΑͶʁ

    View full-size slide

  6. Agenda
    ɾSwiftLintͱ͸
    ɾϥΠϒϥϦ΁ಋೖ͢Δࡍͷམͱ݀͠
    ɾͭΒΈ
    ɾAggregateΛ׆༻ͯ͠
    ɾ·ͱΊ

    View full-size slide

  7. SwiftLintͱ͸
    ɾSwiftLintͱ͸ɺRealm͕ࣾ։ൃɾӡ༻͍ͯ͠ΔSwift༻ͷLintπʔϧ
    ɾSwiftʹର͔ͯ͠ͳΓଟ͘ͷछྨͷLintΛ࣮ߦ͢Δ͜ͱ͕Ͱ͖Δ
    ɹɾforce_unwrapΛߦ͍ͬͯΔՕॴΛΤϥʔͱ͢Δ
    ɹɾΫϥεɺϑΝΠϧͷߦ਺ʹԠͯ͡ܯࠂɺΤϥʔΛදࣔ
    ɹɾetc…
    ɾৄ͍͠ΧελϚΠζ΋.swiftlint.ymlΛฤू͢Δ͜ͱͰՄೳ

    View full-size slide

  8. ϥΠϒϥϦ΁ಋೖ͢Δࡍͷམͱ݀͠
    SwiftLintΛϥΠϒϥϦ΁ಋೖ͢Δࡍʹɺ௨ৗͷΞϓϦͱಉ༷ͷํ๏Ͱಋೖͯ͠͠·͏ͱ
    ϥΠϒϥϦͷར༻ऀ͕ਏ͘ͳΔέʔε͕ଘࡏ͢Δ(mixpanel-swiftͰମݧ)

    View full-size slide

  9. ϥΠϒϥϦ΁ಋೖ͢Δࡍͷམͱ݀͠
    SwiftLintΛϥΠϒϥϦ΁ಋೖ͢Δࡍʹɺ௨ৗͷΞϓϦͱಉ༷ͷํ๏Ͱಋೖͯ͠͠·͏ͱ
    ϥΠϒϥϦͷར༻ऀ͕ਏ͘ͳΔέʔε͕ଘࡏ͢Δ(mixpanel-swiftͰମݧ)
    ϥΠϒϥϦͷSwiftLintͷόʔδϣϯͱϢʔβʔͷSwiftLintͷόʔδϣϯ͕ҟͳΔ৔߹

    View full-size slide

  10. ϥΠϒϥϦ΁ಋೖ͢Δࡍͷམͱ݀͠
    SwiftLintΛϥΠϒϥϦ΁ಋೖ͢Δࡍʹɺ௨ৗͷΞϓϦͱಉ༷ͷํ๏Ͱಋೖͯ͠͠·͏ͱ
    ϥΠϒϥϦͷར༻ऀ͕ਏ͘ͳΔέʔε͕ଘࡏ͢Δ(mixpanel-swiftͰମݧ)
    ϥΠϒϥϦɿ0.13.2
    Ϣʔβʔɹɿ0.13.2
    ϥΠϒϥϦͷSwiftLintͷόʔδϣϯͱϢʔβʔͷSwiftLintͷόʔδϣϯ͕ҟͳΔ৔߹

    View full-size slide

  11. ϥΠϒϥϦ΁ಋೖ͢Δࡍͷམͱ݀͠
    SwiftLintΛϥΠϒϥϦ΁ಋೖ͢Δࡍʹɺ௨ৗͷΞϓϦͱಉ༷ͷํ๏Ͱಋೖͯ͠͠·͏ͱ
    ϥΠϒϥϦͷར༻ऀ͕ਏ͘ͳΔέʔε͕ଘࡏ͢Δ(mixpanel-swiftͰମݧ)
    ϥΠϒϥϦɿ0.13.2
    Ϣʔβʔɹɿ0.13.2
    ϥΠϒϥϦͷSwiftLintͷόʔδϣϯͱϢʔβʔͷSwiftLintͷόʔδϣϯ͕ҟͳΔ৔߹

    View full-size slide

  12. ϥΠϒϥϦ΁ಋೖ͢Δࡍͷམͱ݀͠
    SwiftLintΛϥΠϒϥϦ΁ಋೖ͢Δࡍʹɺ௨ৗͷΞϓϦͱಉ༷ͷํ๏Ͱಋೖͯ͠͠·͏ͱ
    ϥΠϒϥϦͷར༻ऀ͕ਏ͘ͳΔέʔε͕ଘࡏ͢Δ(mixpanel-swiftͰମݧ)
    ϥΠϒϥϦɿ0.13.2
    Ϣʔβʔɹɿ0.13.2
    ϥΠϒϥϦɿ0.13.2
    Ϣʔβʔɹɿ0.16.0
    ϥΠϒϥϦͷSwiftLintͷόʔδϣϯͱϢʔβʔͷSwiftLintͷόʔδϣϯ͕ҟͳΔ৔߹

    View full-size slide

  13. ϥΠϒϥϦ΁ಋೖ͢Δࡍͷམͱ݀͠
    SwiftLintΛϥΠϒϥϦ΁ಋೖ͢Δࡍʹɺ௨ৗͷΞϓϦͱಉ༷ͷํ๏Ͱಋೖͯ͠͠·͏ͱ
    ϥΠϒϥϦͷར༻ऀ͕ਏ͘ͳΔέʔε͕ଘࡏ͢Δ(mixpanel-swiftͰମݧ)
    ϥΠϒϥϦɿ0.13.2
    Ϣʔβʔɹɿ0.13.2
    ϥΠϒϥϦɿ0.13.2
    Ϣʔβʔɹɿ0.16.0
    ϥΠϒϥϦͷSwiftLintͷόʔδϣϯͱϢʔβʔͷSwiftLintͷόʔδϣϯ͕ҟͳΔ৔߹

    View full-size slide

  14. ͭΒΈͷݪҼ
    ઌఔͷ໰୊͸ͳͥൃੜͯ͠͠·͔ͬͨʁ
    →Ϗϧυ࣌ʹͷΈ࣮ߦ͍ͨ͠Script͕Archive࣌ʹ΋࣮ߦ͞Εͯ͠·͍ͬͯͨ͜ͱ
    ཧ૝ ݱঢ়

    View full-size slide

  15. Aggregateͱ͸ʁ
    ɾBuild Phase౳Λ੔ཧ͢ΔͨΊͷ΋ͷ
    ɹAdd Target > Cross-platform > Aggregate͔Β௥ՃՄೳɻ

    View full-size slide

  16. Aggregateͷ׆༻๏
    ɾRealmͷϓϩδΣΫτͰ͸ɺSwiftLintͷScriptͷΈΛؚΉAggregateΛ௥Ճ͠ɺ
    ɹͦΕΛݺͼग़͢Α͏ʹͯ͠ར༻͍ͯ͠Δɻ

    View full-size slide

  17. Aggregateͷ׆༻๏
    ɾϥΠϒϥϦຊମͷBuild SchemeΛฤू͠ɺϏϧυ࣌(ΞʔΧΠϒ࣌)ʹͷΈ
    ɹSwiftLint͕૸ΔΑ͏ʹ͢Δ͜ͱ΋Ͱ͖Δ

    View full-size slide

  18. ·ͱΊ
    ɾSwiftLintʹΑΓɺιʔείʔυΛखܰʹ੍ޚ͢Δ͜ͱ͕Ͱ͖Δ
    ɾͦͷ൒໘ɺࠓճͷΑ͏ͳ໰୊ʹ௚໘͢Δ͜ͱ΋ɻ
    ɾAggregateΛར༻͢Δ͜ͱͰରԠՄೳ
    ɾAggregate͸ࠓճͷ໰୊Ҏ֎ʹ΋෯޿͘Ԡ༻Ͱ͖ΔͷͰɺ
    ɹࠓޙ΋ͦͷ఺Λௐ΂͍͖͍ͯͨɻ

    View full-size slide

  19. ࠷ޙʹએ఻
    2/21ʹOrigami͞ΜͰfastlaneษڧձ΍Γ·͢ʂ

    View full-size slide

  20. WAmazingͰ͸iOSΤϯδχΞΛืू͍ͯ͠·͢ʂ
    We are hiring!!
    They

    View full-size slide

  21. ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ɻ

    View full-size slide

  22. ࢀߟ
    ɾManaging Xcode
    ɹ(https://pewpewthespells.com/blog/managing_xcode.html#target-agg)
    ɾSwiftLint
    ɹ(https://github.com/realm/SwiftLint)
    ɾmixpanel-swift
    ɹ(https://github.com/mixpanel/mixpanel-swift/issues/57)
    ɾrealm-cocoa
    ɹ(https://github.com/realm/realm-cocoa)

    View full-size slide