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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Jierong Li
July 29, 2021
Programming
520
1
Share
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
2.9k
Multi-Module 101
myihsan
0
360
What’s New in Accessibility WWDC21
myihsan
1
340
Property WrapperでDecodableのデフォルト値を設定 / Providing Default Value for Decodable Property by Property Wrapper
myihsan
1
350
モックフレームワーク比較 / Mocking Framework Comparison
myihsan
0
550
Other Decks in Programming
See All in Programming
AIを導入する前にやるべきこと
negima
2
360
エラー処理の温故知新 / history of error handling technic
ryotanakaya
7
1.9k
実践ハーネスエンジニアリング:ステアリングループを実例から読み解く / Practical Harness Engineering: Understanding Steering Loops Through Real-World Examples
nrslib
5
5.4k
運転動画を検索可能にする〜Cosmos-Embed1とDatabricks Vector Searchで〜/cosmos-embed1-databricks-vector-search
studio_graph
3
920
Lightning-Fast Method Calls with Ruby 4.1 ZJIT / RubyKaigi 2026
k0kubun
3
3k
クラウドネイティブなエンジニアに向ける Raycastの魅力と実際の活用事例
nealle
2
260
〜バイブコーディングを超えて〜 チームで実験し続けたAI駆動開発
tigertora7571
0
210
AI時代だからこそ「Bloc」を採用する価値があるのかもしれない
takuroabe
0
180
開発とはなにか、Essenceカーネルで見えるもの
ukin0k0
0
170
Liberating Ruby's Parser from Lexer Hacks
ydah
2
2.7k
サークル参加から学ぶ、小さな事業の回し方
yuzneri
0
180
属人化しないコード品質の作り方_2026.04.07.pdf
muraaano
0
350
Featured
See All Featured
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
200
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
140
Docker and Python
trallard
47
3.8k
SEO for Brand Visibility & Recognition
aleyda
0
4.5k
WCS-LA-2024
lcolladotor
0
590
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
740
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
180
Game over? The fight for quality and originality in the time of robots
wayneb77
1
170
Mind Mapping
helmedeiros
PRO
1
190
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
270
The agentic SEO stack - context over prompts
schlessera
0
780
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.4k
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