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.7k
公的機関の発表資料に適合した作業環境がBEST__情報機器作業における労働衛生管_理のためのガイドラインについて__を添えて.pdf
fumiyakume
0
380
202212_Kotlinfest2022.pdf
fumiyakume
1
130
All for One なポストモーテム運用と工夫
fumiyakume
1
640
Other Decks in Programming
See All in Programming
Streamlitで実現する自然言語データアプリ開発
ayumu_yamaguchi
1
340
When benchmarks go bad - what I learned from measuring performance wrong
hollycummins
0
160
UnityでSystem.Net.WebSocketsなWebSocketサーバが動かないのでUnity Monoのコードを覗いてみた / about implementing websocket server with unity mono
drumath2237
1
550
大喜利で理解するLLM as a Judge / Understanding LLM-as-a-Judge through Ogiri
rockname
0
190
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
480
なぜCTOを降りてFDEを選んだのか?〜なぜプロダクト企業がFDEで顧客の現場に踏み込むのか〜
gonta
1
160
【加筆修正版】Laravel のアプリケーションをどこにデプロイするか #phpcon_ehime
akase244
0
150
Ghostty + Neovimで作る 透明でカッコ良い開発環境
j341nono
0
150
Are APIs Still Relevant in the AI Era?
soyuka
0
430
GitHubハンズオン講座 — 実務レベルのチーム開発のフローを身につけよう
junhat6
0
120
残高管理から台帳サービスへの進化
artoy
0
170
難しいけど、読めた。- OSSの入口に立った話。
sts11142
0
140
Featured
See All Featured
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.8k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
860
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3k
Tell your own story through comics
letsgokoyo
1
1.1k
4 Signs Your Business is Dying
shpigford
187
23k
HDC tutorial
michielstock
2
940
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
3
4.3k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.9k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
1
550
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.5k
Raft: Consensus for Rubyists
vanstee
142
7.7k
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 はそこまで難しくない