Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
XcodeGen超入門
Search
giginet
PRO
January 21, 2020
Technology
10
3.3k
XcodeGen超入門
try! Swift Tokyo 2020 Meetup!!
https://tryswifttokyo.connpass.com/event/160481/
giginet
PRO
January 21, 2020
Tweet
Share
More Decks by giginet
See All by giginet
Creating Intuitive Developer Tool in Swift
giginet
PRO
0
1.1k
Mergeable Libraryで 高速なアプリ起動を実現しよう!
giginet
PRO
2
4.4k
5分でわかるExplicitly Built Modules
giginet
PRO
0
630
Introduction for Open Source Swift Workshop
giginet
PRO
0
1.5k
Swift Packageを使った 巨大な依存グラフのキャッシュ戦略
giginet
PRO
5
5k
Deep Dive into Mergeable Library
giginet
PRO
1
1.8k
Go beyond the Actor Boundary ~ Swift 6へのConcurrency対応 ~
giginet
PRO
1
3.4k
新しいビルドツールScipioのご紹介
giginet
PRO
3
1.1k
ポケモンで学ぶiOS 16弾丸ツアー 🚅
giginet
PRO
1
940
Other Decks in Technology
See All in Technology
AWS re:Invent 2024で発表された コードを書く開発者向け機能について
maruto
0
180
KubeCon NA 2024 Recap / Running WebAssembly (Wasm) Workloads Side-by-Side with Container Workloads
z63d
1
240
私なりのAIのご紹介 [2024年版]
qt_luigi
1
120
なぜCodeceptJSを選んだか
goataka
0
160
アップデート紹介:AWS Data Transfer Terminal
stknohg
PRO
0
180
サイバー攻撃を想定したセキュリティガイドライン 策定とASM及びCNAPPの活用方法
syoshie
3
1.2k
20241214_WACATE2024冬_テスト設計技法をチョット俯瞰してみよう
kzsuzuki
3
440
大幅アップデートされたRagas v0.2をキャッチアップ
os1ma
2
520
AI時代のデータセンターネットワーク
lycorptech_jp
PRO
1
280
LINEヤフーのフロントエンド組織・体制の紹介【24年12月】
lycorp_recruit_jp
0
530
Snykで始めるセキュリティ担当者とSREと開発者が楽になる脆弱性対応 / Getting started with Snyk Vulnerability Response
yamaguchitk333
2
180
マイクロサービスにおける容易なトランザクション管理に向けて
scalar
0
110
Featured
See All Featured
Build your cross-platform service in a week with App Engine
jlugia
229
18k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
Optimizing for Happiness
mojombo
376
70k
Why Our Code Smells
bkeepers
PRO
335
57k
Fireside Chat
paigeccino
34
3.1k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Testing 201, or: Great Expectations
jmmastey
40
7.1k
Designing on Purpose - Digital PM Summit 2013
jponch
116
7k
Building a Scalable Design System with Sketch
lauravandoore
460
33k
RailsConf 2023
tenderlove
29
940
Fashionably flexible responsive web design (full day workshop)
malarkey
405
66k
Mobile First: as difficult as doing things right
swwweet
222
9k
Transcript
XcodeGenೖ try! Swift Tokyo 2020 Meetup!! @giginet
୭ • ΫοΫύουϞόΠϧج൫෦ • ج൫վળ͍ͯ͠Δ • Core Commiter of fastlane/Carthage/
XcodeGen • झຯɿϙέοτϞϯελʔιʔυγʔ ϧυ
XcodeGenͱ • XcodeϓϩδΣΫτ(*.pbxproj)Λఆ͔ٛΒࣗಈੜ͢Δ։ൃ πʔϧ
project.yml targets: MyApp: type: application platform: iOS sources: - path:
MyApp
$ xcodegen Loaded project: Name: MyApp Targets: MyApp: iOS application
Schemes: MyApp ⚙ Generating project... ⚙ Writing project... Created project at MyApp.xcodeproj
None
େنͳiOS։ൃͷ
ΫοΫύουΞϓϦͷ։ൃ • ͍ྺ࢙(2012/8~) • िʹ10ਓҎ্͕։ൃʹࢀՃ • σΧ͍(291,000ߦ) • Ϗϧυ͕͍࣌ؒ
ίϯϑϦΫτ͕ى͜Γ·͘Δ • XcodeͰϑΝΠϧͷՃ͚ͩͰίϯϑϦΫτ͕ൃੜ͢Δ • ΫοΫύουͷΞϓϦͰɺिʹ10ਓҎ্͕։ൃ͍ͯ͠Δͷ ͰɺpbxprojͷίϯϑϦΫτ͕ৗ൧ࣄͩͬͨ
ϓϩδΣΫτ͕ࢄΒ͔Δ • XcodeϓϩδΣΫτɺϑΝΠϧγεςϜ্ͷπϦʔͱϓϩ δΣΫτͷϑΝΠϧҐஔ͕ඞͣ͠Ұக͠ͳ͍ • ιʔτखಈ
λʔήοτͷՃ͕͍͠ • ϚϧνϞδϡʔϧԽɻݱࡏ20λʔήο τ΄Ͳ • ϨϏϡʔ͕͍͠ • ίϯϑϦΫτͷղফ͕ෆՄೳ • ಉ༷ͷઃఆͷίϐʔ͕͍͠
XcodeGenࣄྫ • 2018/11 XcodeGenΛಋೖ • 2019/4 XcodeGenհهࣄΛॻ͍ͨ • 2019/9 XcodeGenίϛολʔʹ
XcodeGenʹΑΔ৽࣌ͷiOSϓϩδΣΫτཧ - ΫοΫύου։ ൃऀϒϩά https://techlife.cookpad.com/entry/2019/04/26/110000
ೖΕͯྑ͔ͬͨ͜ͱ • ϑΝΠϧγεςϜ͔ΒϑΝΠϧπϦʔ ΛΈཱͯͯ͘ΕΔ • ίϯϑϦΫτ͠ͳ͍ • ࢄΒ͔Βͳ͍ • λʔήοτͷՃ༰қʹ
• ઃఆͷมߋ͕͘͢͠
ηοτΞοϓ $ brew install xcodegen • ࣮ࡍͷӡ༻ͰHomebrewͰೖΕͳ͍ํ͕ྑ͍ʢޙड़ʣ
Project Spec • ϓϩδΣΫτͷఆٛϑΝΠϧʢproject.ymlʣ • هड़ํ๏υΩϡϝϯτ XcodeGen/ProjectSpec.md at master ·
yonaskolb/XcodeGen https://github.com/yonaskolb/XcodeGen/blob/master/Docs/ ProjectSpec.md
None
options: deploymentTarget: iOS: "12.0" name: MyApp targets: MyFramework: sources: MyFramework
platform: iOS type: framework sources: MyFramework MyApp: type: application platform: iOS sources: MyApp settings: base: INFOPLIST_FILE: MyApp/Info.plist PRODUCT_BUNDLE_IDENTIFIER: com.myapp Debug: GCC_PREPROCESSOR_DEFINITIONS: DEBUG=1 dependencies: - target: MyFramework
ߴͳػೳ
Include • ଞͷProject SpecΛͯ͠ಡΈࠐΊΔ • ෳͷSpecϚʔδ͞ΕΔ • ಡΈࠐΜͩॱʹΦʔόʔϥΠυ include: -
other_spec.yml targets: MyApp: ...
Target Template • ςϯϓϨʔτ͔ΒλʔήοτΛෳͰ͖Δ • ϚϧνϞδϡʔϧԽͳͲʹศརɹ targetTemplates: Framework: platform: iOS
type: framework sources: - ${frameworkName} targets: MyFramework: templates: - Framework templateAttributes: frameworkName: AwesomeFramework
Carthage • CarthageͷґଘؔΛهड़Ͱ͖Δ • ґଘؔͷઃఆCopy FrameworkͳͲউखʹૠೖͯ͘͠ΕΔ targets: MyTarget: dependencies: -
target: MyFramework - carthage: RxSwift MyFramework: type: framework
None
SwiftPM • SwiftPMύοέʔδΛΈࠐΊΔ packages: Yams: url: https://github.com/jpsim/Yams from: 2.0.0 targets:
App: dependencies: - package: Yams
Α͋͘Δ࣭
ສ͕ҰXcodeGenͷ։ൃ͕ࢭ·ͬͨΒࠔΓ·ͤΜ͔ʁ • Xcode͕ޙํޓੑΛอ͍ͬͯΔݶΓେৎ • ݹ͍όʔδϣϯͰ࡞ͨ͠৽͍͠Ͱ։͚Δ • ສ͕ҰXcodeGenΛΊ͍ͨͱ͖ɺ࠷ऴՌΛ·ͨϦϙδ τϦʹؚΊΕOK
νʔϜશମͰXcodeGenΛ͍͍ͨͰ͢ • Mint + MintfileΛ༻͍ͨόʔδϣϯཧΛ͍ͯ͠Δ • νʔϜͰXcodeGenࣗମͷόʔδϣϯΛἧ͍͑ͨͨΊ • minimumXcodeGenVersion ࢦఆͰ͖Δ
Mintfile yonaskolb/
[email protected]
setup.sh $ mint run XcodeGen xcodegen
CocoaPodsΛ͍͍ͨͰ͢ • xcodegenͰੜ͔ͯ͠Β pod install ͠·͠ΐ͏ • CocoaPods *.xcodeproj ΛݩʹઃఆΛೖͯ͠
*.xcworkspaceΛੜ͢ΔͨΊɺຖճ࣮ߦ͕ඞཁ • Shell ScriptͳͲͰbootstrapͷखஈΛ༻ҙ͓ͯ͘͠ $ xcodegen $ pod install
ঃʑʹطଘͷϓϩδΣΫτΛҠߦ͍ͨ͠Ͱ͢ • ϑΝΠϧཧ͔Β࢝ΊΔɻಉ͡GroupͷΛಉ͡σΟϨΫτϦ ʹҠ͢ • طଘͷϓϩδΣΫτϦϙδτϦʹͨ͠··ɺXcodeGenͰ্ ॻ͖͢Δͷ͕Φεεϝ • CIڥ͔ΒҰ෦ͷਓ͔ΒҠߦͯ͠ɺͷͪʹશ։ൃऀʹదԠ
1. ϑΝΠϧཧ͢Δ 2. project.ymlॻ͘ɻطଘͷ*.xcodeprojignore͠ͳ͍ 3. ಛఆͷڥ͚ͩXcodeGenΛ࣮ߦ͢ΔɻطଘͷxcodeprojΛ্ॻ ͖͠ɺ͠Β͕͘ແ͍͔ࢹ͢Δ • CI্ͷΈɻڥมΛ༗ޮʹͨ͠ͱ͖ͷΈ 4.
ྑͦ͞͏ͳΒຖճηοτΞοϓΛඞਢʹ͢Δɻ *.xcodeprojΛ ϦϙδτϦ͔Βআͯ͠ignore
Θͳ͍͖ϓϩδΣΫτ͋Γ·͔͢ʁ • খنͳϓϩδΣΫτඞͣ͠ෆཁ • Ҡߦʹίετ͕͔͔ΔͷͰϓϩδΣΫτͷنʹΑΔ • ࠷ॳ͔ΒೖΕͯྑ͍ • ΞϓϦέʔγϣϯҎ֎ʢϥΠϒϥϦʣͰΘͳ͍ํ͕ແ •
SwiftPMࣗମ͕*.xcodeprojΛੜ͢ΔػೳΛ͍࣋ͬͯΔ • CarthageରԠͷͨΊʹ݁ہ*.xcodeproj͕ඞཁ
XcodeGenͷߩݙ
ίϛολʔͰ͢ • 4Ґͷίϛοτྔ • ඞཁͳػೳΛೖΕͯͨΒ͜͏ͳͬͨ
None
ڥηοτΞοϓ 1. git clone https://github.com/yonaskolb/XcodeGen.git 2. XcodeͰSwift Packageͱͯ͠։͘
σόοάํ๏ • xcodegenεΩʔϚΛϏϧυͯ͠σόοά • XcodeͷεΩʔϚͰίϚϯυϥΠϯҾΛ͢ͷ͕Φεεϝ
PRΛૹΔ • ԿΛղܾ͍ͨ͠ͷ͔ॻ͘(Motivation) • όάͷ߹࠶ݱঢ়گΛॻ͘(Project SpecͳͲ) • मਖ਼ޙͷڍಈΛॻ͘(Description) • εΫϦʔϯγϣοτషΔ
• Ϣχοτςετॻ͘ • ӳޠؤுΔ
ྫ • @giginet͕ߦͬͨվળΛ͍͔ͭ͘հ
-pΦϓγϣϯͷ૬ରύε͕յΕΔ https://github.com/yonaskolb/XcodeGen/pull/681
Carthage Static FrameworkରԠ targets: MyTarget: dependencies: - carthage: AStaticFramework linkType:
static https://github.com/yonaskolb/XcodeGen/pull/688
એ • SwiftPMύοέʔδͷ։ൃख๏ཱ͕ ͭ • SwiftPMೖهࣄΛॻ͖·ͨ͠ • WEB+DB PRESS Vol.115
20202݄22 ൃച • ʰXcode 11ʹΑΔSwiftύοέʔδೖ ʱ
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ • ࠙ձͰͳΜͰฉ͍ͯ͘Εʂʂʂ • XcodeGenɺfastlaneɺCarthageɺϙέϞϯͳͲ