-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathconfig.gradle
88 lines (74 loc) · 4.05 KB
/
config.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
/**
* config.gradle用于配置项目中各种lib引用和版本号控制
*
* [module_*] 各module版本号及applicationId控制
* 如需在各个module中升级更新版本号,请使用 module_[modulename]*的命名规则
*
* [project.ext.dependVersion] 中创建各个依赖库的版本号控制,需在类库名称后增加‘_version’
*
* [类库maven地址] 中创建各个类库的maven地址,同一类库需要引用多个类时,可以使用数组,要确保类库引用不重复
*
* [项目依赖列表] 中创建可以直接让module引用的依赖列表,以Deps结尾,原则上以类库功能分类,比如网络库,图片处理库
* 尽量不要以类库本身的名字命名依赖列表
*
* 各个module中引用类库时尽量使用项目依赖列表中的项目,不要直接使用类库地址中的项目
*
* 需要添加新的类库时,先查询本列表和项目中是否已引用类似功能的类库,尽量不要添加重复功能的类库
*/
project.ext {
compileSdkVersion = 27
buildToolsVersion = '27.0.3'
minSdkVersion = 16
targetSdkVersion = 27
//主app
module_appApplicationId = 'yang.cehome.com.mvvmdemo'
module_appVersionCode = 0001
module_appVersionName = '1.0.0'
module_appName = 'MVVM'
//引用类库的版本号
dependVersion = [
kotlin_version : '1.2.51',
support_version : '27.1.1',
databinding_version: '3.1.4',
retrofit2_version : '2.3.0',
gson_version : '2.8.5',
rxandroid_version : '2.1.0',
rxjava_version : '2.2.2',
stetho_version : '1.5.0',
room_version : '1.1.1',
okhttp_version : '3.11.0'
]
//*************************类库maven地址**************************
kotlin_base = [kotlin_stdlib_jdk8: "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$dependVersion.kotlin_version"
]
supportLibs = [
design : "com.android.support:design:$dependVersion.support_version",
appcompat_v7: "com.android.support:appcompat-v7:$dependVersion.support_version",
constraint : 'com.android.support.constraint:constraint-layout:1.1.3']
databindingLibs = [databinding: "com.android.databinding:compiler:$dependVersion.databinding_version"]
network = [
retrofit : "com.squareup.retrofit2:retrofit:$dependVersion.retrofit2_version",
retrofit_converters: "com.squareup.retrofit2:converter-gson:$dependVersion.retrofit2_version",
retrofit_adapters : "com.squareup.retrofit2:adapter-rxjava2:$dependVersion.retrofit2_version"]
gson = [gson: "com.google.code.gson:gson:$dependVersion.gson_version"]
rxandroid = [rxandroid: "io.reactivex.rxjava2:rxandroid:$dependVersion.rxandroid_version"]
rxjava = [rxjava: "io.reactivex.rxjava2:rxjava:$dependVersion.rxjava_version"]
stetho = [stetho : "com.facebook.stetho:stetho:$dependVersion.stetho_version",
okhttp_stetho: "com.facebook.stetho:stetho-okhttp3:$dependVersion.stetho_version"]
roomLib = [room_runtime: "android.arch.persistence.room:runtime:$dependVersion.room_version",
room_rxjave2: "android.arch.persistence.room:rxjava2:$dependVersion.room_version",
]
room = [room: "android.arch.persistence.room:compiler:$dependVersion.room_version"]
okhttpLibs = [okhttp : "com.squareup.okhttp3:okhttp:$dependVersion.okhttp_version",
okhttplog: "com.squareup.okhttp3:logging-interceptor:$dependVersion.okhttp_version"]
//********************项目依赖列表**********************
kotlinDeps = [kotlin_base.values()]
supportDeps = [supportLibs.values()]
databindingDeps = [databindingLibs.values()]
networkDeps = [network.values(), gson.values()]
rxDeps = [rxandroid.values(), rxjava.values()]
stethoDeps = [stetho.values()]
roomDeps = [roomLib.values()]
roomDep = [room.values()]
okhttpDep = [okhttpLibs.values()]
}