-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.gradle.kts
148 lines (123 loc) · 4.6 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
plugins {
`java-library`
`maven-publish`
alias(libs.plugins.ebean)
alias(libs.plugins.shadow)
alias(libs.plugins.run.paper)
}
repositories {
mavenLocal()
mavenCentral()
maven { url = uri("https://repo.papermc.io/repository/maven-public/") }
maven { url = uri("https://repo.codemc.io/repository/maven-releases/") }
maven { url = uri("https://repo.codemc.io/repository/maven-snapshots/") }
maven { url = uri("https://jitpack.io") }
}
java {
disableAutoTargetJvm()
toolchain.languageVersion = JavaLanguageVersion.of(17)
}
dependencies {
compileOnly(libs.paper.api)
compileOnly(libs.packetevents.spigot)
compileOnly(libs.discord.webhooks)
compileOnly(libs.configlib.yaml)
compileOnly(libs.configlib.paper)
compileOnly(libs.lombok)
compileOnly(libs.expiringmap)
compileOnly(libs.betterreload.api)
compileOnly(libs.ebean.core)
compileOnly(libs.ebean.sqlite)
compileOnly(libs.ebean.mysql)
compileOnly(libs.lettuce.core)
annotationProcessor(libs.lombok)
annotationProcessor(libs.ebean.processor)
testImplementation(libs.ebean.test)
testImplementation(libs.ebean.sqlite)
testImplementation(libs.ebean.mysql)
testImplementation(libs.lettuce.core)
}
group = "com.deathmotion.totemguard"
version = "1.2.0-SNAPSHOT"
description = "TotemGuard"
tasks {
jar {
enabled = false
}
shadowJar {
archiveFileName = "${rootProject.name}-${project.version}.jar"
archiveClassifier = null
relocate("net.kyori.adventure.text.serializer.gson", "io.github.retrooper.packetevents.adventure.serializer.gson")
manifest {
attributes["Implementation-Version"] = rootProject.version
}
}
assemble {
dependsOn(shadowJar)
}
withType<JavaCompile> {
options.encoding = Charsets.UTF_8.name()
options.release = 17
}
withType<Javadoc>() {
options.encoding = Charsets.UTF_8.name()
}
processResources {
inputs.property("version", project.version)
inputs.property("ebeanVersion", libs.versions.ebean.get())
inputs.property("configlibVersion", libs.versions.configlib.get())
inputs.property("discordWebhooksVersion", libs.versions.discord.webhooks.get())
inputs.property("expiringmapVersion", libs.versions.expiringmap.get())
inputs.property("lettuceVersion", libs.versions.lettuce.get())
filesMatching("plugin.yml") {
expand(
"version" to rootProject.version,
"ebeanVersion" to libs.versions.ebean.get(),
"configlibVersion" to libs.versions.configlib.get(),
"discordWebhooksVersion" to libs.versions.discord.webhooks.get(),
"expiringmapVersion" to libs.versions.expiringmap.get(),
"lettuceVersion" to libs.versions.lettuce.get()
)
}
}
defaultTasks("build")
// 1.8.8 - 1.16.5 = Java 8
// 1.17 = Java 16
// 1.18 - 1.20.4 = Java 17
// 1-20.5+ = Java 21
val version = "1.21.3"
val javaVersion = JavaLanguageVersion.of(21)
val jvmArgsExternal = listOf(
"-Dcom.mojang.eula.agree=true"
)
val sharedPlugins = runPaper.downloadPluginsSpec {
url("https://ci.codemc.io/job/retrooper/job/packetevents/lastSuccessfulBuild/artifact/spigot/build/libs/packetevents-spigot-2.6.1-SNAPSHOT.jar")
url("https://github.com/ViaVersion/ViaVersion/releases/download/5.1.1/ViaVersion-5.1.1.jar")
url("https://github.com/ViaVersion/ViaBackwards/releases/download/5.1.1/ViaBackwards-5.1.1.jar")
}
runServer {
minecraftVersion(version)
runDirectory = rootDir.resolve("run/paper/$version")
javaLauncher = project.javaToolchains.launcherFor {
languageVersion = javaVersion
}
downloadPlugins {
from(sharedPlugins)
url("https://ci.ender.zone/job/EssentialsX/lastSuccessfulBuild/artifact/jars/EssentialsX-2.21.0-dev+141-c7cc1b4.jar")
url("https://ci.lucko.me/job/spark/465/artifact/spark-bukkit/build/libs/spark-1.10.119-bukkit.jar")
url("https://download.luckperms.net/1561/bukkit/loader/LuckPerms-Bukkit-5.4.146.jar")
}
jvmArgs = jvmArgsExternal
}
runPaper.folia.registerTask {
minecraftVersion(version)
runDirectory = rootDir.resolve("run/folia/$version")
javaLauncher = project.javaToolchains.launcherFor {
languageVersion = javaVersion
}
downloadPlugins {
from(sharedPlugins)
}
jvmArgs = jvmArgsExternal
}
}