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
270
Xcode Meets Gradle
RyuNen344
August 01, 2023
Tweet
Share
More Decks by RyuNen344
See All by RyuNen344
サプライチェーン攻撃に備える
ryunen344
0
280
Okioに愛を込めて
ryunen344
3
1.5k
Firebase Hostingを使ってPasskeyをandroidアプリで試してみよう
ryunen344
2
1.4k
わかった気になる、Coroutine1.7.0のチャンネルのパフォーマンス向上
ryunen344
0
300
K/NとNSKeyedArchiverと私
ryunen344
0
420
ComposeのModalBottomSheetは (まだ)沼
ryunen344
1
1.4k
うわっ…もしかして私のコー ド、遅すぎ…?
ryunen344
1
750
K/NでCryptoKit使いたかった
ryunen344
0
330
SwiftPM with KMMをprivateなGitHub Releaseで運用する
ryunen344
0
310
Other Decks in Programming
See All in Programming
サーバーレスで負荷試験!Step Functions + Lambdaを使ったk6の分散実行
shuntakahashi
6
1.6k
Hono・Prisma・AWSでGeoなAPI開発
nokonoko1203
5
680
KSPの導入・移行を前向きに検討しよう!
shxun6934
PRO
0
280
エンジニア1年目で複雑なコードの改善に取り組んだ話
mtnmr
3
2k
GenU導入でCDKに初挑戦し、悪戦苦闘した話
hideg
0
160
Understand the mechanism! Let's do screenshots tests of Compose Previews with various variations / 仕組みから理解する!Composeプレビューを様々なバリエーションでスクリーンショットテストしよう
sumio
3
780
Jakarta EE meets AI
ivargrimstad
1
500
o1モデルのプロンプトエンジニアリングって?
ktc_wada
0
250
LangGraphでのHuman-in-the-Loopの実装
os1ma
3
1.1k
Modern Angular with the NGRX Signal Store New Rules for Your Architecture @BASTA! 2024 in Mainz
manfredsteyer
PRO
0
140
Shinjuku.rb#95:心の技術書紹介
free_world21
1
110
Some more adventure of Happy Eyeballs
coe401_
2
190
Featured
See All Featured
How To Stay Up To Date on Web Technology
chriscoyier
786
250k
GraphQLの誤解/rethinking-graphql
sonatard
65
9.8k
Testing 201, or: Great Expectations
jmmastey
36
7k
Clear Off the Table
cherdarchuk
91
320k
Why You Should Never Use an ORM
jnunemaker
PRO
53
8.9k
How to Think Like a Performance Engineer
csswizardry
16
960
Debugging Ruby Performance
tmm1
72
12k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
1
50
Adopting Sorbet at Scale
ufuk
73
8.9k
Mobile First: as difficult as doing things right
swwweet
221
8.8k
Music & Morning Musume
bryan
46
6k
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