This repository has been archived by the owner on Sep 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle.kts
executable file
·122 lines (92 loc) · 3.39 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
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
// Apply the Kotlin JVM plugin to add support for Kotlin.
id("org.jetbrains.kotlin.jvm") version "1.7.22"
kotlin("plugin.serialization") version "1.7.22"
id("com.github.johnrengelman.shadow") version "7.1.2"
id("io.gitlab.arturbosch.detekt") version "1.22.0"
// Apply the application plugin to add support for building a jar
java
}
detekt {
toolVersion = "1.22.0"
config = files("config/detekt/detekt.yml")
buildUponDefaultConfig = true
}
repositories {
// maven central
mavenCentral()
maven(url = "https://repo.spongepowered.org/maven")
maven(url = "https://jitpack.io")
maven(url = "https://repo.velocitypowered.com/snapshots")
maven(url = "https://repo.minestom.com/repository/maven-public/")
}
dependencies {
// Align versions of all Kotlin components
implementation(platform("org.jetbrains.kotlin:kotlin-bom"))
// Use the Kotlin JDK 8 standard library.
implementation(kotlin("stdlib"))
// Use the Kotlin reflect library.
implementation(kotlin("reflect"))
// Add support for kotlinx courotines
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
// Add tinylog
implementation("org.tinylog:tinylog-api-kotlin:2.5.0")
implementation("org.tinylog:tinylog-impl:2.5.0")
// Add intergration
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:1.6.4")
// import kotlinx serialization
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1")
// Add MiniMessage
implementation("net.kyori:adventure-text-minimessage:4.12.0")
// Add Ktor
implementation("io.ktor:ktor-client-core:2.2.1")
implementation("io.ktor:ktor-client-cio:2.2.1")
// Use the kotlin test library
testImplementation("io.kotest:kotest-assertions-core:5.5.4")
testImplementation("io.kotest:kotest-runner-junit5:5.5.4")
// Compile Minestom into project
implementation("com.github.Minestom", "Minestom", "7867313290")
// JLine
implementation("org.jline:jline:3.21.0")
// Jansi
implementation("org.jline:jline-terminal-jansi:3.21.0")
}
tasks {
named<ShadowJar>("shadowJar") {
manifest {
attributes (
"Main-Class" to "world.cepi.sabre.SabreLoader",
"Multi-Release" to true
)
}
transform(com.github.jengelman.gradle.plugins.shadow.transformers.Log4j2PluginsCacheFileTransformer::class.java)
mergeServiceFiles()
archiveBaseName.set("sabre")
}
test { useJUnitPlatform() }
build { dependsOn(shadowJar) }
withType<AbstractArchiveTask> {
isPreserveFileTimestamps = false
isReproducibleFileOrder = true
}
}
configure<SourceSetContainer> {
named("main") {
java.srcDir("src/main/kotlin")
}
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
tasks.withType<KotlinCompile> { kotlinOptions.jvmTarget = "17" }
sourceSets.create("demo") {
java.srcDir("src/demo/java")
java.srcDir("build/generated/source/apt/demo")
resources.srcDir("src/demo/resources")
compileClasspath += sourceSets.main.get().output + sourceSets.main.get().compileClasspath
runtimeClasspath += sourceSets.main.get().output + sourceSets.main.get().runtimeClasspath
}