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
Gradle Plugin for Multi Module
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Kuu
October 23, 2020
Programming
1.5k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Gradle Plugin for Multi Module
Kuu
October 23, 2020
More Decks by Kuu
See All by Kuu
OSSライブラリのVibe調査方法
fumiyakume
3
470
Vibe Codingの幻想を超えて-生成AIを現場で使えるようにするまでの泥臭い話.ai
fumiyakume
23
14k
Cursorを"導入"だけじゃなく"活用"まで メルカリ2000人展開のリアル
fumiyakume
31
45k
業務でVibe Codingするためのガイドレール モバイルアプリ開発編
fumiyakume
0
1.3k
大LLM時代にこの先生きのこるには-ITエンジニア編
fumiyakume
10
4.1k
Junie by JetBrainsという選択肢もありかもしれない。 解いてくれる課題
fumiyakume
0
1.7k
公的機関の発表資料に適合した作業環境がBEST__情報機器作業における労働衛生管_理のためのガイドラインについて__を添えて.pdf
fumiyakume
0
370
202212_Kotlinfest2022.pdf
fumiyakume
1
120
All for One なポストモーテム運用と工夫
fumiyakume
1
620
Other Decks in Programming
See All in Programming
Vite+ Unified Toolchain for the Web
naokihaba
0
340
TAKTでAI駆動開発の品質を設計する
j5ik2o
7
1.5k
ローカルLLMを使ってB2Bサービスを作っていての学び
yaotti
0
210
ふつうのFeature Flag実践入門
irof
8
4.2k
なぜ型を書くのか? TSKaigi2026で改めて考える #tskaigi_smarthr
kajitack
0
150
エージェンティックRAGにAWSで入門しよう!
har1101
9
1.7k
セキュリティの専門家じゃなくてもできる。「セキュリティ意識」をアップデートして サプライチェーン攻撃への耐性を高めよう。
tk3fftk
5
940
はてなアカウント基盤 State of the Union
cockscomb
1
720
スマートグラスで並列バイブコーディング
hyshu
0
260
Performance Engineering for Everyone
elenatanasoiu
0
220
Datadog LLM Observabilityで実現する 安全なLLM Usage 管理
3150
0
110
技術記事、 専門家としてのプログラマ、 言語化
mizchi
13
6.5k
Featured
See All Featured
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
400
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
4k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
Bash Introduction
62gerente
615
220k
Marketing to machines
jonoalderson
1
5.5k
Side Projects
sachag
455
43k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
350
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
1.8k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
310
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
230
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
260
Transcript
Gradle Plugin for Multi Module potatotips #71 iOS/Android開発Tips共有会
kuu Android Engineer @ 株式会社メルカリ 旅行好き。明日は新潟へ GOTO 最近は GCPを触るのが好き。
Multi Module なアプリの 生産性をGradle Pluginで 上げてく
Android アプリ開発の最近の流行 • Android Studio 4.1 ? • Jetpack Compose
? • Kotlin 1.4 ? • Material Component 1.2 ? • Android 5? Multi Module!! 複数 Module での開発へ移行すること Android -> Module iOS -> Framework
Multi Module の Pros/Cons Pros • High Cohesion and Low
Couplingな開発を促進・強制できる • 変更された Module だけCompile するので開発速度が早くなる! (20分待たなくても! ◦ https://developer.android.com/studio/build/optimize-your-build#create_libraries Cons • Single Module 開発と異なり諸々考える必要が出てくる ◦ Test Coverage (Jacoco) ◦ DI(Dagger, Koin...), Resource, Navigation, Dynamic Feature Module… • 各モジュールの管理(Library References, Build Config, Build Variant...) 引用元 https://droidkaigi.github.io/codelab-2020/en/index.html#0 高凝集で低結合
Multi Module 戦略は実際に採用されてるの? • 1-9個のモジュールが60% • 10 - 20 個が
30% 10個以上で構成されてるアプリが 40% https://emmav.me/posts/2019-mar-1-android-modularisation/ 実は、2019年3月時点での調査結果
よくある管理方法 Maven Repository 内にあるArtifact を指定す る文字列を直接各Module の build.gradle(.kts)に記入している。 直接文字列を記入する代わりに BuildSrc
Module 内の定数を利用してArtifact を指定している https://github.com/DroidKaigi/conference-app-2020/blob/master/feature/floormap/build.gradle
Gradle Plugin で各モジュールを管理しよう Library Reference だけじゃなくて、その他の宣言も共通管理したいよね。 .Gradle/.gradle.kts ファイルを直接読み込めばいいのでは Gradle Plugin
を作成し、Apply するだけで使えるようにしたらより便利なのでは。 • Plugin にこれ系の宣言をおまとめできる • なるべく手作業減らしたい。
Gradle Plugin とは Gradle(Android アプリをBuildしてくれるやつ) を拡張するためのもの Android App Template ですでに2つのプラグインが入っている。
• Android Gradle Plugin • Kotlin Gradle Plugin
二行追加するだけでプラグインに全て移譲できる
Internalで使うためだけのプラグインを作成 //TODO ソースコードのURLを貼る You can check the official Document!! •
https://docs.gradle.org/nightly/userguide/designing_gradle_plugins.html • BaseExtension - Android Plugin 3.4.0-dev DSL Reference • https://docs.gradle.org/current/javadoc/org/gradle/api/Project.html#getExtensions--
実際に使ってみて学んだこと ※比較的小規模 Application/Library で処理を分岐することができる Firebase Distribution 等は Application Module だけで使いたいよね
Library Reference は あえて 定数ではなく文字列を置いて管理した方が良さそう ライブラリにアップデートがあることに気づきやすい
Conclusion Multi Module 化は考慮することがたくさん Library Reference の解決策が存在するけど、より改善できるのでは? Internal な Gradle
Plugin はそこまで難しくない