-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
107 lines (87 loc) · 2.35 KB
/
build.gradle.kts
File metadata and controls
107 lines (87 loc) · 2.35 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
import java.nio.charset.StandardCharsets
plugins {
id("java")
id("maven-publish")
// External Plugins
alias(libs.plugins.shadow)
alias(libs.plugins.lombok.java)
// Kotlin Plugins
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.lombok.kotlin)
}
group = "net.peng1104"
version = "1.0.0"
repositories {
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
maven ("https://repo.dmulloy2.net/repository/public/")
mavenCentral()
}
dependencies {
// Annotations
compileOnly(libs.annotations)
annotationProcessor(libs.annotations)
// Lombok
compileOnly(libs.lombok)
annotationProcessor(libs.lombok)
// Extra Libraries
implementation(libs.bundles.adventure)
// Kernel
compileOnly(libs.bundles.spigot)
// Plugins Compatibility
compileOnly(libs.luckperms)
compileOnly(libs.protocolLib)
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(21))
}
}
kotlin {
jvmToolchain(21)
}
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
}
tasks.withType<Test> {
systemProperty("file.encoding", "UTF-8")
}
tasks.withType<ProcessResources> {
filteringCharset = StandardCharsets.UTF_8.name()
}
tasks {
val copyJarToServer by registering(Copy::class) {
dependsOn(shadowJar)
from(shadowJar)
into("${project.rootDir}/Server/plugins")
}
shadowJar {
archiveFileName.set("${project.name}.jar")
}
build {
dependsOn(copyJarToServer)
}
processResources {
val props = mapOf(
"name" to project.name,
"version" to project.version,
"group" to project.group,
"mainClass" to project.properties["mainClass"],
"authors" to project.properties["authors"],
"description" to project.properties["description"],
"website" to project.properties["website"],
"depend" to project.properties["depend"],
"softDepend" to project.properties["softDepend"],
"loadBefore" to project.properties["loadBefore"]
)
inputs.properties(props)
filesMatching("plugin.yml") {
expand(props)
}
filesMatching("bungee.yml") {
expand(props)
}
filesMatching("module.yml") {
expand(props)
}
}
}