-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathandroid_project_common.gradle
300 lines (276 loc) · 17.3 KB
/
android_project_common.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
/*
* File: 'android_project_common.gradle'
* Location: https://raw.githubusercontent.com/yongce/AndroidLib/master/android_project_common.gradle
* Version: 2020.08.22
* All android projects can copy and include this file.
*/
allprojects {
configurations.all {
resolutionStrategy {
eachDependency { details ->
if (details.requested.group == 'com.android.support') {
if (details.requested.name == 'multidex'
|| details.requested.name == 'multidex-instrumentation') {
details.useVersion versions.multidexLib
} else {
details.useVersion versions.supportLib
}
} else if (details.requested.group == 'androidx.arch.core') {
details.useVersion versions.archCore
} else if (details.requested.group == 'androidx.lifecycle') {
details.useVersion versions.lifecycle
} else if (details.requested.group == 'androidx.room') {
details.useVersion versions.room
} else if (details.requested.group == 'org.jetbrains.kotlin') {
details.useVersion versions.kotlin
}
}
}
}
}
ext {
appsOutDir = "${rootProject.rootDir}/apps_out"
versions = [
// compile
'compileSdk' : 30,
// Android official support
'kotlin' : '1.4.10',
'kotlinCoroutine' : "1.3.9",
'multidexLib' : "2.0.1",
'androidxCore' : '1.3.2',
'fragment' : '1.2.5',
'preference' : "1.1.1",
'palette' : "1.0.0",
'recyclerView' : "1.1.0",
'constraintLayout' : "2.0.2",
'vectorDrawable' : "1.1.0",
'lintLib' : '27.0.0',
'archCore' : "2.1.0",
'lifecycle' : "2.2.0",
'room' : '2.2.5',
'sqlite' : "2.1.0",
'navigation' : "2.3.0",
'paging' : "2.1.2",
'work' : "2.4.0",
'media2' : "1.0.3",
// test
'testCore' : "1.3.0",
'espresso' : "3.3.0",
'uiautomator' : "2.2.0",
'truth' : '1.0.1',
'hamcrest' : '2.2',
'mockito' : "3.5.11",
'powermock' : '1.6.6',
'robolectric' : '4.3.1',
'mockk' : "1.10.0",
// google
'gms' : '18.0.0',
'wearableSupport' : "2.3.0",
// infrastructure
'butterknife' : "10.2.3",
'timber' : "4.7.1",
'guava' : "29.0-android",
// debug
'leakcanary' : "2.4",
'stetho' : '1.5.1',
'ktlint' : "0.36.0",
// serializing
'gson' : '2.8.6',
'protobuf' : "3.1.0",
// network & image
'okhttp' : '4.8.1',
'retrofit' : '2.9.0',
'glide' : '4.11.0',
'glideTrans' : "4.0.0",
// rx
'rxjava' : "2.2.12",
'rxandroid' : "2.1.1",
// ycdev
'androidLib' : "1.8.5",
// others
'zxing' : '3.4.0',
]
deps = [
// Android official support
'kotlin': [
'stdlib' : "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${versions.kotlin}",
'reflect' : "org.jetbrains.kotlin:kotlin-reflect:${versions.kotlin}",
'coroutinesCore' : "org.jetbrains.kotlinx:kotlinx-coroutines-core:${versions.kotlinCoroutine}",
'coroutinesAndroid' : "org.jetbrains.kotlinx:kotlinx-coroutines-android:${versions.kotlinCoroutine}"
],
'androidx': [
// core
'annotation' : "androidx.annotation:annotation:1.1.0",
'core' : "androidx.core:core:${versions.androidxCore}",
'coreKtx' : "androidx.core:core-ktx:${versions.androidxCore}",
'fragment' : "androidx.fragment:fragment:${versions.fragment}",
'fragmentKtx' : "androidx.fragment:fragment-ktx:${versions.fragment}",
'localBroadcast' : "androidx.localbroadcastmanager:localbroadcastmanager:1.0.0",
'collection' : "androidx.collection:collection:1.1.0",
'collectionKtx' : "androidx.collection:collection-ktx:1.1.0",
// UI
'appcompat' : "androidx.appcompat:appcompat:1.2.0",
'material' : "com.google.android.material:material:1.2.1",
'preference' : "androidx.preference:preference:${versions.preference}",
'preferenceKtx' : "androidx.preference:preference-ktx:${versions.preference}",
'constraintLayout' : "androidx.constraintlayout:constraintlayout:${versions.constraintLayout}",
'cardview' : "androidx.cardview:cardview:1.0.0",
'gridlayout' : "androidx.gridlayout:gridlayout:1.0.0",
'palette' : "androidx.palette:palette:${versions.palette}",
'paletteKtx' : "androidx.palette:palette-ktx:${versions.palette}",
'recyclerview' : "androidx.recyclerview:recyclerview:${versions.recyclerView}",
'recyclerviewSelection' : "androidx.recyclerview:recyclerview:${versions.recyclerView}",
'percent' : "androidx.percentlayout:percentlayout:1.0.0",
'coordinatorLayout' : "androidx.coordinatorlayout:coordinatorlayout:1.1.0",
'drawerLayout' : "androidx.drawerlayout:drawerlayout:1.1.1",
'swipeRefreshLayout' : "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0",
'viewPager' : "androidx.viewpager:viewpager:1.0.0",
'viewPager2' : "androidx.viewpager2:viewpager2:1.0.0",
'vectorDrawable' : "androidx.vectordrawable:vectordrawable:${versions.vectorDrawable}",
'animatedVectorDrawable' : "androidx.vectordrawable:vectordrawable-animated:${versions.vectorDrawable}",
'browser' : "androidx.browser:browser:1.2.0",
'transition' : "androidx.transition:transition:1.3.1",
// others
'multidex' : "androidx.multidex:multidex:${versions.multidexLib}",
'mediaSession' : "androidx.media2:media2-session:${versions.media2}",
'mediaExoPlayer' : "androidx.media2:media2-exoplayer:${versions.media2}",
'mediarouter' : "androidx.mediarouter:mediarouter:1.1.0",
'exifinterface' : "androidx.exifinterface:exifinterface:1.3.0",
'wear' : "androidx.wear:wear:1.0.0",
// legacy
'coreUtils' : "androidx.legacy:legacy-support-core-utils:1.0.0",
'coreUi' : "androidx.legacy:legacy-support-core-ui:1.0.0",
'supportV13' : "androidx.legacy:legacy-support-v13:1.0.0",
],
'archCore': [
'common' : "androidx.arch.core:core-common:${versions.archCore}",
'runtime' : "androidx.arch.core:core-runtime:${versions.archCore}",
'test' : "androidx.arch.core:core-testing:${versions.archCore}",
],
'lifecycle': [
'runtime' : "androidx.lifecycle:lifecycle-runtime:${versions.lifecycle}",
'runtimeKtx' : "androidx.lifecycle:lifecycle-runtime-ktx:${versions.lifecycle}",
'compiler' : "androidx.lifecycle:lifecycle-compiler:${versions.lifecycle}",
'commonJava8' : "androidx.lifecycle:lifecycle-common-java8:${versions.lifecycle}",
'extensions' : "androidx.lifecycle:lifecycle-extensions:${versions.lifecycle}",
'reactiveStreams' : "androidx.lifecycle:lifecycle-reactivestreams:${versions.lifecycle}",
'liveData' : "androidx.lifecycle:lifecycle-livedata:${versions.lifecycle}",
'liveDataKtx' : "androidx.lifecycle:lifecycle-livedata-ktx:${versions.lifecycle}",
'viewModel' : "androidx.lifecycle:lifecycle-viewmodel:${versions.lifecycle}",
'viewModelKtx' : "androidx.lifecycle:lifecycle-viewmodel-ktx:${versions.lifecycle}",
],
'room': [
'runtime' : "androidx.room:room-runtime:${versions.room}",
'compiler' : "androidx.room:room-compiler:${versions.room}",
'rxjava' : "androidx.room:room-rxjava2:${versions.room}",
'testing' : "androidx.room:room-testing:${versions.room}",
'ktx' : "androidx.room:room-ktx:${versions.room}",
'coroutines' : "androidx.room:room-coroutines:${versions.room}",
],
'sqlite': [
'sqlite' : "androidx.sqlite:sqlite:${versions.sqlite}",
'sqliteKtx' : "androidx.sqlite:sqlite-ktx:${versions.sqlite}",
'framework' : "androidx.sqlite:sqlite-framework:${versions.sqlite}",
],
'navigation': [
'common' : "androidx.navigation:navigation-common:${versions.navigation}",
'commonKtx' : "androidx.navigation:navigation-common-ktx:${versions.navigation}",
'fragment' : "androidx.navigation:navigation-fragment:${versions.navigation}",
'fragmentKtx' : "androidx.navigation:navigation-fragment-ktx:${versions.navigation}",
'runtime' : "androidx.navigation:navigation-runtime:${versions.navigation}",
'runtimeKtx' : "androidx.navigation:navigation-runtime-ktx:${versions.navigation}",
'ui' : "androidx.navigation:navigation-ui:${versions.navigation}",
'uiKtx' : "androidx.navigation:navigation-ui-ktx:${versions.navigation}",
],
'paging': [
'common' : "androidx.paging:paging-common:${versions.paging}",
'commonKtx' : "androidx.paging:paging-common-ktx:${versions.paging}",
'runtime' : "androidx.paging:paging-runtime:${versions.paging}",
'runtimeKtx' : "androidx.paging:paging-runtime-ktx:${versions.paging}",
'rxjava2' : "androidx.paging:paging-rxjava2:${versions.paging}",
'rxjava2Ktx' : "androidx.paging:paging-rxjava2-ktx:${versions.paging}",
],
'work': [
"runtime" : "androidx.work:work-runtime:${versions.work}",
"runtimeKtx" : "androidx.work:work-runtime-ktx:${versions.work}",
"rxjava2" : "androidx.work:work-rxjava2:${versions.work}",
"test" : "androidx.work:work-testing:${versions.work}",
],
// test
'test': [
// core
'core' : "androidx.test:core:${versions.testCore}",
'coreKtx' : "androidx.test:core-ktx:${versions.testCore}",
'runner' : "androidx.test:runner:${versions.testCore}",
'rules' : "androidx.test:rules:${versions.testCore}",
'monitor' : "androidx.test:monitor:${versions.testCore}",
'orchestrator' : "androidx.test:orchestrator:${versions.testCore}",
// ext
'junit' : "androidx.test.ext:junit:1.1.2",
'junitKtx' : "androidx.test.ext:junit-ktx:1.1.2",
'truthAndroidX' : "androidx.test.ext:truth:1.3.0",
'truth' : "com.google.truth:truth:${versions.truth}",
'truthJava8' : "com.google.truth.extensions:truth-java8-extension:${versions.truth}",
// espresso
'espressoCore' : "androidx.test.espresso:espresso-core:${versions.espresso}",
'espressoContrib' : "androidx.test.espresso:espresso-contrib:${versions.espresso}",
'espressoIntents' : "androidx.test.espresso:espresso-intents:${versions.espresso}",
'espressoIdling' : "androidx.test.espresso:espresso-idling-resource:${versions.espresso}",
'uiautomator' : "androidx.test.uiautomator:uiautomator:${versions.uiautomator}",
'hamcrestCore' : "org.hamcrest:hamcrest-core:${versions.hamcrest}",
'hamcrestLibrary' : "org.hamcrest:hamcrest-library:${versions.hamcrest}",
'mockitoCore' : "org.mockito:mockito-core:${versions.mockito}",
'powermockMockito' : "org.powermock:powermock-api-mockito:${versions.powermock}",
'powermockJunit' : "org.powermock:powermock-module-junit4:${versions.powermock}",
'mockk' : "io.mockk:mockk:${versions.mockk}",
'mockkAndroid' : "io.mockk:mockk-android:${versions.mockk}",
'robolectric' : "org.robolectric:robolectric:${versions.robolectric}",
],
// google
'google': [
'gmsAuth' : "com.google.android.gms:play-services-auth:${versions.gms}",
'gmsLocation' : "com.google.android.gms:play-services-location:${versions.gms}",
'wearableFramework': "com.google.android.wearable:wearable:${versions.wearableSupport}",
'wearableSupport' : "com.google.android.support:wearable:${versions.wearableSupport}",
],
// infrastructure
'butterknife' : "com.jakewharton:butterknife:${versions.butterknife}",
'butterknifeCompiler' : "com.jakewharton:butterknife-compiler:${versions.butterknife}",
'timber' : "com.jakewharton.timber:timber:${versions.timber}",
'guava' : "com.google.guava:guava:${versions.guava}",
// debug
"leakcanaryDebug" : "com.squareup.leakcanary:leakcanary-android:${versions.leakcanary}",
"leakcanaryRelease" : "com.squareup.leakcanary:leakcanary-android-no-op:${versions.leakcanary}",
'stetho' : "com.facebook.stetho:stetho:${versions.stetho}",
'stethoOkhttp' : "com.facebook.stetho:stetho-okhttp3:${versions.stetho}",
// serializing
'gson' : "com.google.code.gson:gson:${versions.gson}",
'protobufNano' : "com.google.protobuf.nano:protobuf-javanano:${versions.protobuf}",
// network & image
'okhttp' : "com.squareup.okhttp3:okhttp:${versions.okhttp}",
'retrofit' : "com.squareup.retrofit2:retrofit:${versions.retrofit}",
'retrofitScalars' : "com.squareup.retrofit2:converter-scalars:${versions.retrofit}",
'retrofitGson' : "com.squareup.retrofit2:converter-gson:${versions.retrofit}",
'retrofitProtobuf' : "com.squareup.retrofit2:converter-protobuf:${versions.retrofit}",
'retrofitRxjava' : "com.squareup.retrofit2:adapter-rxjava:${versions.retrofit}",
'glide' : "com.github.bumptech.glide:glide:${versions.glide}",
'glideTrans' : "jp.wasabeef:glide-transformations:${versions.glideTrans}",
// UI
'flexbox' : "com.google.android:flexbox:2.0.1",
'lottie' : "com.airbnb.android:lottie:3.4.4",
// rx
'rx': [
'rxjava' : "io.reactivex.rxjava2:rxjava:${versions.rxjava}",
'rxandroid' : "io.reactivex.rxjava2:rxandroid:${versions.rxandroid}",
],
// ycdev
'ycdev': [
'androidBase' : "me.ycdev.android:common-base:${versions.androidLib}",
'androidArch' : "me.ycdev.android:common-arch:${versions.androidLib}",
'androidUi' : "me.ycdev.android:common-ui:${versions.androidLib}",
'androidTest' : "me.ycdev.android:common-test:${versions.androidLib}"
],
// others
'zxingCore' : "com.google.zxing:core:${versions.zxing}",
]
}