-
-
Notifications
You must be signed in to change notification settings - Fork 17
/
build.gradle.kts
118 lines (99 loc) · 3 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
import java.net.URI
import java.nio.file.Files
val serverDir: File = projectDir.resolve("run")
val pluginDir: File = serverDir.resolve("plugins")
plugins {
`java-library`
id("io.github.goooler.shadow") version "8.1.8"
}
repositories {
maven {
url = uri("https://oss.sonatype.org/content/groups/public/")
}
maven {
url = uri("https://jitpack.io")
}
maven {
url = uri("https://repo.purpurmc.org/snapshots")
}
maven {
url = uri("https://papermc.io/repo/repository/maven-public/")
}
maven {
url = uri("https://libraries.minecraft.net")
}
maven {
url = uri("https://repo.maven.apache.org/maven2/")
}
}
dependencies {
api("com.github.YouHaveTrouble:Entiddy:v2.0.1")
api("org.reflections:reflections:0.10.2")
compileOnly("org.purpurmc.purpur:purpur-api:1.21-R0.1-SNAPSHOT")
}
group = "org.purpurmc.purpurextras"
version = "1.34.4"
description = "\"This should be a plugin\" features from Purpur"
java.sourceCompatibility = JavaVersion.VERSION_21
java.targetCompatibility = JavaVersion.VERSION_21
tasks {
compileJava {
options.encoding = "UTF-8"
}
javadoc {
options.encoding = "UTF-8"
}
clean {
doLast {
serverDir.deleteRecursively()
}
}
processResources {
filesMatching("plugin.yml") {
expand(
mapOf(
"name" to project.name,
"version" to project.version,
"description" to project.description!!.replace('"'.toString(), "\\\"")
)
)
}
}
shadowJar {
archiveFileName.set("PurpurExtras-${version}.jar")
relocate("org.reflections", "org.purpurmc.purpurextras.reflections")
relocate("me.youhavetrouble.entiddy", "org.purpurmc.purpurextras.entiddy")
manifest {
attributes["paperweight-mappings-namespace"] = "mojang"
}
}
register("downloadServer") {
group = "purpur"
doFirst {
serverDir.mkdirs()
pluginDir.mkdirs()
URI("https://api.purpurmc.org/v2/purpur/1.21.1/latest/download").toURL().openStream().use {
Files.copy(it, serverDir.resolve("server.jar").toPath())
}
}
}
register("runServer", JavaExec::class) {
group = "purpur"
dependsOn("shadowJar")
if (!serverDir.resolve("server.jar").exists()) {
dependsOn("downloadServer")
}
doFirst {
pluginDir.resolve("PurpurExtras.jar").delete()
Files.copy(
layout.buildDirectory.file("libs/PurpurExtras-${version}.jar").get().asFile.toPath(),
pluginDir.resolve("PurpurExtras.jar").toPath()
)
}
classpath = files(serverDir.resolve("server.jar"))
workingDir = serverDir
jvmArgs = listOf("-Dcom.mojang.eula.agree=true")
args = listOf("--nogui")
standardInput = System.`in`
}
}