-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle
More file actions
116 lines (104 loc) · 4.29 KB
/
Copy pathbuild.gradle
File metadata and controls
116 lines (104 loc) · 4.29 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
plugins {
id("java-library")
// https://github.com/jpenilla/run-task
id("xyz.jpenilla.run-paper") version "3.0.2"
// https://github.com/eldoriarpg/plugin-yml
id("de.eldoria.plugin-yml.paper") version "0.9.0"
// https://github.com/GradleUp/shadow
id("com.gradleup.shadow") version "9.4.2"
}
final String VERSION = "1.7.1"
final String RUN_NUMBER = System.getenv("GITHUB_RUN_NUMBER") ?: "DEV"
group = "cloud.grabsky"
version = "$VERSION+$RUN_NUMBER"
configurations {
shadowImplementation
}
configurations.implementation {
extendsFrom(configurations.shadowImplementation)
}
repositories {
mavenCentral()
maven { url = "https://repo.papermc.io/repository/maven-public/" }
maven { url = "https://repo.thenextlvl.net/releases" }
maven { url = "https://repo.codemc.io/repository/maven-public/" }
maven { url = "https://repo.extendedclip.com/content/repositories/placeholderapi/" }
}
// Shading Maven Central dependencies is not needed.
// Only if the repository becomes unreliable in the future.
dependencies {
// Lombok
compileOnly("org.projectlombok:lombok:1.18.42")
annotationProcessor("org.projectlombok:lombok:1.18.42")
// Paper API
compileOnly("io.papermc.paper:paper-api:1.21.10-R0.1-SNAPSHOT")
// https://github.com/Revxrsal/Lamp
paperLibrary("io.github.revxrsal:lamp.common:4.0.0-rc.17")
paperLibrary("io.github.revxrsal:lamp.bukkit:4.0.0-rc.17")
// https://github.com/Revxrsal/Spec
paperLibrary("io.github.revxrsal:spec:1.5")
// https://github.com/faststats-dev/dev-kits
shadowImplementation("dev.faststats.metrics:bukkit:0.27.0")
// https://github.com/PlaceholderAPI/PlaceholderAPI
compileOnly("me.clip:placeholderapi:2.12.2")
// https://github.com/retrooper/packetevents
compileOnly("com.github.retrooper:packetevents-spigot:2.12.2")
}
// Registering runFolia task so that Folia compatibility can be tested more easily.
runPaper.folia.registerTask()
tasks {
runServer {
minecraftVersion("26.1.2")
downloadPlugins {
// modrinth("axiom-paper-plugin", "5.0.2+1.21.10")
modrinth("luckperms", "v5.5.17-bukkit")
modrinth("placeholderapi", "2.12.2")
modrinth("packetevents", "2.12.2+spigot")
}
}
runFolia {
minecraftVersion("1.21.11")
downloadPlugins {
modrinth("luckperms", "v5.5.17-bukkit")
modrinth("placeholderapi", "2.11.7")
modrinth("packetevents", "2.11.2+spigot")
}
}
compileJava {
options.fork = true
options.compilerArgs += "-parameters"
// Setting compatibility to Java 21 and higher.
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
shadowJar {
configurations = [project.configurations.shadowImplementation]
archiveFileName = "${project.name}-${version}.jar"
relocate("dev.faststats", "cloud.grabsky.displayentities.libs.dev.faststats")
}
}
paper {
main = "cloud.grabsky.displayentities.DisplayEntities"
loader = "cloud.grabsky.displayentities.DisplayEntities\$PluginLoader"
apiVersion = "1.21.10"
foliaSupported = true
generateLibrariesJson = true
serverDependencies {
"PlaceholderAPI" { load = "BEFORE"; required = false }
"packetevents" { load = "BEFORE"; required = false }
}
}
// Configuring runServer task to use JetBrains' JDK 21 for expanded hot-swap features.
tasks.withType(xyz.jpenilla.runtask.task.AbstractRun.class).configureEach {
javaLauncher = javaToolchains.launcherFor {
vendor = JvmVendorSpec.JETBRAINS
languageVersion = JavaLanguageVersion.of(25)
}
// -XX:+AllowEnhancedClassRedefinition is not currently supported by Spark on Java 25.
// When testing plugin with recent Java versions, either disable Spark in Paper's global configuration or remove '-XX:+AllowEnhancedClassRedefinition' flag from jvmArgs array.
jvmArgs("-Xmx1G", "-XX:+AllowEnhancedClassRedefinition", "-Dcom.mojang.eula.agree=true", "-Dnet.kyori.ansi.colorLevel=truecolor")
}
// Returns formatted release name. (for GitHub Actions)
tasks.register("getRelease", () -> print("$VERSION #$RUN_NUMBER"))
// Returns formatted tag name. (for GitHub Actions)
tasks.register("getTag", () -> print("$VERSION+$RUN_NUMBER"))