-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
133 lines (110 loc) · 3.9 KB
/
build.gradle.kts
File metadata and controls
133 lines (110 loc) · 3.9 KB
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
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.util.*
plugins {
kotlin("jvm") version "2.1.20"
`java-library`
id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.17.0"
id("io.papermc.paperweight.userdev") version "2.0.0-beta.19"
kotlin("plugin.serialization") version "2.1.20"
id("maven-publish")
id("org.sonarqube") version "7.0.1.6134"
}
group = "cc.modlabs"
version = System.getenv("VERSION_OVERRIDE") ?: Calendar.getInstance(TimeZone.getTimeZone("UTC")).run {
"${get(Calendar.YEAR)}.${get(Calendar.MONTH) + 1}.${get(Calendar.DAY_OF_MONTH)}.${String.format("%02d%02d", get(Calendar.HOUR_OF_DAY), get(Calendar.MINUTE))}"
}
sonar {
properties {
property("sonar.projectKey", "ModLabsCC_KPaper_b16df947-ed31-4251-96c3-810b8516f8cc")
property("sonar.projectName", "KPaper")
}
}
repositories {
mavenCentral()
maven("https://nexus.modlabs.cc/repository/maven-mirrors/")
}
val minecraftVersion: String by project
val koTestVersion = "6.0.0.M1"
val mockkVersion = "1.13.16"
dependencies {
paperweight.paperDevBundle("$minecraftVersion-R0.1-SNAPSHOT")
api("dev.fruxz:stacked:2024.1.1")
api("cc.modlabs:KlassicX:2025.12.4.1928")
api("com.squareup.okhttp3:okhttp:4.12.0")
// PacketEvents for TextDisplayFactory (display entities)
api("com.github.retrooper:packetevents-spigot:2.11.2")
// Redis client for Redis-backed PartyAPI implementation (Jedis)
implementation("redis.clients:jedis:7.1.0")
testImplementation("io.kotest:kotest-runner-junit5:$koTestVersion")
testImplementation("io.mockk:mockk:${mockkVersion}")
testImplementation("com.google.code.gson:gson:2.11.0")
implementation("com.google.code.gson:gson:2.11.0")
}
paperweight {
reobfArtifactConfiguration = io.papermc.paperweight.userdev
.ReobfArtifactConfiguration.MOJANG_PRODUCTION
}
tasks.register<Jar>("sourcesJar") {
description = "Generates the sources jar for this project."
group = JavaBasePlugin.DOCUMENTATION_GROUP
archiveClassifier.set("sources")
from(sourceSets["main"].allSource)
}
tasks.withType<Test>().configureEach {
useJUnitPlatform()
}
publishing {
repositories {
maven {
name = "ModLabs"
url = uri("https://nexus.modlabs.cc/repository/maven-public/")
credentials {
username = System.getenv("NEXUS_USER")
password = System.getenv("NEXUS_PASS")
}
}
mavenLocal()
}
publications {
create<MavenPublication>("maven") {
from(components["java"])
artifact(tasks.named("sourcesJar"))
pom {
name.set("KPaper")
description.set("A utility library designed to simplify plugin development with Paper and Kotlin.")
url.set("https://github.com/ModLabsCC/KPaper")
licenses {
license {
name.set("GPL-3.0")
url.set("https://github.com/ModLabsCC/KPaper/blob/main/LICENSE")
}
}
developers {
developer {
id.set("ModLabsCC")
name.set("ModLabsCC")
email.set("contact@modlabs.cc")
}
}
scm {
connection.set("scm:git:git://github.com/ModLabsCC/KPaper.git")
developerConnection.set("scm:git:git@github.com:ModLabsCC/KPaper.git")
url.set("https://github.com/ModLabsCC/KPaper")
}
}
}
}
}
tasks {
withType<JavaCompile> {
options.encoding = "UTF-8"
options.release.set(21)
}
withType<KotlinCompile> {
compilerOptions.jvmTarget.set(JvmTarget.JVM_21)
}
}
kotlin {
jvmToolchain(21)
}