-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
136 lines (110 loc) · 3.05 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
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.kotlin.serialization)
alias(libs.plugins.shadow)
alias(libs.plugins.detekt)
alias(libs.plugins.git.hooks)
alias(libs.plugins.kord.extensions.plugin)
alias(libs.plugins.licenser)
}
group = "org.hyacinthbots.modmailbot"
version = "1.0-SNAPSHOT"
val className = "org.hyacinthbots.modmailbot.ModMailBotKt"
val javaTarget = "21"
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 = "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 {
implementation(libs.kord.extensions)
implementation(libs.kord.extensions.unsafe)
implementation(libs.kotlin.stdlib)
implementation(libs.kordx.emoji)
// Logging dependencies
implementation(libs.logback)
implementation(libs.logback.groovy)
implementation(libs.logging)
implementation(libs.groovy)
implementation(libs.jansi)
// Formatting
detektPlugins(libs.detekt)
// Database
implementation(libs.mongo.driver)
implementation(libs.mongo.bson)
}
kordEx {
addDependencies = false
addRepositories = false
ignoreIncompatibleKotlinVersion = true
bot {
dataCollection(DataCollection.None)
}
i18n {
classPackage = "modmailbot.i18n"
translationBundle = "modmailbot.strings"
}
}
application {
mainClass.set(className)
}
gitHooks {
setHooks(
mapOf("pre-commit" to "detekt updateLicenses")
)
}
tasks {
withType<KotlinCompile> {
compilerOptions {
jvmTarget.set(JvmTarget.fromTarget(javaTarget))
languageVersion.set(KotlinVersion.fromVersion(libs.versions.kotlin.get().substringBeforeLast(".")))
freeCompilerArgs.add("-opt-in=kotlin.RequiresOptIn")
incremental = true
}
}
jar {
manifest {
attributes("Main-Class" to className)
}
}
java {
sourceCompatibility = JavaVersion.toVersion(javaTarget)
targetCompatibility = JavaVersion.toVersion(javaTarget)
}
wrapper {
distributionType = Wrapper.DistributionType.BIN
}
}
detekt {
buildUponDefaultConfig = true
config.setFrom("$rootDir/detekt.yml")
autoCorrect = true
}
license {
setHeader(rootProject.file("HEADER"))
include("**/*.kt")
exclude("**/Translations.kt")
}