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
Xcode Meets Gradle
Search
RyuNen344
August 01, 2023
Programming
0
300
Xcode Meets Gradle
RyuNen344
August 01, 2023
Tweet
Share
More Decks by RyuNen344
See All by RyuNen344
サプライチェーン攻撃に備える
ryunen344
0
1.4k
Okioに愛を込めて
ryunen344
3
1.7k
Firebase Hostingを使ってPasskeyをandroidアプリで試してみよう
ryunen344
2
1.4k
わかった気になる、Coroutine1.7.0のチャンネルのパフォーマンス向上
ryunen344
0
330
K/NとNSKeyedArchiverと私
ryunen344
0
440
ComposeのModalBottomSheetは (まだ)沼
ryunen344
1
1.5k
うわっ…もしかして私のコー ド、遅すぎ…?
ryunen344
1
800
K/NでCryptoKit使いたかった
ryunen344
0
360
SwiftPM with KMMをprivateなGitHub Releaseで運用する
ryunen344
0
320
Other Decks in Programming
See All in Programming
AWS Lambdaから始まった Serverlessの「熱」とキャリアパス / It started with AWS Lambda Serverless “fever” and career path
seike460
PRO
1
260
リアーキテクチャxDDD 1年間の取り組みと進化
hsawaji
1
220
Tauriでネイティブアプリを作りたい
tsucchinoko
0
370
ふかぼれ!CSSセレクターモジュール / Fukabore! CSS Selectors Module
petamoriken
0
150
광고 소재 심사 과정에 AI를 도입하여 광고 서비스 생산성 향상시키기
kakao
PRO
0
170
Amazon Qを使ってIaCを触ろう!
maruto
0
400
【Kaigi on Rails 2024】YOUTRUST スポンサーLT
krpk1900
1
330
Streams APIとTCPフロー制御 / Web Streams API and TCP flow control
tasshi
2
350
Quine, Polyglot, 良いコード
qnighy
4
640
シェーダーで魅せるMapLibreの動的ラスタータイル
satoshi7190
1
480
Macとオーディオ再生 2024/11/02
yusukeito
0
370
ピラミッド、アイスクリームコーン、SMURF: 自動テストの最適バランスを求めて / Pyramid Ice-Cream-Cone and SMURF
twada
PRO
10
1.3k
Featured
See All Featured
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
329
21k
KATA
mclloyd
29
14k
Scaling GitHub
holman
458
140k
VelocityConf: Rendering Performance Case Studies
addyosmani
325
24k
Facilitating Awesome Meetings
lara
50
6.1k
Documentation Writing (for coders)
carmenintech
65
4.4k
Optimizing for Happiness
mojombo
376
70k
Building Adaptive Systems
keathley
38
2.3k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
28
2k
Art, The Web, and Tiny UX
lynnandtonic
297
20k
Being A Developer After 40
akosma
86
590k
Transcript
Xcode Meets Gradle 2023.08.01 Mobileษڧձ Wantedly × νʔϜϥϘ #10 Bunjiro
Miyoshi
About Me • teamLab Inc.ॴଐ • (ࣗশ)ϚϧνϓϥοτϑΥʔϜܳਓ • 6݄ʹങͬͨMacBook ProͷηοτΞοϓΛӬԕʹ์ஔͯ͠Δ্ʹ࠷
ۙങͬͨPixel Fold์ஔؾຯ
͢͜ͱɾ͞ͳ͍͜ͱ • ͢͜ͱ • KMMͷςετΛ࣮ߦ͢ΔࡍͷͭΒΈ • xcode, xctest gradle pluginʹ͍ͭͯ
• gradle-xcodePlugin • ͞ͳ͍͜ͱ • Tink/Obj-Cͷ1.7.0ΛCocoaPodsʹpublishͯ͘͠Εͳ͍͜ͱͷෆຬ • ͦͷ͍ͤͰbazelೖ͢Δ͜ͱʹͳͬͨɾɾɾɾ • xcodebuildίϚϯυɺXCTestͷৄࡉͳ͋Ε͜Ε
Tink KMM࡞ͬͯ·͢
Tink KMM࡞ͬͯ·͢ • Google/TinkΛKMMͰ͑ΔΑ͏ʹ͢Δϥούʔ • android͚JavaɺiOS͚C++(obj-c)Ͱ࣮͞Ε͍ͯΔͷΛ ϥοϓ͍ͯ͠Δ • ͜ΕΛ͑಄ΘͣʹAES-GCM−256Λ͑ΔΑ͏ʹͳΔ
KMMͷςετΛ࣮ߦ͢ΔࡍͷͭΒΈ • iosX64Test, iosSimulatorArm64Test͡ΌͩΊͳͷʁ →Swiftఏڙ͢ΔAPI(Obj-C header)ͷมߋ(Ҿ໊ͱ͔)ΛײͰ͖ͳ ͍ • iOSΞϓϦͰͪΌΜͱಈ࡞͢ΔΑ͏ʹͳ͍ͬͯΔͷ͔ෆ҆ →LinkerपΓͷ࠷ऴతͳ֬ೝ͕͍ͨ͠
KMMͷςετΛ࣮ߦ͢ΔࡍͷͭΒΈ • ͱʹ͔͘iOSͷInstrumented TestΛ͖Ε͍ʹཧ͍ͨ͠ • Android StudioͷProject WizardͰ࡞͢Δͱɾɾɾ • XcodeͰ։͘
• shellͰxcodebuildίϚϯυΛ͏ શ෦GradleͰͳΜͱ͔ͨ͠ʔ͍ʂ
Gradleͱ • JVMͰ࣮ߦͰ͖ΔBuild Tool • ͷ͘͢͝ࡶʹݴ͏ͱiOSͰ͍͏ͱ͜ΖͷFastlane • ϓϩδΣΫτߏɺґଘཧɺϏϧυɺςετͳͲͳΜͰ͜ͳ͢ • ݩʑGroovyͰॻ͘ͷ͕ͩͬͨ࠷ۙKotlinͰॻ͘ͷ͕ਪ͞ΕͯΔ
Gradleͱ • PluginʹΑΔػೳ֦ு͕ڧྗ • *͍͍ͩͨͳΜͰͰ͖Δ • android, KMM(Kotlin Multiplatform)PluginʹΑͬͯͨΒ͞Ε͍ͯ Δ
• ެࣜͷPlugin͕αϙʔτ͍ͯ͠ΔͷͬͯҰମԿ͕ɾɾɾɾʁ
Gradleͱ ͍ͬͺ͍͋Δ😋 (ଞʹ͍ͬͺ͍͋Δ)
macOSͱLinux͚ͷ ͋Ε͜Ε͔͠ͳʔ͍😂
FastlaneͰղܾɾɾɾɾ ͍ɺRubyΛࠞࡏͤͨ͘͞ͳʔ͍😂
OSSͷxcodebuildίϚϯυΛϥοϓͯ͘͠ΕΔ openbakery/gradle-xcodePluginΛΈ߹ΘͤΔ
openbakery/gradle-xcodePlugin • xcodebuildίϚϯυΛϥοϓͯ͘͠ΕΔ • archive, KeyChainपΓͷূ໌ॻཧɺplistಡΈࠐΈ࡞ɺॺ໊ɺ Carthage, CocoaPodsपΓؚΊͯϥοϓ͢Δ • App
Store, Deploy Gateͷ৴Ͱ͖Δ • ෳcon fi gɺschemeΛରԠ͢Δʹͪΐͬͱඞཁ(ࠓճ৮Εͳ ͍)
openbakery Tipsᶃ • gradle-xcodePlugin͕͍͔ͭ͘ͷϏϧυ࣌ڥมΛઃఆ͢Δ͕ૉͷ ··Ͱ௨Βͳ͍ͷͰՃઃఆ͕ඞཁ • DerivedDataPath, DSTROOT, OBJROOT, SYMROOT,
SHARED_PRECOMPS_DIR -> plugin͕GradleͷbuildDirʹมߋ͞ΕΔ • SYMROOT͕มΘΔӨڹͰXCTest࣮ߦ࣌ʹappΛಡΈࠐΊͳ͘ͳΔ
openbakery Tipsᶃ ͓͋ʔ😇
openbakery Tipsᶃ additionalParamʹڥมઃఆΛͯ͠ா৲Λ߹ΘͤΔ
openbakery Tipsᶄ • git cloneͯ͠./gradlew :iosApp:xcodetestΛ࣮ߦࣦͯ͠ഊ͢Δ • ./gradlew xcodetest࣮ߦલʹXCFramework͕ੜ͞Ε͍ͯͳ͍ͷ͕ݪҼ •
KMM pluginͰϓϩδΣΫτΛ࡞Δ߹iOSϓϩδΣΫτ2௨Γͷґଘํ๏ͰKMMΛiOSϓϩδΣΫτʹ Ճ͢Δ • Build PhaseͷRun Script • CocoaPods • Run ScriptͰxcframeworkͷు͖ग़͠λΠϛϯά͕͍ • CocoaPods͍ͷͱ৭ʑͳπϥϛΛ๊͑ΔͷͰ͍ͨ͘ͳ͍(1KMMϥΠϒϥϦͷςετ༻ͱͯ͠໌ Β͔ʹToo Much)
openbakery Tipsᶄ • Gradle TaskͷґଘΛͬͯղܾ͢Δ :iosApp:xcodetestΛ:kmm:assembleXCFrameworkʹґଘͤ͞Δ
openbakery Tipsᶄ tasks.dependsOnͰඞͣXCFrameworkੜ͕ઌʹ࣮ߦ͞ΕΔΑ͏ʹ͢Δ
͜͏ͳͬͨ 👇 Ճ͑ͯIDEͷGradleλϒͰϙνϙνͯ͠XCTestΛ࣮ߦͰ͖ΔΑ͏ʹͳͬͨ (ςετ͚ͩ͡Όͳ͘ɺී௨ͷϏϧυϙνϙνͰ࣮ߦͰ͖Δ)
·ͱΊ • Gradleͷxcode, xctest pluginiOSʹରԠ͍ͯ͠ͳ͍ • ͍͔ͭ͘᠘͕͋Δ͕gradle-xcodePluginΛ༻͢ΕXcodeͱ Android StudioͱTerminalΛߦͬͨΓདྷͨΓ͢ΔճΛݮΒͤͨ •
CI্ͰίϚϯυҰൃͰKMMͷϏϧυͱXCTestͷ࣮ߦ͕Ͱ͖ΔΑ͏ʹ ͳͬͯخ͍͠
࠷ޙʹᶃ GitHubͷStar͍ͩ͘͞😉
࠷ޙʹᶄ LTલʹͦΜͳͰ͔͍Ϳͬ͜·Εͯ😇
Ҿ༻ • https://docs.gradle.org/current/userguide/xcode_plugin.html • https://docs.gradle.org/current/userguide/ xctest_plugin.html#xctest_plugin • https://github.com/openbakery/gradle-xcodePlugin • https://github.com/RyuNen344/tink-kmm/pull/116