11ext {
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'
124
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'
3015
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 " ,
3420
21+ // lib
3522 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 " ,
3825 ],
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 " ,
4128 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 " ,
4431 ],
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" ,
5342 ]
5443
5544 configAndroidDomain = this . &configAndroidDomain
@@ -71,13 +60,13 @@ def configAppAndroidDomain(Project pro) {
7160 configSigning(pro)
7261 configApkName(pro)
7362 pro. android {
74- compileSdkVersion androidConfig . compileSdkVersion
63+ compileSdkVersion rootProject . compileSdkVersion
7564 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
8170 }
8271
8372 buildTypes {
@@ -100,7 +89,7 @@ def configAppAndroidDomain(Project pro) {
10089
10190def configField (Project pro ) {
10291 pro. android. defaultConfig {
103- resValue " string" , " app_name" , androidConfig . appName
92+ resValue " string" , " app_name" , rootProject . appName
10493 }
10594}
10695
@@ -135,11 +124,11 @@ def configApkName(Project pro) {
135124
136125def configLibAndroidDomain (Project pro ) {
137126 pro. android {
138- compileSdkVersion androidConfig . compileSdkVersion
127+ compileSdkVersion rootProject . compileSdkVersion
139128 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
143132 }
144133
145134 buildTypes {
@@ -161,8 +150,9 @@ def configLibAndroidDomain(Project pro) {
161150 }
162151 }
163152
164- pro . afterEvaluate {
153+ afterEvaluate {
165154 generateReleaseBuildConfig. enabled = false
155+ generateDebugBuildConfig. enabled = false
166156 }
167157}
168158
@@ -173,44 +163,45 @@ def configAppDependencies(Project pro) {
173163 implementation project(' :utilcode' )
174164 implementation project(' :subutil' )
175165
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
180170 implementation ' com.r0adkll:slidableactivity:2.0.5'
181171 // 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
184174// implementation 'com.blankj:utilcode:1.21.2'
185175 }
186176}
187177
188178def configUtilCodeDependencies (Project pro ) {
189179 pro. dependencies {
190- api depConfig. bus
180+ api dep. bus
181+ api dep. adapt_screen
191182
192- compileOnly depConfig . support. appcompat_v7
193- compileOnly depConfig . support. design
183+ compileOnly dep . support. appcompat_v7
184+ compileOnly dep . support. design
194185
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
198189 }
199190}
200191
201192def configSubUtilDependencies (Project pro ) {
202193 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) {
208199 exclude group : " com.android.support"
209200 }
210- api depConfig . retrofit
201+ api dep . retrofit
211202
212- testImplementation depConfig . junit
213- testImplementation depConfig . robolectric
203+ testImplementation dep . junit
204+ testImplementation dep . robolectric
214205 }
215206}
216207// ./gradlew bintrayUpload
0 commit comments