1
1
ext {
2
- androidConfig = [
3
- applicationId : ' com.blankj.androidutilcode' ,
4
- appName : ' Util' ,
5
-
6
- compileSdkVersion : 27 ,
7
- minSdkVersion : 14 ,
8
- targetSdkVersion : 27 ,
9
- versionCode : 1_021_002,
10
- versionName : ' 1.21.2' // E.g. 1.9.72 => 1,009,072
11
- ]
2
+ applicationId = ' com.blankj.androidutilcode'
3
+ appName = ' Util'
12
4
13
- versionConfig = [
14
- // plugin
15
- gradle : ' 3.2.1' ,
16
- kotlin : ' 1.2.71' ,
17
- // lib
18
- support : ' 27.1.1' ,
19
- constraint : ' 1.0.2' ,
20
- bus : ' 1.0' ,
21
- gson : ' 2.8.2' ,
22
- glide : ' 4.7.1' ,
23
- leakcanary : ' 1.5.4' ,
24
- retrofit : ' 2.4.0' ,
25
- free_proguard : ' 0.0.7' ,
26
- // test
27
- junit : ' 4.12' ,
28
- robolectric : ' 3.1.2'
29
- ]
5
+ compileSdkVersion = 27
6
+ minSdkVersion = 14
7
+ targetSdkVersion = 27
8
+ versionCode = 1_021_002
9
+ versionName = ' 1.21.2' // E.g. 1.9.72 => 1,009,072
10
+
11
+ // lib version
12
+ kotlin_version = ' 1.2.71'
13
+ support_version = ' 27.1.1'
14
+ leakcanary_version = ' 1.5.4'
30
15
31
- depConfig = [
32
- gradle : " com.android.tools.build:gradle:$versionConfig . gradle " ,
33
- kotlin_gradle_plugin : " org.jetbrains.kotlin:kotlin-gradle-plugin:$versionConfig . kotlin " ,
16
+ dep = [
17
+ // plugin
18
+ gradle : " com.android.tools.build:gradle:3.2.1" ,
19
+ kotlin_gradle_plugin : " org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version " ,
34
20
21
+ // lib
35
22
support : [
36
- appcompat_v7 : " com.android.support:appcompat-v7:$v ersionConfig . support " ,
37
- design : " com.android.support:design:$v ersionConfig . support " ,
23
+ appcompat_v7 : " com.android.support:appcompat-v7:$s upport_version " ,
24
+ design : " com.android.support:design:$s upport_version " ,
38
25
],
39
- constraint : " com.android.support.constraint:constraint-layout:$v ersionConfig . constraint " ,
40
- kotlin_stdlib_jdk7 : " org.jetbrains.kotlin:kotlin-stdlib-jdk7:$v ersionConfig . kotlin " ,
26
+ constraint : " com.android.support.constraint:constraint-layout:1.1.3 " ,
27
+ kotlin_stdlib_jdk7 : " org.jetbrains.kotlin:kotlin-stdlib-jdk7:$k otlin_version " ,
41
28
leakcanary : [
42
- android : " com.squareup.leakcanary:leakcanary-android:$v ersionConfig . leakcanary " ,
43
- android_no_op : " com.squareup.leakcanary:leakcanary-android-no-op:$v ersionConfig . leakcanary " ,
29
+ android : " com.squareup.leakcanary:leakcanary-android:$l eakcanary_version " ,
30
+ android_no_op : " com.squareup.leakcanary:leakcanary-android-no-op:$l eakcanary_version " ,
44
31
],
45
- bus : " com.blankj:bus:$versionConfig . bus " ,
46
- gson : " com.google.code.gson:gson:$versionConfig . gson " ,
47
- glide : " com.github.bumptech.glide:glide:$versionConfig . glide " ,
48
- retrofit : " com.squareup.retrofit2:retrofit:$versionConfig . retrofit " ,
49
- free_proguard : " com.blankj:free-proguard:$versionConfig . free_proguard " ,
50
-
51
- junit : " junit:junit:$versionConfig . junit " ,
52
- robolectric : " org.robolectric:robolectric:$versionConfig . robolectric " ,
32
+ free_proguard : " com.blankj:free-proguard:0.0.7" ,
33
+ bus : " com.blankj:bus:1.0" ,
34
+ adapt_screen : " com.blankj:adapt-screen:0.0.3" ,
35
+
36
+ gson : " com.google.code.gson:gson:2.8.2" ,
37
+ glide : " com.github.bumptech.glide:glide:4.7.1" ,
38
+ retrofit : " com.squareup.retrofit2:retrofit:2.4.0" ,
39
+
40
+ junit : " junit:junit:4.12" ,
41
+ robolectric : " org.robolectric:robolectric:3.1.2" ,
53
42
]
54
43
55
44
configAndroidDomain = this . &configAndroidDomain
@@ -71,13 +60,13 @@ def configAppAndroidDomain(Project pro) {
71
60
configSigning(pro)
72
61
configApkName(pro)
73
62
pro. android {
74
- compileSdkVersion androidConfig . compileSdkVersion
63
+ compileSdkVersion rootProject . compileSdkVersion
75
64
defaultConfig {
76
- applicationId androidConfig . applicationId
77
- minSdkVersion androidConfig . minSdkVersion
78
- targetSdkVersion androidConfig . targetSdkVersion
79
- versionCode androidConfig . versionCode
80
- versionName androidConfig . versionName
65
+ applicationId rootProject . applicationId
66
+ minSdkVersion rootProject . minSdkVersion
67
+ targetSdkVersion rootProject . targetSdkVersion
68
+ versionCode rootProject . versionCode
69
+ versionName rootProject . versionName
81
70
}
82
71
83
72
buildTypes {
@@ -100,7 +89,7 @@ def configAppAndroidDomain(Project pro) {
100
89
101
90
def configField (Project pro ) {
102
91
pro. android. defaultConfig {
103
- resValue " string" , " app_name" , androidConfig . appName
92
+ resValue " string" , " app_name" , rootProject . appName
104
93
}
105
94
}
106
95
@@ -135,11 +124,11 @@ def configApkName(Project pro) {
135
124
136
125
def configLibAndroidDomain (Project pro ) {
137
126
pro. android {
138
- compileSdkVersion androidConfig . compileSdkVersion
127
+ compileSdkVersion rootProject . compileSdkVersion
139
128
defaultConfig {
140
- minSdkVersion androidConfig . minSdkVersion
141
- versionCode androidConfig . versionCode
142
- versionName androidConfig . versionName
129
+ minSdkVersion rootProject . minSdkVersion
130
+ versionCode rootProject . versionCode
131
+ versionName rootProject . versionName
143
132
}
144
133
145
134
buildTypes {
@@ -161,8 +150,9 @@ def configLibAndroidDomain(Project pro) {
161
150
}
162
151
}
163
152
164
- pro . afterEvaluate {
153
+ afterEvaluate {
165
154
generateReleaseBuildConfig. enabled = false
155
+ generateDebugBuildConfig. enabled = false
166
156
}
167
157
}
168
158
@@ -173,44 +163,45 @@ def configAppDependencies(Project pro) {
173
163
implementation project(' :utilcode' )
174
164
implementation project(' :subutil' )
175
165
176
- implementation depConfig . support. appcompat_v7
177
- implementation depConfig . support. design
178
- implementation depConfig . constraint
179
- implementation depConfig . free_proguard
166
+ implementation dep . support. appcompat_v7
167
+ implementation dep . support. design
168
+ implementation dep . constraint
169
+ implementation dep . free_proguard
180
170
implementation ' com.r0adkll:slidableactivity:2.0.5'
181
171
// LeakCanary
182
- debugImplementation depConfig . leakcanary. android
183
- releaseImplementation depConfig . leakcanary. android_no_op
172
+ debugImplementation dep . leakcanary. android
173
+ releaseImplementation dep . leakcanary. android_no_op
184
174
// implementation 'com.blankj:utilcode:1.21.2'
185
175
}
186
176
}
187
177
188
178
def configUtilCodeDependencies (Project pro ) {
189
179
pro. dependencies {
190
- api depConfig. bus
180
+ api dep. bus
181
+ api dep. adapt_screen
191
182
192
- compileOnly depConfig . support. appcompat_v7
193
- compileOnly depConfig . support. design
183
+ compileOnly dep . support. appcompat_v7
184
+ compileOnly dep . support. design
194
185
195
- testImplementation depConfig . junit
196
- testImplementation depConfig . robolectric
197
- testImplementation depConfig . support. appcompat_v7
186
+ testImplementation dep . junit
187
+ testImplementation dep . robolectric
188
+ testImplementation dep . support. appcompat_v7
198
189
}
199
190
}
200
191
201
192
def configSubUtilDependencies (Project pro ) {
202
193
pro. dependencies {
203
- compileOnly depConfig . support. appcompat_v7
204
- compileOnly depConfig . support. design
205
-
206
- api depConfig . gson
207
- api(depConfig . glide) {
194
+ compileOnly dep . support. appcompat_v7
195
+ compileOnly dep . support. design
196
+ InetAddress
197
+ api dep . gson
198
+ api(dep . glide) {
208
199
exclude group : " com.android.support"
209
200
}
210
- api depConfig . retrofit
201
+ api dep . retrofit
211
202
212
- testImplementation depConfig . junit
213
- testImplementation depConfig . robolectric
203
+ testImplementation dep . junit
204
+ testImplementation dep . robolectric
214
205
}
215
206
}
216
207
// ./gradlew bintrayUpload
0 commit comments