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.7k
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
IBC 2024 動画技術関連レポート / IBC 2024 Report
cyberagentdevelopers
PRO
0
110
BLADE: An Attempt to Automate Penetration Testing Using Autonomous AI Agents
bbrbbq
0
300
スクラムチームを立ち上げる〜チーム開発で得られたもの・得られなかったもの〜
ohnoeight
2
350
テストコード品質を高めるためにMutation Testingライブラリ・Strykerを実戦導入してみた話
ysknsid25
7
2.6k
Adopting Jetpack Compose in Your Existing Project - GDG DevFest Bangkok 2024
akexorcist
0
100
これまでの計測・開発・デプロイ方法全部見せます! / Findy ISUCON 2024-11-14
tohutohu
3
370
[CV勉強会@関東 ECCV2024 読み会] オンラインマッピング x トラッキング MapTracker: Tracking with Strided Memory Fusion for Consistent Vector HD Mapping (Chen+, ECCV24)
abemii
0
220
障害対応指揮の意思決定と情報共有における価値観 / Waroom Meetup #2
arthur1
5
470
適材適所の技術選定 〜GraphQL・REST API・tRPC〜 / Optimal Technology Selection
kakehashi
1
170
Terraform CI/CD パイプラインにおける AWS CodeCommit の代替手段
hiyanger
1
240
AWS Lambda のトラブルシュートをしていて思うこと
kazzpapa3
2
170
エンジニア人生の拡張性を高める 「探索型キャリア設計」の提案
tenshoku_draft
1
120
Featured
See All Featured
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
47
2.1k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
How to Ace a Technical Interview
jacobian
276
23k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
4 Signs Your Business is Dying
shpigford
180
21k
Agile that works and the tools we love
rasmusluckow
327
21k
Imperfection Machines: The Place of Print at Facebook
scottboms
265
13k
10 Git Anti Patterns You Should be Aware of
lemiorhan
654
59k
The Art of Programming - Codeland 2020
erikaheidi
52
13k
The Invisible Side of Design
smashingmag
298
50k
GitHub's CSS Performance
jonrohan
1030
460k
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ɺϙέϞϯͳͲ