-
-
Notifications
You must be signed in to change notification settings - Fork 26
/
build.gradle.kts
68 lines (64 loc) · 1.91 KB
/
build.gradle.kts
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
buildscript {
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath(libs.android.gradle.plugin)
classpath(libs.jetbrains.kotlin.gradle)
classpath(libs.jetbrains.kotlin.serialization)
classpath(libs.koin.gradle.plugin)
classpath(libs.google.gsm.google.services)
classpath(libs.google.firebase.crashlytics.gradle)
classpath(libs.objectbox.gradle.plugin)
}
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven {
setUrl("https://www.jitpack.io")
}
maven {
setUrl("https://oss.sonatype.org/content/repositories/snapshots")
}
}
configurations.all {
handleConflicts(this@allprojects)
}
}
tasks {
val clean by registering(Delete::class) {
delete(rootProject.layout.buildDirectory)
}
}
fun Configuration.handleConflicts(project: Project): Unit = with(project) {
resolutionStrategy.eachDependency {
when (requested.group) {
"org.jetbrains.kotlin" -> {
when (requested.name) {
"kotlin-reflect",
"kotlin-stdlib",
"kotlin-stdlib-common",
"kotlin-stdlib-jdk8",
"kotlin-stdlib-jdk7" -> useVersion(libs.versions.jetbrains.kotlin.get())
}
}
}
if (requested.name == "kotlinx-serialization-json") {
useTarget(libs.jetbrains.kotlinx.serialization.json)
}
if (requested.group == "com.google.android.material") {
useTarget(libs.google.android.material)
}
if (requested.group == "com.jakewharton.timber") {
useTarget(libs.timber)
}
if (requested.group == "androidx.startup") {
useTarget(libs.androidx.startupRuntime)
}
}
}