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
いまならこう作りたい AWSコンテナ[本格]入門ハンズオン 〜2024年版 ハンズオンの構想〜
horsewin
9
2.1k
「視座」の上げ方が成人発達理論にわかりやすくまとまってた / think_ perspective_hidden_dimensions
shuzon
2
2.2k
オーティファイ会社紹介資料 / Autify Company Deck
autifyhq
9
120k
[JAWS-UG金沢支部×コンテナ支部合同企画]コンテナとは何か
furuton
3
250
AWS re:Inventを徹底的に楽しむためのTips / Tips for thoroughly enjoying AWS re:Invent
yuj1osm
1
560
一休.comレストランにおけるRustの活用
kymmt90
3
580
visionOSでの空間表現実装とImmersive Video表示について / ai-immersive-visionos
cyberagentdevelopers
PRO
1
110
MAMを軸とした動画ハンドリングにおけるAI活用前提の整備と次世代ビジョン / abema-ai-mam
cyberagentdevelopers
PRO
1
110
Oracle Cloud Infrastructureデータベース・クラウド:各バージョンのサポート期間
oracle4engineer
PRO
27
12k
Datachain会社紹介資料(2024年11月) / Company Deck
datachain
3
16k
AWS CDKでデータリストアの運用、どのように設計する?~Aurora・EFSの実践事例を紹介~/aws-cdk-data-restore-aurora-efs
mhrtech
4
650
生成AIと知識グラフの相互利用に基づく文書解析
koujikozaki
1
140
Featured
See All Featured
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
Music & Morning Musume
bryan
46
6.1k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
Measuring & Analyzing Core Web Vitals
bluesmoon
1
40
How GitHub (no longer) Works
holman
311
140k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
355
29k
Statistics for Hackers
jakevdp
796
220k
[RailsConf 2023] Rails as a piece of cake
palkan
51
4.9k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
37
1.8k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.2k
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ɺϙέϞϯͳͲ