Slide 1

Slide 1 text

ϩʔΧϧ؀ڥΛՄೳͳݶΓԚછ͠ͳ͍ Xcodeͷ։ൃ؀ڥߏங TechLab LTձ #̍ 2021-03-31 1

Slide 2

Slide 2 text

ੁݪ ༞ @yusuga_ 2

Slide 3

Slide 3 text

؀ڥߏஙͬͯͲ͏ͯ͠·͢ʁ 3

Slide 4

Slide 4 text

؀ڥߏஙͬͯͲ͏ͯ͠·͢ʁ • Carthage 3

Slide 5

Slide 5 text

؀ڥߏஙͬͯͲ͏ͯ͠·͢ʁ • Carthage • CocoaPods 3

Slide 6

Slide 6 text

؀ڥߏஙͬͯͲ͏ͯ͠·͢ʁ • Carthage • CocoaPods • xcodegen 3

Slide 7

Slide 7 text

؀ڥߏஙͬͯͲ͏ͯ͠·͢ʁ • Carthage • CocoaPods • xcodegen • swiftgen 3

Slide 8

Slide 8 text

؀ڥߏஙͬͯͲ͏ͯ͠·͢ʁ • Carthage • CocoaPods • xcodegen • swiftgen • swiftlint 3

Slide 9

Slide 9 text

νʔϜ։ൃͰͷࠔΓ͝ͱ 4

Slide 10

Slide 10 text

ݪҼ 5

Slide 11

Slide 11 text

ݪҼ • ֤ʑͷ؀ڥʹΠϯετʔϧͯ͋͠Δπʔϧʹόʔδϣϯͷࠩҟ ͕͋Δ 5

Slide 12

Slide 12 text

ݪҼ • ֤ʑͷ؀ڥʹΠϯετʔϧͯ͋͠Δπʔϧʹόʔδϣϯͷࠩҟ ͕͋Δ • READMEʹ௕ʑͱ؀ڥߏஙखॱΛॻ͘ͷ͸πϥΠ 5

Slide 13

Slide 13 text

ݪҼ • ֤ʑͷ؀ڥʹΠϯετʔϧͯ͋͠Δπʔϧʹόʔδϣϯͷࠩҟ ͕͋Δ • READMEʹ௕ʑͱ؀ڥߏஙखॱΛॻ͘ͷ͸πϥΠ • ؀ڥߏங͕Ͱ͖ͳ͍ͱ͍͏໰͍߹Θ͕ͤདྷΔͷ΋πϥ͍ 5

Slide 14

Slide 14 text

ݪҼ • ֤ʑͷ؀ڥʹΠϯετʔϧͯ͋͠Δπʔϧʹόʔδϣϯͷࠩҟ ͕͋Δ • READMEʹ௕ʑͱ؀ڥߏஙखॱΛॻ͘ͷ͸πϥΠ • ؀ڥߏங͕Ͱ͖ͳ͍ͱ͍͏໰͍߹Θ͕ͤདྷΔͷ΋πϥ͍ • lockϑΝΠϧͷࠩ෼ͳͲɺؾʹ͠ͳ͍ਓ͸ؾʹͤͣcommit͢Δ ͷ͕πϥ͍ 5

Slide 15

Slide 15 text

ղܾํ๏ 6

Slide 16

Slide 16 text

ղܾํ๏ • ՄೳͳݶΓϩʔΧϧ؀ڥΛԚછ͠ͳ͍Ͱ֤छ؀ڥߏஙπʔϧΛ ࢖༻͢Δ 6

Slide 17

Slide 17 text

ղܾํ๏ • ՄೳͳݶΓϩʔΧϧ؀ڥΛԚછ͠ͳ͍Ͱ֤छ؀ڥߏஙπʔϧΛ ࢖༻͢Δ • makeϑΝΠϧΛλεΫϥϯφʔͱͯ͠࢖༻͠ɺ؀ڥߏஙΛߦ͏ 6

Slide 18

Slide 18 text

໨ඪ Homebrew └─ Mint ├─ Carthage ├─ xcodegen ├─ swiftgen └─ swiftlint bundler └─ CocoaPods 7

Slide 19

Slide 19 text

Homebrew • macOSͷύοέʔδϚωʔδϟ ❯ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/ Homebrew/install/master/install.sh)" 8

Slide 20

Slide 20 text

Homebrew • Homebrewܦ༝ͰΠϯετʔϧ͍ͨ͠πʔϧΛهड़ͨ͠Brewfile Λ༻ҙ brew "mint" 9

Slide 21

Slide 21 text

Homebrew • BrewfileͷπʔϧΛΠϯετʔϧ ❯ brew bundle --no-upgrade --no-lock 10

Slide 22

Slide 22 text

Homebrew • πʔϧؒͷґଘؔ܎ Homebrew └─ Mint 11

Slide 23

Slide 23 text

Mint • Swift੡ͷπʔϧͷύοέʔδϚωʔδϟ • mintܦ༝ͰΠϯετʔϧ͍ͨ͠πʔϧΛهड़ͨ͠MintfileΛ༻ҙ carthage/[email protected] yonaskolb/[email protected] swiftgen/[email protected] realm/[email protected] 12

Slide 24

Slide 24 text

Mint • MintfileͷπʔϧΛΠϯετʔϧ ❯ mint bootstrap 13

Slide 25

Slide 25 text

Mint • πʔϧؒͷґଘؔ܎ Homebrew └─ Mint ├─ Carthage ├─ xcodegen ├─ swiftgen └─ swiftlint 14

Slide 26

Slide 26 text

bundler • gemͷόʔδϣϯͱґଘؔ܎؅ཧπʔϧ1 ❯ gem install bundler 1 όʔδϣϯࢦఆͰͷΠϯετʔϧ: gem install bundler:2.0.2 15

Slide 27

Slide 27 text

bundler • bundlerܦ༝ͰΠϯετʔϧ͍ͨ͠πʔϧΛهड़ͨ͠GemfileΛ ༻ҙ source 'https://rubygems.org' gem 'cocoapods' 16

Slide 28

Slide 28 text

bundler • GemfileͷπʔϧΛΠϯετʔϧ2 ❯ bundle install --path vendor/bundle 2 --path ͸ඇਪ঑ͳͷͰɺΑΓਖ਼͘͠΍Δ৔߹͸ .bundle/config Λ༻ҙ 17

Slide 29

Slide 29 text

bundler • πʔϧؒͷґଘؔ܎ Homebrew └─ Mint ├─ Carthage ├─ xcodegen ├─ swiftgen └─ swiftlint bundler └─ CocoaPods 18

Slide 30

Slide 30 text

؀ڥߏஙํ๏ 19

Slide 31

Slide 31 text

؀ڥߏஙํ๏ • MakefileΛ༻ҙ 19

Slide 32

Slide 32 text

؀ڥߏஙํ๏ • MakefileΛ༻ҙ • γΣϧεΫϦϓτΛ༻ҙ͍ͯͨ͜͠ͱ΋͋ͬͨͷͰ͕͢ɺݸ ਓతʹ͸λεΫϥϯφʔͱͯ͠ͳΒMakefileͷํ͕ॻ͖΍͢ ͍ 19

Slide 33

Slide 33 text

؀ڥߏஙํ๏ • MakefileΛ༻ҙ • γΣϧεΫϦϓτΛ༻ҙ͍ͯͨ͜͠ͱ΋͋ͬͨͷͰ͕͢ɺݸ ਓతʹ͸λεΫϥϯφʔͱͯ͠ͳΒMakefileͷํ͕ॻ͖΍͢ ͍ • zshͳΒmakeίϚϯυͷิ׬΋ޮ͘ 19

Slide 34

Slide 34 text

Makefile setup-tools: brew bundle mint bootstrap bundle install QRίʔυ: github.com/yusuga/xcode-setup/App/Makefile 20

Slide 35

Slide 35 text

Makefile setup-carthage: mint run carthage bootstrap QRίʔυ: github.com/yusuga/xcode-setup/App/Makefile 21

Slide 36

Slide 36 text

Makefile setup-cocoapods: bundle exec pod install QRίʔυ: github.com/yusuga/xcode-setup/App/Makefile 22

Slide 37

Slide 37 text

؀ڥߏஙํ๏ ❯ make • ҎԼ͕࣮ߦ͞ΕΔ 1. brew bundle 2. mint bootstrap 3. bundle install 4. mint run carthage bootstrap 5. mint run swiftgen 6. mint run xcodegen 7. bundle exec pod install 8. open App.xcworkspace QRίʔυ: github.com/yusuga/xcode-setup/App/Makefile 23

Slide 38

Slide 38 text

؀ڥߏஙํ๏ 24

Slide 39

Slide 39 text

؀ڥߏஙํ๏ • Swift੡ͷπʔϧ → Mintfile 24

Slide 40

Slide 40 text

؀ڥߏஙํ๏ • Swift੡ͷπʔϧ → Mintfile • gemͷπʔϧ → Gemfile 24

Slide 41

Slide 41 text

؀ڥߏஙํ๏ • Swift੡ͷπʔϧ → Mintfile • gemͷπʔϧ → Gemfile • Carthage → Cartfile 24

Slide 42

Slide 42 text

؀ڥߏஙํ๏ • Swift੡ͷπʔϧ → Mintfile • gemͷπʔϧ → Gemfile • Carthage → Cartfile • CocoaPods → Podfile 24

Slide 43

Slide 43 text

ࠓޙղܾ͍ͨ͠՝୊ 25

Slide 44

Slide 44 text

ࠓޙղܾ͍ͨ͠՝୊ • HomebrewɺMintɺbundler΋ϩʔΧϧ؀ڥ͔Β੾Γ཭͍ͨ͠ 25

Slide 45

Slide 45 text

ࠓޙղܾ͍ͨ͠՝୊ • HomebrewɺMintɺbundler΋ϩʔΧϧ؀ڥ͔Β੾Γ཭͍ͨ͠ • rbenv͸͋Δ͚Ͳπϥ͍ 25

Slide 46

Slide 46 text

ࠓޙղܾ͍ͨ͠՝୊ • HomebrewɺMintɺbundler΋ϩʔΧϧ؀ڥ͔Β੾Γ཭͍ͨ͠ • rbenv͸͋Δ͚Ͳπϥ͍ • DockerͰղܾ͍ͨ͠ 25

Slide 47

Slide 47 text

ࠓޙղܾ͍ͨ͠՝୊ • HomebrewɺMintɺbundler΋ϩʔΧϧ؀ڥ͔Β੾Γ཭͍ͨ͠ • rbenv͸͋Δ͚Ͳπϥ͍ • DockerͰղܾ͍ͨ͠ • ؀ڥߏஙͷߴ଎Խ 25

Slide 48

Slide 48 text

͝੩ௌ͋Γ͕ͱ͏ ͍͟͝·ͨ͠ʂ QRίʔυ: Zenn.dev ϩʔΧϧ؀ڥΛՄೳͳݶΓԚછ͠ͳ͍Xcodeͷ։ൃ؀ڥߏங 26