-
Notifications
You must be signed in to change notification settings - Fork 28
/
build.gradle.kts
87 lines (73 loc) · 2.72 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
plugins {
`java-library`
alias(libs.plugins.paperweight.userdev)
alias(libs.plugins.run.paper) // Adds runServer and runMojangMappedServer tasks for testing
// Shades and relocates dependencies into our plugin jar. See https://imperceptiblethoughts.com/shadow/introduction/
alias(libs.plugins.shadow)
}
group = "com.moulberry.axiom"
version = "4.0.2"
description = "Serverside component for Axiom on Paper"
java {
// Configure the java toolchain. This allows gradle to auto-provision JDK 21 on systems that only have JDK 11 installed for example.
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
}
repositories {
mavenCentral()
maven("https://repo.viaversion.com")
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/")
maven("https://jitpack.io")
maven("https://repo.papermc.io/repository/maven-public/")
maven("https://maven.enginehub.org/repo/")
maven("https://maven.playpro.com")
}
dependencies {
paperweight.paperDevBundle(libs.versions.paper)
implementation(libs.reflection.remapper)
implementation(libs.cloud.paper)
// Zstd Compression Library
implementation(libs.zstd.jni)
// ViaVersion support
compileOnly(libs.viaversion.api)
// WorldGuard support
compileOnly(libs.worldguard.bukkit)
// PlotSquared support
implementation(platform(libs.bom.newest))
compileOnly(libs.plotsquared.core)
compileOnly(libs.plotsquared.bukkit) { isTransitive = false }
// CoreProtect support
compileOnly(libs.coreprotect)
}
tasks {
// Configure reobfJar to run when invoking the build task
assemble {
dependsOn(reobfJar)
}
compileJava {
options.encoding = Charsets.UTF_8.name() // We want UTF-8 for everything
// Set the release flag. This configures what version bytecode the compiler will emit, as well as what JDK APIs are usable.
// See https://openjdk.java.net/jeps/247 for more information.
options.release.set(21)
}
javadoc {
options.encoding = Charsets.UTF_8.name() // We want UTF-8 for everything
}
processResources {
filteringCharset = Charsets.UTF_8.name() // We want UTF-8 for everything
val props = mapOf(
"name" to project.name,
"version" to project.version,
"description" to project.description,
"apiVersion" to "1.21"
)
inputs.properties(props)
filesMatching("plugin.yml") {
expand(props)
}
}
shadowJar {
// helper function to relocate a package into our package
fun reloc(pkg: String) = relocate(pkg, "com.moulberry.axiom.dependency.$pkg")
reloc("xyz.jpenilla:reflection-remapper")
}
}