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
Hierarchical Structure について / About Hierarchica...
Search
Jierong Li
July 29, 2021
Programming
530
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Hierarchical Structure について / About Hierarchical Structure
Jierong Li
July 29, 2021
More Decks by Jierong Li
See All by Jierong Li
一般的な通信でも使える バックグラウンドURLSessionの活用方法 / How to use background URLSession for general network data transfer tasks.
myihsan
0
3k
Multi-Module 101
myihsan
0
360
What’s New in Accessibility WWDC21
myihsan
1
350
Property WrapperでDecodableのデフォルト値を設定 / Providing Default Value for Decodable Property by Property Wrapper
myihsan
1
360
モックフレームワーク比較 / Mocking Framework Comparison
myihsan
0
550
Other Decks in Programming
See All in Programming
Inside Stream API
skrb
1
800
正しくソフトウェアを作る、前提を疑うための認知の視点 / doubt-premise
minodriven
21
7.1k
その問い、本当に正しいですか?AI時代のエンジニアに必要な哲学と認知科学 / ai-philosophy-cognitive-science
minodriven
14
6.4k
[2026年度第1回ORセミナー] 計画最適化ベンチャーと競技プログラミング人材
terryu16
0
280
1B+ /day規模のログを管理する技術
broadleaf
0
120
Oxlintのカスタムルールの現況
syumai
6
1.2k
そのテスト、説明できますか?~LWテスト戦略FW~のご紹介
nakahara
0
170
Vite+ Unified Toolchain for the Web
naokihaba
0
360
ローカルLLMでどこまでコードが書けるか -拡張版 / How much code can be written on a local LLM Extended
kishida
12
4.5k
Spec Driven Development | AI Summit Lisbon
danielsogl
PRO
0
220
TAKTでAI駆動開発の品質を設計する
j5ik2o
7
1.5k
キャリア迷子上等 ─ "ない道"は自分で作ればいい
16bitidol
3
2.3k
Featured
See All Featured
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
400
How STYLIGHT went responsive
nonsquared
100
6.2k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.9k
How Software Deployment tools have changed in the past 20 years
geshan
0
34k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Building the Perfect Custom Keyboard
takai
2
800
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
201
75k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
1.1k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
260
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
140
Transcript
HIERARCHICAL STRUCTURE について KOTLIN MULTIPLATFORM MOBILE勉強会 WANTEDLY × チームラボ #2
⾃⼰紹介 JIERONG LI (李) ▸ 株式会社ゆめみ ▸ iOSエンジニア ▸ KMMでAndroid開発キャッチアップ
▸ 永遠にリリースできず個⼈開発 ▸ https://jierong.dev
HIERARCHICAL STRUCTURE とは
HIERARCHICAL STRUCTURE とは コード共有の階層化 同じプラットフォームでアーキテクチャー複数
HIERARCHICAL STRUCTURE とは HIERARCHY STRUCTURE 有効にする gradle.propertiesに下記を追加するだけ kotlin.mpp.enableGranularSourceSetsMetadata=true
HIERARCHICAL STRUCTURE とは ⼿動で定義 kotlin { iosX64() iosArm64() sourceSets {
val commonMain by sourceSets.getting val iosX64Main by sourceSets.getting val iosArm64Main by sourceSets.getting val iosMain by sourceSets.creating { dependsOn(commonMain) iosX64Main.dependsOn(this) iosArm64Main.dependsOn(this) } } }
HIERARCHICAL STRUCTURE とは シートカット ▸ ios ▸ iosArm64、iosX64 ▸ watchOS
▸ watchosArm32、watchosArm64、watchosX64 ▸ tvOS ▸ tvosArm64、tvosX64
HIERARCHICAL STRUCTURE とは TARGET SHORTCUT kotlin { ios() }
既知の不具合
既知の不具合 コード補完とシンタックス ハイライトが機能しない ▸ 外部依存(公式情報) ▸ Hierarchical structureサポートしないmultiplatformライブラリー ▸ サードパーティ
ネーティブ ライブラリー ▸ マルチモジュール(DroidKaigi / conference-app-2021で発覚)
既知の不具合 外部依存による不具合のワークアラウンド kotlin { val iosTarget: (String, KotlinNativeTarget.() -> Unit)
-> KotlinNativeTarget = if (System.getenv("SDK_NAME") ? . startsWith("iphoneos") == true) :: iosArm64 else :: iosX64 iosTarget("ios") }
既知の不具合 外部依存による不具合のワークアラウンド ビルド対象アーキテクチャーのみターゲットを作り、ターゲット名をiosにする (iosMainがソースになる) ▸ アーキテクチャーひとつずつでビルドする場合が⼗分 ▸ XCFramework配布で両⽅のアーキテクチャーが必要な場合では不都合
既知の不具合 外部依存による不具合のワークアラウンド・改 kotlin { iosArm64() iosX64("ios") sourceSets { val iosMain
by getting val iosArm64Main by getting { dependsOn(iosMain) } } }
既知の不具合 外部依存による不具合のワークアラウンド・改 ビルド対象に関わらず⽚⽅のターゲット名をiosにし(iosMainがソースになる)、もう⽚⽅からiosMainを依存 ▸ 両⽅のアーキテクチャーのターゲットが存在 ▸ テストがある場合 ▸ IntelプロセッサのMacでしか実⾏できない ▸
iosArm64ターゲットではテストタスクがない ▸ Appleシリコン未対応のが原因かも ▸ iosX64のターゲット名をiosにする必要がある ▸ iosArm64にするとなぜかiosX64Testタスクが依存しているlinkDebugTestIosX64タスクが compileKotlinIos(実質comipleKotlinIosArm64)タスクを依存し、失敗になる
既知の不具合 マルチモジュールによる不具合のワークアラウンド BY WATANAVEX 依存関係の解決にバグがあるようで、明記的にコンパイルさせることで解決 tasks.getByName("preBuild").dependsOn(tasks.getByName("compileKotlinIos"))
HIERARCHICAL STRUCTURE について 参考資料 ▸ Share code on platforms ▸
Workaround to enable IDE support for the shared iOS source set ▸ ワークアラウンド by watanavex