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
700
Mergeable Libraryで 高速なアプリ起動を実現しよう!
giginet
PRO
2
4k
5分でわかるExplicitly Built Modules
giginet
PRO
0
480
Introduction for Open Source Swift Workshop
giginet
PRO
0
1.4k
Swift Packageを使った 巨大な依存グラフのキャッシュ戦略
giginet
PRO
5
4.8k
Deep Dive into Mergeable Library
giginet
PRO
1
1.7k
Go beyond the Actor Boundary ~ Swift 6へのConcurrency対応 ~
giginet
PRO
1
3.3k
新しいビルドツールScipioのご紹介
giginet
PRO
3
1.1k
ポケモンで学ぶiOS 16弾丸ツアー 🚅
giginet
PRO
1
920
Other Decks in Technology
See All in Technology
ガチ勢によるPipeCD運用大全〜滑らかなCI/CDを添えて〜 / ai-pipecd-encyclopedia
cyberagentdevelopers
PRO
3
200
Jr. Championsになって、強く連携しながらAWSをもっと使いたい!~AWSに対する期待と行動~
amixedcolor
0
190
生成AIと知識グラフの相互利用に基づく文書解析
koujikozaki
1
140
10分でわかるfreeeのQA
freee
1
3.4k
リンクアンドモチベーション ソフトウェアエンジニア向け紹介資料 / Introduction to Link and Motivation for Software Engineers
lmi
4
290k
Java x Spring Boot Warm up
kazu_kichi_67
2
490
[JAWS-UG金沢支部×コンテナ支部合同企画]コンテナとは何か
furuton
3
250
バクラクにおける可観測性向上の取り組み
yuu26
3
420
Oracle Cloud Infrastructureデータベース・クラウド:各バージョンのサポート期間
oracle4engineer
PRO
27
12k
GitHub Universe: Evaluating RAG apps in GitHub Actions
pamelafox
0
170
LeSSに潜む「隠れWF病」とその処方箋
lycorptech_jp
PRO
2
120
大規模データ基盤チームのオンプレTiDB運用への挑戦 / dpu-tidb
cyberagentdevelopers
PRO
1
110
Featured
See All Featured
Mobile First: as difficult as doing things right
swwweet
222
8.9k
Ruby is Unlike a Banana
tanoku
96
11k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.5k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
How GitHub (no longer) Works
holman
311
140k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Thoughts on Productivity
jonyablonski
67
4.3k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
22k
Fashionably flexible responsive web design (full day workshop)
malarkey
404
65k
10 Git Anti Patterns You Should be Aware of
lemiorhan
654
59k
Build The Right Thing And Hit Your Dates
maggiecrowley
32
2.4k
Designing for humans not robots
tammielis
249
25k
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ɺϙέϞϯͳͲ