Skip to content

Commit c920c0f

Browse files
committed
修改gradle统一配置
1 parent be9bedd commit c920c0f

File tree

14 files changed

+153
-217
lines changed

14 files changed

+153
-217
lines changed

app/build.gradle

+28-26
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
apply plugin: 'com.android.application'
22

33
android {
4-
compileSdkVersion 25
5-
buildToolsVersion '27.0.3'
4+
compileSdkVersion 28
5+
buildToolsVersion '28.0.2'
66

77
defaultConfig {
88
applicationId "com.shizhefei.mvc.demo"
9-
minSdkVersion 10
10-
targetSdkVersion 21
11-
versionCode 1
12-
versionName "1.0"
9+
minSdkVersion 14
10+
targetSdkVersion 28
11+
versionCode rootProject.ext.VERSION_CODE
12+
versionName rootProject.ext.VERSION_NAME
1313
}
1414
buildTypes {
1515
release {
@@ -25,37 +25,39 @@ android {
2525

2626
dependencies {
2727
compile fileTree(include: ['*.jar'], dir: 'libs')
28-
testCompile 'junit:junit:4.12'
29-
compile 'com.android.support:appcompat-v7:25.0.1'
30-
compile 'in.srain.cube:ultra-ptr:1.0.11'
31-
compile 'com.android.support:design:25.0.1'
32-
compile 'com.android.support:recyclerview-v7:25.0.1'
33-
compile 'com.google.code.gson:gson:2.2.4'
34-
compile 'com.squareup.retrofit2:retrofit:2.1.0'
35-
compile 'com.squareup.retrofit2:adapter-rxjava:2.1.0'
36-
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
37-
compile 'io.reactivex:rxandroid:1.0.0'
38-
compile 'com.shizhefei:ViewPagerIndicator:1.1.4'
39-
compile 'com.shizhefei:MultiTypeView:1.0.1'
40-
compile 'com.shizhefei:CoolRefreshView:1.0.1'
41-
compile 'de.hdodenhof:circleimageview:2.1.0'
28+
29+
compile rootProject.ext.dependencies["appcompat-v7"]
30+
compile rootProject.ext.dependencies["recyclerview-v7"]
31+
compile rootProject.ext.dependencies["design"]
32+
compile rootProject.ext.dependencies["ultra-ptr"]
33+
compile rootProject.ext.dependencies["gson"]
34+
compile rootProject.ext.dependencies["retrofit"]
35+
compile rootProject.ext.dependencies["retrofit-rxjava"]
36+
compile rootProject.ext.dependencies["retrofit-gson"]
37+
compile rootProject.ext.dependencies["rxandroid"]
38+
compile rootProject.ext.dependencies["ViewPagerIndicator"]
39+
compile rootProject.ext.dependencies["MultiTypeView"]
40+
compile rootProject.ext.dependencies["CoolRefreshView"]
41+
compile rootProject.ext.dependencies["circleimageview"]
42+
compile rootProject.ext.dependencies["pulltorefresh"]
43+
compile rootProject.ext.dependencies["okhttp"]
44+
compile rootProject.ext.dependencies["okio"]
45+
compile rootProject.ext.dependencies["okio"]
46+
4247
// compile 'com.shizhefei:MVCHelper-Library:1.0.3'
4348
// compile 'com.shizhefei:MVCHelper-Pullrefreh:1.0.2'
4449
// compile 'com.shizhefei:MVCHelper-SwipeRefresh:1.0.2'
4550
// compile 'com.shizhefei:MVCHelper-UltraRefresh:1.0.2'
46-
compile 'com.shizhefei:pulltorefresh:1.0.0'
4751
compile project(':mvchelper_library')
4852
compile project(':mvchelper_tasks')
4953
compile project(':mvcswiperefreshhelper')
5054
compile project(':mvcultrahelper')
5155
compile project(':mvcpullrefshhelper')
52-
compile 'com.squareup.okio:okio:1.9.0'
53-
compile 'com.squareup.okhttp3:okhttp:3.4.0'
5456
compile project(':mvchelper_okhttp')
5557
compile project(':mvchelper_testcase')
5658
compile project(':mvccoolhelper')
5759

58-
compile 'com.squareup.leakcanary:leakcanary-android:1.5'
59-
// releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
60-
// testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
60+
debugImplementation rootProject.ext.dependencies["leakcanary-android"]
61+
releaseImplementation rootProject.ext.dependencies["leakcanary-android-no-op"]
62+
// Optional, if you use support library fragments:
6163
}

app/src/main/AndroidManifest.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
android:label="@string/app_name">
1717
<intent-filter>
1818
<action android:name="android.intent.action.MAIN" />
19+
<action android:name="android.intent.action.VIEW" />
1920

2021
<category android:name="android.intent.category.LAUNCHER" />
2122
</intent-filter>
@@ -64,7 +65,7 @@
6465
android:name="com.shizhefei.test.controllers.other.MultiTypeActivity"
6566
android:label="@string/title_activity_multi_type" />
6667
<activity android:name="com.shizhefei.test.controllers.task.TestNormalTaskActivity" />
67-
<activity android:name="com.shizhefei.test.controllers.task.TaskOpActivity"/>
68+
<activity android:name="com.shizhefei.test.controllers.task.TaskOpActivity" />
6869
</application>
6970

7071
</manifest>

app/src/main/res/values/styles.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<resources>
22

3-
<style name="AppTheme" parent="@style/Theme.AppCompat.DayNight.NoActionBar">
3+
<style name="AppTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar">
44
<!-- Customize your theme here. -->
55
<item name="colorPrimary">@color/primary</item>
66
<item name="colorPrimaryDark">@color/primary_dark</item>

build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2-
2+
apply from: "config.gradle"
33
buildscript {
44
repositories {
55
mavenCentral()
@@ -10,7 +10,7 @@ buildscript {
1010
google()
1111
}
1212
dependencies {
13-
classpath 'com.android.tools.build:gradle:3.1.4'
13+
classpath 'com.android.tools.build:gradle:3.2.0'
1414
// classpath "net.ltgt.gradle:gradle-errorprone-plugin:0.0.9"
1515
// NOTE: Do not place your application dependencies here; they belong
1616
// in the individual module build.gradle files

config.gradle

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/*
2+
* Copyright (C) 2015 Drakeet <drakeet.me@gmail.com>
3+
*
4+
* This file is part of Meizhi
5+
*
6+
* Meizhi is free software: you can redistribute it and/or modify
7+
* it under the terms of the GNU General Public License as published by
8+
* the Free Software Foundation, either version 3 of the License, or
9+
* (at your option) any later version.
10+
*
11+
* Meizhi is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
* GNU General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU General Public License
17+
* along with Meizhi. If not, see <http://www.gnu.org/licenses/>.
18+
*/
19+
20+
ext {
21+
22+
android = [compileSdkVersion: 23,
23+
buildToolsVersion: "23.0.1",
24+
applicationId : "me.drakeet.meizhi",
25+
minSdkVersion : 14,
26+
targetSdkVersion : 22,
27+
versionCode : 360,
28+
versionName : "2.6.0"]
29+
30+
supportVersion = "28.0.0"
31+
32+
dependencies = ["appcompat-v7" : "com.android.support:appcompat-v7:${supportVersion}",
33+
"support-v4" : "com.android.support:support-v4:${supportVersion}",
34+
"design" : "com.android.support:design:${supportVersion}",
35+
"recyclerview-v7" : "com.android.support:recyclerview-v7:${supportVersion}",
36+
"nineoldandroids" : "com.nineoldandroids:library:2.4.0",
37+
"picasso" : "com.squareup.picasso:picasso:2.5.2",
38+
"photoview" : "com.github.chrisbanes.photoview:library:1.2.3",
39+
"numberprogressbar" : "com.daimajia.numberprogressbar:library:1.2@aar",
40+
"umeng-analytics" : "com.umeng.analytics:analytics:latest.integration",
41+
"retrofit" : "com.squareup.retrofit2:retrofit:2.1.0",
42+
"retrofit-rxjava" : "com.squareup.retrofit2:adapter-rxjava:2.1.0",
43+
"retrofit-gson" : "com.squareup.retrofit2:converter-gson:2.1.0",
44+
"rxandroid" : "io.reactivex:rxandroid:1.0.0",
45+
"okhttp" : "com.squareup.okhttp3:okhttp:3.4.0",
46+
"okio" : "com.squareup.okio:okio:1.9.0",
47+
"butterknife" : "com.jakewharton:butterknife:7.0.1",
48+
"otto" : "com.squareup:otto:1.3.8",
49+
"mvchelper-core" : "com.shizhefei:MVCHelper-Library:1.0.6",
50+
"mvchelper-swipe" : "com.shizhefei:MVCHelper-SwipeRefresh:1.0.6",
51+
"mvchelper-ultra" : "com.shizhefei:MVCHelper-UltraRefresh:1.0.6",
52+
"mvchelper-testcase" : "com.shizhefei:MVCHelper-TestCase:1.0.6",
53+
"mvchelper-pull" : "com.shizhefei:MVCHelper-Pullrefresh:1.0.6",
54+
"mvchelper-okhttp" : "com.shizhefei:MVCHelper-OkHttp:1.0.6",
55+
"ultra" : "in.srain.cube:ultra-ptr:1.0.11",
56+
"pulltorefresh" : "com.shizhefei:pulltorefresh:1.0.1",
57+
"ViewPagerIndicator" : "com.shizhefei:ViewPagerIndicator:1.0.7",
58+
"gson" : "com.google.code.gson:gson:2.2.4",
59+
"fastjson" : "com.alibaba:fastjson:1.1.15",
60+
"progress" : "com.pnikosis:materialish-progress:1.7",
61+
"recyclerview-animators" : "jp.wasabeef:recyclerview-animators:2.2.3",
62+
"glide" : "com.github.bumptech.glide:glide:3.6.1",
63+
"ultra-ptr" : 'in.srain.cube:ultra-ptr:1.0.11',
64+
"MultiTypeView" : "com.shizhefei:MultiTypeView:1.0.1",
65+
"CoolRefreshView" : "com.shizhefei:CoolRefreshView:1.0.1",
66+
"circleimageview" : "de.hdodenhof:circleimageview:2.1.0",
67+
"leakcanary-android" : "com.squareup.leakcanary:leakcanary-android-no-op:1.6.2",
68+
"leakcanary-support-fragment": "com.squareup.leakcanary:leakcanary-support-fragment:1.6.2",
69+
"leakcanary-android-no-op" : "com.squareup.leakcanary:leakcanary-android-no-op:1.5"
70+
]
71+
}

library.gradle

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
android {
2+
compileSdkVersion 28
3+
buildToolsVersion '28.0.2'
4+
5+
defaultConfig {
6+
minSdkVersion 14
7+
targetSdkVersion 28
8+
versionCode rootProject.ext.VERSION_CODE
9+
versionName rootProject.ext.VERSION_NAME
10+
}
11+
buildTypes {
12+
release {
13+
minifyEnabled false
14+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
15+
}
16+
}
17+
18+
lintOptions {
19+
abortOnError false
20+
}
21+
}

mvccoolhelper/build.gradle

+3-24
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,10 @@
11
apply plugin: 'com.android.library'
2-
3-
android {
4-
compileSdkVersion 25
5-
buildToolsVersion '27.0.3'
6-
7-
defaultConfig {
8-
minSdkVersion 9
9-
targetSdkVersion 23
10-
versionCode rootProject.ext.VERSION_CODE
11-
versionName rootProject.ext.VERSION_NAME
12-
}
13-
buildTypes {
14-
release {
15-
minifyEnabled false
16-
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
17-
}
18-
}
19-
20-
lintOptions {
21-
abortOnError false
22-
}
23-
}
2+
apply from: rootProject.file("library.gradle")
243

254
dependencies {
265
compile fileTree(include: ['*.jar'], dir: 'libs')
27-
provided 'com.shizhefei:CoolRefreshView:1.0.1'
28-
provided 'com.android.support:support-v4:25.0.1'
6+
provided rootProject.ext.dependencies["CoolRefreshView"]
7+
provided rootProject.ext.dependencies["support-v4"]
298
compile project(':mvchelper_library')
309
}
3110

mvchelper_library/build.gradle

+2-23
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,9 @@
11
apply plugin: 'com.android.library'
2-
android {
3-
compileSdkVersion 25
4-
buildToolsVersion '27.0.3'
5-
6-
defaultConfig {
7-
minSdkVersion 9
8-
targetSdkVersion 23
9-
versionCode rootProject.ext.VERSION_CODE
10-
versionName rootProject.ext.VERSION_NAME
11-
}
12-
buildTypes {
13-
release {
14-
minifyEnabled false
15-
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
16-
}
17-
}
18-
19-
lintOptions {
20-
abortOnError false
21-
}
22-
}
2+
apply from: rootProject.file("library.gradle")
233

244
dependencies {
255
compile fileTree(include: ['*.jar'], dir: 'libs')
26-
testCompile 'junit:junit:4.12'
27-
provided 'com.android.support:recyclerview-v7:25.0.1'
6+
provided rootProject.ext.dependencies["recyclerview-v7"]
287
}
298

309
////添加

mvchelper_okhttp/build.gradle

+4-20
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,12 @@
11
apply plugin: 'com.android.library'
2-
3-
android {
4-
compileSdkVersion 25
5-
buildToolsVersion '27.0.3'
6-
7-
defaultConfig {
8-
minSdkVersion 9
9-
targetSdkVersion 24
10-
versionCode rootProject.ext.VERSION_CODE
11-
versionName rootProject.ext.VERSION_NAME
12-
}
13-
buildTypes {
14-
release {
15-
minifyEnabled false
16-
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
17-
}
18-
}
19-
}
2+
apply from: rootProject.file("library.gradle")
203

214
dependencies {
225
compile fileTree(include: ['*.jar'], dir: 'libs')
236
compile project(':mvchelper_library')
24-
provided 'com.squareup.okhttp3:okhttp:3.4.0'
25-
provided 'com.squareup.okio:okio:1.9.0'
7+
8+
provided rootProject.ext.dependencies["okhttp"]
9+
provided rootProject.ext.dependencies["okio"]
2610
}
2711

2812
////添加

mvchelper_tasks/build.gradle

+1-20
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,9 @@
11
apply plugin: 'com.android.library'
2-
3-
android {
4-
compileSdkVersion 25
5-
buildToolsVersion '27.0.3'
6-
7-
defaultConfig {
8-
minSdkVersion 9
9-
targetSdkVersion 24
10-
versionCode rootProject.ext.VERSION_CODE
11-
versionName rootProject.ext.VERSION_NAME
12-
}
13-
buildTypes {
14-
release {
15-
minifyEnabled false
16-
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
17-
}
18-
}
19-
}
2+
apply from: rootProject.file("library.gradle")
203

214
dependencies {
225
compile fileTree(include: ['*.jar'], dir: 'libs')
236
compile project(':mvchelper_library')
24-
provided 'com.squareup.okhttp3:okhttp:3.4.0'
25-
provided 'com.squareup.okio:okio:1.9.0'
267
}
278

289
////添加

mvchelper_testcase/build.gradle

+4-26
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,11 @@
11
apply plugin: 'com.android.library'
2-
3-
android {
4-
compileSdkVersion 25
5-
buildToolsVersion '27.0.3'
6-
7-
defaultConfig {
8-
minSdkVersion 9
9-
targetSdkVersion 23
10-
versionCode rootProject.ext.VERSION_CODE
11-
versionName rootProject.ext.VERSION_NAME
12-
}
13-
buildTypes {
14-
release {
15-
minifyEnabled false
16-
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
17-
}
18-
}
19-
20-
lintOptions {
21-
abortOnError false
22-
}
23-
}
2+
apply from: rootProject.file("library.gradle")
243

254
dependencies {
265
compile fileTree(include: ['*.jar'], dir: 'libs')
27-
testCompile 'junit:junit:4.12'
28-
provided 'com.android.support:recyclerview-v7:25.0.1'
29-
provided 'com.android.support:support-v4:25.0.1'
30-
provided 'com.google.code.gson:gson:2.2.4'
6+
provided rootProject.ext.dependencies["recyclerview-v7"]
7+
provided rootProject.ext.dependencies["support-v4"]
8+
provided rootProject.ext.dependencies["gson"]
319
compile project(':mvchelper_library')
3210
}
3311

0 commit comments

Comments
 (0)