Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Gradle Plugin for Multi Module
Search
Kuu
October 23, 2020
Programming
1.6k
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
500
Vibe Codingの幻想を超えて-生成AIを現場で使えるようにするまでの泥臭い話.ai
fumiyakume
23
15k
Cursorを"導入"だけじゃなく"活用"まで メルカリ2000人展開のリアル
fumiyakume
31
46k
業務でVibe Codingするためのガイドレール モバイルアプリ開発編
fumiyakume
0
1.4k
大LLM時代にこの先生きのこるには-ITエンジニア編
fumiyakume
10
4.2k
Junie by JetBrainsという選択肢もありかもしれない。 解いてくれる課題
fumiyakume
0
1.8k
公的機関の発表資料に適合した作業環境がBEST__情報機器作業における労働衛生管_理のためのガイドラインについて__を添えて.pdf
fumiyakume
0
390
202212_Kotlinfest2022.pdf
fumiyakume
1
130
All for One なポストモーテム運用と工夫
fumiyakume
1
660
Other Decks in Programming
See All in Programming
Snowflake Openflow Connector利用の勘所 / 20261024developersio2026tokyo-snowflake-openflow
kasacchiful
PRO
0
240
Seven New Principles of Software Engineering
yegor256
0
370
コーディング自動化の次へ。人の介入をゼロにするファクトリーとサポートAIによる実践
timakin
5
4.8k
R8 の設定見直しでアプリサイズ削減
andpad
0
230
自作Discord音声botをLambda MicroVMsに移行した話 / Migrating My Discord Voice Bot to Lambda MicroVMs
akihisaikeda
0
180
Compiling a real-world CLI tool to native with Static Hermes
tmikov2023
0
140
sbt 2.0: takeoff
eed3si9n
0
170
AI主導のプログラミング学習アプリを作ってみた
econanringo
0
200
Apple Intelligenceとオンデバイス時代の到来
yahir0
0
160
作れる、でも消せるか?──安全に「枯らして消す」機能削除術 / Drain, Then Delete
chobishiba
2
1.2k
Domain-Driven Transformation
hschwentner
2
2.3k
コードで差別化できない時代の ソフトウェアエンジニアリング / Software Engineering in an Era Where Code Doesn’t Differentiate
kishida
2
210
Featured
See All Featured
SEO for Brand Visibility & Recognition
aleyda
0
4.8k
Building AI with AI
inesmontani
PRO
1
1.3k
Optimizing for Happiness
mojombo
378
71k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.5k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
550
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.7k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Testing 201, or: Great Expectations
jmmastey
46
8.4k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.9k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
203
77k
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 はそこまで難しくない