glideVersion : “4.11.0”,
okhttpVersion : “3.11.0”,
retrofitVersion : “2.3.0”,
constraintLayoutVersion: “1.1.3”,
gsonVersion : “2.7”,
rxjavaVersion : “2.2.2”,
rxandroidVersion : “2.1.0”,
…省略…
]
dependencies = [
//base
“constraintLayout” : “androidx.constraintlayout:constraintlayout:${version[“constraintLayoutVersion”]}”,
“appcompat” : “androidx.appcompat:appcompat:${version[“appcompatVersion”]}”,
“coreKtx” : “androidx.core:core-ktx:${version[“coreKtxVersion”]}”,
“material” : “com.google.android.material:material:1.2.1”,
//multidex
“multidex” : “com.android.support:multidex:${version[“multidexVersion”]}”,
//okhttp
“okhttp” : “com.squareup.okhttp3:okhttp:${version[“okhttpVersion”]}”,
“logging-interceptor” : “com.squareup.okhttp3:logging-interceptor:${version[“okhttpVersion”]}”,
//retrofit
“retrofit” : “com.squareup.retro

本文介绍了Android Studio中统一管理依赖的三种方式:Groovy ext扩展函数、buildSrc+kotlin以及Composing builds。Groovy方式虽然方便版本依赖,但不便于代码跟踪。buildSrc方式支持双向跟踪和代码补全,但重构时会重新构建整个项目。Composing builds提供单向跟踪、自动补全,并避免重构时重建整个项目。文中详细阐述了每种方式的使用方法及其优缺点。
最低0.47元/天 解锁文章
4278

被折叠的 条评论
为什么被折叠?



