-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
110 lines (105 loc) · 4.51 KB
/
build.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
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
apply from: "config.gradle"
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$navVersion"
}
}
//强制使用相同版本的库
subprojects {
project.configurations.all {
all*.exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jdk7'
all*.exclude group: 'androidx.navigation', module: 'navigation-fragment'
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'androidx.appcompat') {
if (requested.module.name == 'appcompat') {
details.useVersion rootProject.ext.appcompatVersion
}
} else if (requested.group == 'androidx.annotation') {
if (requested.module.name == 'annotation') {
details.useVersion rootProject.ext.annotationVersion
}
} else if (requested.group == 'androidx.drawerlayout') {
if (requested.module.name == 'drawerlayout') {
details.useVersion '1.1.1'
}
} else if (requested.group == 'androidx.core') {
if (requested.module.name == 'core') {
details.useVersion rootProject.ext.androidxCoreVersion
}
} else if (requested.group == 'androidx.fragment') {
if (requested.module.name == 'fragment') {
details.useVersion '1.3.5'
}
} else if (requested.group == 'androidx.coordinatorlayout') {
if (requested.module.name == 'coordinatorlayout') {
details.useVersion rootProject.ext.coordinatorlayoutVersion
}
} else if (requested.group == 'com.squareup.okio') {
details.useVersion rootProject.ext.okioVersion
} else if (requested.group == 'io.reactivex.rxjava2') {
if (requested.module.name == 'rxjava') {
details.useVersion rootProject.ext.rxJavaVersion
} else if (requested.module.name == 'rxandroid') {
details.useVersion rootProject.ext.rxAndroidVersion
}
} else if (requested.group == 'com.github.CymChad') {
if (requested.module.name == 'BaseRecyclerViewAdapterHelper') {
details.useVersion rootProject.ext.brvahVersion
}
} else if (requested.group == 'androidx.recyclerview') {
if (requested.module.name == 'recyclerview') {
details.useVersion rootProject.ext.recyclerviewVersion
}
} else if (requested.group == 'androidx.lifecycle') {
if (requested.module.name == 'lifecycle-livedata-core') {
details.useVersion rootProject.ext.lifeVersion
} else if (requested.module.name == 'lifecycle-livedata') {
details.useVersion rootProject.ext.lifeVersion
} else if (requested.module.name == 'lifecycle-viewmodel') {
details.useVersion rootProject.ext.lifeVersion
}
} else if (requested.group == 'org.jetbrains.kotlin') {
details.useVersion rootProject.ext.kotlinVersion
} else if (requested.group == 'androidx.camera') {
if (requested.module.name == 'camera-core') {
details.useVersion rootProject.ext.cameraxVersion
} else if (requested.module.name == 'camera-camera2') {
details.useVersion rootProject.ext.cameraxVersion
} else if (requested.module.name == 'camera-lifecycle') {
details.useVersion rootProject.ext.cameraxVersion
} else if (requested.module.name == 'camera-view') {
details.useVersion rootProject.ext.cameraxExtensionsVersion
} else if (requested.module.name == 'camera-extensions') {
details.useVersion rootProject.ext.cameraxExtensionsVersion
}
} else if (requested.group == 'com.squareup.okio') {
details.useVersion rootProject.ext.okioVersion
} else if (requested.group == 'io.reactivex.rxjava2') {
if (requested.module.name == 'rxjava') {
details.useVersion rootProject.ext.rxJavaVersion
} else if (requested.module.name == 'rxandroid') {
details.useVersion rootProject.ext.rxAndroidVersion
}
} else if (requested.group == 'com.squareup.okhttp3') {
if (requested.module.name == 'okhttp') {
details.useVersion rootProject.ext.okHttpVersion
} else if (requested.module.name == 'logging-interceptor') {
details.useVersion rootProject.ext.okHttpVersion
}
} else if (requested.group == 'org.jetbrains.kotlin') {
details.useVersion rootProject.ext.kotlinVersion
} else if (requested.group == 'com.jakewharton.timber') {
details.useVersion rootProject.ext.timberVersion
}
}
}
}