-
Notifications
You must be signed in to change notification settings - Fork 8
/
build.gradle.kts
139 lines (124 loc) · 4.24 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
import xyz.jpenilla.resourcefactory.bukkit.Permission
plugins {
`java-library`
id("com.gradleup.shadow") version "8.3.0"
id("xyz.jpenilla.resource-factory-bukkit-convention") version "1.2.0"
val indraVersion = "3.1.3"
id("net.kyori.indra") version indraVersion
id("net.kyori.indra.git") version indraVersion
id("xyz.jpenilla.run-paper") version "2.3.1"
}
group = "xyz.jpenilla"
version = "1.8.5-SNAPSHOT".decorateVersion()
description = "Customizable trades for Wandering Traders."
val mcVersion = "1.21.1"
repositories {
mavenCentral()
sonatype.s01Snapshots()
sonatype.ossSnapshots()
maven("https://repo.papermc.io/repository/maven-public/")
maven("https://repo.jpenilla.xyz/snapshots/") {
mavenContent { snapshotsOnly() }
}
maven("https://repo.essentialsx.net/releases/") {
mavenContent { includeGroup("net.essentialsx") }
}
maven("https://maven.enginehub.org/repo/")
maven("https://jitpack.io") {
content { includeGroup("com.github.MilkBowl") }
}
}
dependencies {
compileOnly("io.papermc.paper", "paper-api", "1.21.1-R0.1-SNAPSHOT")
implementation("io.papermc", "paperlib", "1.0.8")
implementation("xyz.jpenilla", "legacy-plugin-base", "0.0.1+122-SNAPSHOT")
implementation("org.bstats", "bstats-bukkit", "3.0.3")
implementation(platform("org.incendo:cloud-bom:2.0.0"))
implementation(platform("org.incendo:cloud-minecraft-bom:2.0.0-SNAPSHOT"))
implementation("org.incendo:cloud-paper")
implementation("org.incendo:cloud-minecraft-extras")
implementation(platform("org.incendo:cloud-translations-bom:1.0.0-SNAPSHOT"))
implementation("org.incendo:cloud-translations-bukkit")
implementation("org.incendo:cloud-translations-minecraft-extras")
implementation("org.incendo.interfaces", "interfaces-paper", "1.0.0-SNAPSHOT")
compileOnly("com.github.MilkBowl", "VaultAPI", "1.7.1")
compileOnly("net.essentialsx", "EssentialsX", "2.20.1") {
isTransitive = false
}
compileOnly("org.checkerframework", "checker-qual", "3.46.0")
compileOnly("com.sk89q.worldguard", "worldguard-bukkit", "7.0.9") {
exclude("org.bukkit")
}
compileOnly("com.sk89q.worldedit", "worldedit-bukkit", "7.3.0")
}
java {
disableAutoTargetJvm()
}
indra {
javaVersions{
minimumToolchain(21)
target(17)
}
}
bukkitPluginYaml {
main = "xyz.jpenilla.wanderingtrades.WanderingTrades"
apiVersion = "1.16"
website = "https://github.com/jpenilla/WanderingTrades"
authors = listOf("jmp")
softDepend = listOf("WorldEdit", "WorldGuard", "Vault", "PlaceholderAPI", "ViaVersion")
permissions {
register("wanderingtrades.trader-spawn-notifications") {
default = Permission.Default.TRUE
}
}
}
tasks {
runServer {
minecraftVersion(mcVersion)
}
assemble {
dependsOn(shadowJar)
}
jar {
archiveClassifier.set("noshade")
manifest {
attributes("paperweight-mappings-namespace" to "mojang")
}
}
shadowJar {
archiveFileName.set("${project.name}-${project.version}.jar")
sequenceOf(
"org.bstats",
"org.incendo",
"xyz.jpenilla.pluginbase",
"net.kyori",
"io.papermc.lib",
"io.leangen.geantyref",
).forEach {
relocate(it, "xyz.jpenilla.wanderingtrades.lib.$it")
}
mergeServiceFiles()
}
processResources {
val tokens = mapOf(
"project.version" to project.version
)
inputs.properties(tokens)
filesMatching("**/*.yml") {
// Some of our files are too large to use Groovy templating
filter { string ->
var result = string
for ((key, value) in tokens) {
result = result.replace("\${$key}", value.toString())
}
result
}
}
}
compileJava {
options.compilerArgs.add("-Xlint:-classfile,-processing")
}
}
fun lastCommitHash(): String = indraGit.commit()?.name?.substring(0, 7)
?: error("Could not determine commit hash")
fun String.decorateVersion(): String = if (endsWith("-SNAPSHOT")) "$this+${lastCommitHash()}" else this