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
980
Mergeable Libraryで 高速なアプリ起動を実現しよう!
giginet
PRO
2
4.1k
5分でわかるExplicitly Built Modules
giginet
PRO
0
550
Introduction for Open Source Swift Workshop
giginet
PRO
0
1.5k
Swift Packageを使った 巨大な依存グラフのキャッシュ戦略
giginet
PRO
5
4.9k
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
930
Other Decks in Technology
See All in Technology
RubyのWebアプリケーションを50倍速くする方法 / How to Make a Ruby Web Application 50 Times Faster
hogelog
3
940
アジャイルでの品質の進化 Agile in Motion vol.1/20241118 Hiroyuki Sato
shift_evolve
0
170
サイバーセキュリティと認知バイアス:対策の隙を埋める心理学的アプローチ
shumei_ito
0
390
rootlessコンテナのすゝめ - 研究室サーバーでもできる安全なコンテナ管理
kitsuya0828
3
390
DynamoDB でスロットリングが発生したとき_大盛りver/when_throttling_occurs_in_dynamodb_long
emiki
1
410
Terraform CI/CD パイプラインにおける AWS CodeCommit の代替手段
hiyanger
1
240
Lambda10周年!Lambdaは何をもたらしたか
smt7174
2
110
Terraform未経験の御様に対してどの ように導⼊を進めていったか
tkikuchi
2
450
BLADE: An Attempt to Automate Penetration Testing Using Autonomous AI Agents
bbrbbq
0
320
【令和最新版】AWS Direct Connectと愉快なGWたちのおさらい
minorun365
PRO
5
760
CysharpのOSS群から見るModern C#の現在地
neuecc
2
3.4k
第1回 国土交通省 データコンペ参加者向け勉強会③- Snowflake x estie編 -
estie
0
130
Featured
See All Featured
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
Rails Girls Zürich Keynote
gr2m
94
13k
The Cult of Friendly URLs
andyhume
78
6k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
93
16k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
4
370
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
Measuring & Analyzing Core Web Vitals
bluesmoon
4
130
Into the Great Unknown - MozCon
thekraken
32
1.5k
Building Better People: How to give real-time feedback that sticks.
wjessup
364
19k
A Tale of Four Properties
chriscoyier
156
23k
What's in a price? How to price your products and services
michaelherold
243
12k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
65k
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ɺϙέϞϯͳͲ