forked from kordlib/kord
-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.gradle.kts
101 lines (79 loc) · 3.19 KB
/
settings.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
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
@file:Suppress("UnstableApiUsage")
pluginManagement {
resolutionStrategy {
eachPlugin {
if (requested.id.id == "org.jetbrains.dokka") {
useModule("org.jetbrains.dokka:dokka-gradle-plugin:${requested.version}")
}
}
}
repositories {
gradlePluginPortal()
mavenCentral()
}
}
rootProject.name = "kord"
include("gateway")
include("common")
include("rest")
include("core")
include("voice")
enableFeaturePreview("VERSION_CATALOGS")
dependencyResolutionManagement {
versionCatalogs {
create("libs") {
kotlinx()
ktor()
cache()
common()
tests()
misc()
}
}
}
fun VersionCatalogBuilder.cache() {
val cache = version("kord-cache") {
strictly("[0.3.0, 0.4.0[")
prefer("latest.release")
}
alias("kord-cache-api").to("dev.kord.cache", "cache-api").versionRef(cache)
alias("kord-cache-map").to("dev.kord.cache", "cache-map").versionRef(cache)
}
fun VersionCatalogBuilder.kotlinx() {
alias("kotlinx-datetime").to("org.jetbrains.kotlinx", "kotlinx-datetime").version("0.2.1")
}
fun VersionCatalogBuilder.ktor() {
val ktor = version("ktor", "1.6.3")
alias("ktor-client-json").to("io.ktor", "ktor-client-json").versionRef(ktor)
alias("ktor-client-serialization").to("io.ktor", "ktor-client-serialization").versionRef(ktor)
alias("ktor-client-cio").to("io.ktor", "ktor-client-cio").versionRef(ktor)
alias("ktor-client-websockets").to("io.ktor", "ktor-client-websockets").versionRef(ktor)
alias("ktor-client-mock").to("io.ktor", "ktor-client-mock").versionRef(ktor)
alias("ktor-network").to("io.ktor", "ktor-network").versionRef(ktor)
}
fun VersionCatalogBuilder.common() {
version("kotlinx-coroutines", "1.5.2")
alias("kotlinx-serialization").to("org.jetbrains.kotlinx", "kotlinx-serialization-json").version("1.3.0")
alias("kotlinx-coroutines").to("org.jetbrains.kotlinx", "kotlinx-coroutines").versionRef("kotlinx-coroutines")
alias("kotlinx-atomicfu").to("org.jetbrains.kotlinx", "atomicfu").version("0.16.1")
alias("kotlin-logging").to("io.github.microutils", "kotlin-logging").version("2.0.11")
bundle("common", listOf("kotlinx-serialization", "kotlinx-coroutines", "kotlinx-atomicfu", "kotlin-logging"))
}
fun VersionCatalogBuilder.misc() {
alias("codahale-xsalsa20poly1305").to("com.codahale", "xsalsa20poly1305").version("0.10.1")
}
fun VersionCatalogBuilder.tests() {
val junit5 = version("junit5", "5.8.1")
alias("mockk").to("io.mockk", "mockk").version("1.12.0")
alias("kotlinx-coroutines").to("org.jetbrains.kotlinx", "kotlinx-coroutines-test").versionRef("kotlinx-coroutines")
alias("junit-jupiter-api").to("org.junit.jupiter", "junit-jupiter-api").versionRef(junit5)
alias("slf4j-simple").to("org.slf4j", "slf4j-simple").version("1.7.30")
alias("junit-jupiter-engine").to("org.junit.jupiter", "junit-jupiter-engine").versionRef(junit5)
bundle("test-implementation", listOf("mockk", "kotlinx-coroutines", "junit-jupiter-api"))
bundle(
"test-runtime", listOf(
"slf4j-simple",
"junit-jupiter-engine"
)
)
}