-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathconfig.gradle
152 lines (128 loc) · 5.56 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
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
ext {
android = [
compileSdkVersion : 30,
minSdkVersion : 19,
targetSdkVersion : 30,
versionCode : 8,
versionName : "v1.7",
]
version = [
//appcompat
AppCompat : "1.1.0",
//material
Material : "1.0.0",
//constraintlayout
Constraintlayout : "1.1.3",
//multidex
Multidex : "2.0.1",
//db
LitepalVersion : "3.0.0",
//gilde
Gilde : "4.8.0",
//network
RetrofitVersion : "2.4.0",
//rxJava2
Rxjava2Version : "2.2.2",
RxAndroidVersion : "2.1.0",
RxRelayVersion : "2.1.0",
//dagger2
Dagger2Version : "2.18",
BufferKinfeVersion : "10.0.0",
//leakcanary
LeakCanaryVersion : "1.6.2",
//ui
BaseAdapterVersion : "2.9.43-alpha1",
SmartrefreshVersion : "1.1.0-alpha-14",
AgentWebVersion : "4.0.2",
FlowLayout : "1.1.2",
BannerVersion : '1.4.10',
VerticalTabLayoutVersion : '1.2.5',
YViewPagerDemoVersion : '0.4',
TwinklingRefreshLayoutVersion : '1.0.7',
MultiWaveHeaderVersion : '1.0.0-alpha-1',
ImageCropperVersion : '2.8.0',
//test
JunitVersion : "4.12",
RunnerVersion : "1.1.0",
EspressoVersion : "3.1.0",
MocktioVersion : "2.8.9"
]
support = [
appcompat : "androidx.appcompat:appcompat:${version.AppCompat}",
material : "com.google.android.material:material:${version.Material}",
constraintlayout : "androidx.constraintlayout:constraintlayout:${version.Constraintlayout}",
multidex : "androidx.multidex:multidex:${version.Multidex}",
]
custom = [
"loading" : "com.github.rain9155:Loading:1.0.1",
"waveloading" : "com.jianyu:waveloadingview:1.0.0",
"permission" : "io.github.rain9155:permissionhelper:2.0.0"
]
core = [
//dp
"litepal" : "org.litepal.android:java:${version.LitepalVersion}",
//image
"gilde" : "com.github.bumptech.glide:glide:${version.Gilde}",
//network
"retrofit" : "com.squareup.retrofit2:retrofit:${version.RetrofitVersion}",
"retrofitGsonConvert" : "com.squareup.retrofit2:converter-gson:${version.RetrofitVersion}",
"retrofitRxjava2Adapter": "com.squareup.retrofit2:adapter-rxjava2:${version.RetrofitVersion}",
//rxjava
"rxJava2" : "io.reactivex.rxjava2:rxjava:${version.Rxjava2Version}",
"rxAndroid" : "io.reactivex.rxjava2:rxandroid:${version.RxAndroidVersion}",
"rxRelay" : "com.jakewharton.rxrelay2:rxrelay:${version.RxRelayVersion}",
]
inject = [
//dagger2
"dagger2" : "com.google.dagger:dagger:${version.Dagger2Version}",
//bufferKinfe
"bufferKinfe" : "com.jakewharton:butterknife:${version.BufferKinfeVersion}",
]
compiler = [
"gildeCompiler" : "com.github.bumptech.glide:compiler:${version.Gilde}",
"dagger2Complier" : "com.google.dagger:dagger-compiler:${version.Dagger2Version}",
"bufferKinfeCompiler" : "com.jakewharton:butterknife-compiler:${version.BufferKinfeVersion}",
]
ui = [
"baseAdapter" : "com.github.CymChad:BaseRecyclerViewAdapterHelper:${version.BaseAdapterVersion}",
"smartrefresh" : "com.scwang.smartrefresh:SmartRefreshLayout:${version.SmartrefreshVersion}",
"smartrefreshHeader" : "com.scwang.smartrefresh:SmartRefreshHeader:${version.SmartrefreshVersion}",
"agentWeb" : "com.just.agentweb:agentweb:${version.AgentWebVersion}",
"flowLayout" : "com.hyman:flowlayout-lib:${version.FlowLayout}",
"banner" : "com.youth.banner:banner:${version.BannerVersion}",
"verticalTablayout" : "q.rorbin:VerticalTabLayout:${version.VerticalTabLayoutVersion}",
"twinklingRefreshLayout" : "com.lcodecorex:tkrefreshlayout:${version.TwinklingRefreshLayoutVersion}",
"multiWaveHeader" : "com.scwang.wave:MultiWaveHeader:${version.MultiWaveHeaderVersion}",
"imageCropper": "com.theartofdev.edmodo:android-image-cropper:${version.ImageCropperVersion}",
]
test = [
//leak test
leakCanaryDebug : "com.squareup.leakcanary:leakcanary-android:${version.LeakCanaryVersion}",
leakCanaryRelease : "com.squareup.leakcanary:leakcanary-android-no-op:${version.LeakCanaryVersion}",
leakCanaryDebugSupport : "com.squareup.leakcanary:leakcanary-support-fragment:${version.LeakCanaryVersion}",
//unit test
"junit" : "junit:junit:${version.JunitVersion}",
"runner" : "androidx.test:runner:${version.RunnerVersion}",
"espresso" : "androidx.test.espresso:espresso-core:${version.EspressoVersion}",
"mocktio" : "org.mockito:mockito-core:${version.MocktioVersion}"
]
supportDependency = support.values()
customDependency = custom.values()
coreDependency = core.values()
injectDependency = inject.values()
compilerDependency = compiler.values()
uiDependency = ui.values()
testDependency = test.values()
isRelease = checkRelease()
}
// 通过task判断是否为release,比判断Variant好
def checkRelease() {
def runTasks = gradle.startParameter.taskNames
for (String task : runTasks) {
// 我这里根据task为"assemble"和非"Debug"认定为release
if (task.contains("assemble") && !task.contains("Debug")) {
return true
}
}
return false
}