Repository navigation
Expand file tree
/
Copy pathbuild.gradle
More file actions
95 lines (81 loc) · 2.98 KB
/
Copy pathbuild.gradle
File metadata and controls
95 lines (81 loc) · 2.98 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
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.4.2"
final String RUN_NUMBER = System.getenv("GITHUB_RUN_NUMBER") ?: "DEV"
group = "cloud.grabsky"
version = "$VERSION+$RUN_NUMBER"
configurations {
shadowImplementation
}
configurations.implementation {
extendsFrom(configurations.shadowImplementation)
}
tasks.named("runServer") {
dependsOn(tasks.named("jar"))
}
repositories {
mavenLocal()
mavenCentral()
maven { url = "https://repo.papermc.io/repository/maven-public/" }
maven { url = "https://repo.thenextlvl.net/releases" }
}
// 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.1-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")
}
tasks {
runServer {
minecraftVersion("1.21.11")
}
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.recipes.libs.dev.faststats")
}
}
paper {
main = "cloud.grabsky.recipes.Recipes"
loader = "cloud.grabsky.recipes.Recipes\$PluginLoader"
apiVersion = "1.21.1"
foliaSupported = true
generateLibrariesJson = true
authors = ["LoreSchaeffer", "Grabsky"]
}
// 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(21)
}
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"))