-
-
Notifications
You must be signed in to change notification settings - Fork 25
/
build.gradle.kts
151 lines (121 loc) · 3.06 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
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
import dev.kordex.gradle.plugins.kordex.DataCollection
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
application
alias(libs.plugins.kotlin)
alias(libs.plugins.kotlinx.serialization)
alias(libs.plugins.shadow)
alias(libs.plugins.detekt)
alias(libs.plugins.git.hooks)
alias(libs.plugins.grgit)
alias(libs.plugins.blossom)
alias(libs.plugins.kord.extensions.plugin)
}
group = "org.hyacinthbots.lilybot"
version = "5.0.0"
val className = "org.hyacinthbots.lilybot.LilyBotKt"
repositories {
mavenCentral()
maven {
name = "Kord Snapshots"
url = uri("https://repo.kord.dev/snapshots")
}
maven {
name = "Kord Extensions (Releases)"
url = uri("https://releases-repo.kordex.dev")
}
maven {
name = "Kord Extensions (Snapshots)"
url = uri("https://snapshots-repo.kordex.dev")
}
maven {
name = "JitPack"
url = uri("https://jitpack.io")
}
maven {
name = "Sonatype Snapshots (Legacy)"
url = uri("https://oss.sonatype.org/content/repositories/snapshots")
}
maven {
name = "Sonatype Snapshots"
url = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
}
}
dependencies {
detektPlugins(libs.detekt)
implementation(libs.kord.extensions.core)
implementation(libs.kord.extensions.phishing)
implementation(libs.kord.extensions.pluralkit)
implementation(libs.kord.extensions.unsafe)
implementation(libs.kord.extensions.welcome)
implementation(libs.kotlin.stdlib)
// Logging dependencies
implementation(libs.logback)
implementation(libs.logging)
// Github API
implementation(libs.github.api)
// KMongo
implementation(libs.kmongo)
implementation(libs.docgenerator)
}
kordEx {
addDependencies = false
addRepositories = false
kordExVersion = libs.versions.kord.extensions
ignoreIncompatibleKotlinVersion = true
bot {
dataCollection(DataCollection.None)
}
i18n {
classPackage = "lilybot.i18n"
translationBundle = "lilybot.strings"
}
}
application {
mainClass.set(className)
}
gitHooks {
setHooks(
mapOf("pre-commit" to "detekt")
)
}
tasks {
withType<KotlinCompile> {
compilerOptions {
jvmTarget.set(JvmTarget.fromTarget("21"))
languageVersion.set(KotlinVersion.fromVersion(libs.plugins.kotlin.get().version.requiredVersion.substringBeforeLast(".")))
incremental = true
freeCompilerArgs.add("-opt-in=kotlin.RequiresOptIn")
}
}
java { // Should match the Kotlin compiler options ideally
sourceCompatibility = JavaVersion.toVersion("21")
targetCompatibility = JavaVersion.toVersion("21")
}
jar {
manifest {
attributes("Main-Class" to className)
}
}
wrapper {
// To update the gradle wrapper version run `./gradlew wrapper --gradle-version=<NEW_VERSION>`
distributionType = Wrapper.DistributionType.BIN
}
}
detekt {
buildUponDefaultConfig = true
config.setFrom("$rootDir/detekt.yml")
autoCorrect = true
}
sourceSets {
main {
blossom {
kotlinSources {
property("build_id", grgit.head().abbreviatedId)
property("version", project.version.toString())
}
}
}
}