Move cb version definition to gradle patch

This commit is contained in:
Jason Penilla 2024-04-27 14:02:33 -07:00
parent b7e148a107
commit a390119b04
No known key found for this signature in database
GPG key ID: 0E75A301420E48F8
9 changed files with 26 additions and 39 deletions

View file

@ -28,10 +28,10 @@ index 37dab9e868dbfb019c271a547d975a48ad1cb571..3811c0d849a3eb028ed1a6b7a2d4747f
+/.factorypath
diff --git a/build.gradle.kts b/build.gradle.kts
new file mode 100644
index 0000000000000000000000000000000000000000..a41b15de7eba00d62822f582015d324ccde7dfe7
index 0000000000000000000000000000000000000000..0aa34e8bb81700a3660ba89b3e2a8f53f10ca34c
--- /dev/null
+++ b/build.gradle.kts
@@ -0,0 +1,119 @@
@@ -0,0 +1,122 @@
+import io.papermc.paperweight.util.*
+
+plugins {
@ -60,7 +60,10 @@ index 0000000000000000000000000000000000000000..a41b15de7eba00d62822f582015d324c
+ testImplementation("org.ow2.asm:asm-tree:9.7")
+}
+
+val craftbukkitPackageVersion = "1_20_R4" // Paper
+paperweight {
+ craftBukkitPackageVersion.set("v1_20_R4") // also needs to be updated in MappingEnvironment
+}
+
+tasks.jar {
+ archiveClassifier.set("dev")
+

View file

@ -9,7 +9,7 @@ public net.minecraft.server.packs.VanillaPackResourcesBuilder safeGetPath(Ljava/
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
diff --git a/build.gradle.kts b/build.gradle.kts
index a41b15de7eba00d62822f582015d324ccde7dfe7..4d38e90fddc74fb0b0d1be23990d35e60ccd9544 100644
index 0aa34e8bb81700a3660ba89b3e2a8f53f10ca34c..0d0e1191df8c68fc7142d3d63bd9416477811a17 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -8,9 +8,7 @@ plugins {
@ -23,7 +23,7 @@ index a41b15de7eba00d62822f582015d324ccde7dfe7..4d38e90fddc74fb0b0d1be23990d35e6
implementation("org.ow2.asm:asm-commons:9.7")
implementation("commons-lang:commons-lang:2.6")
runtimeOnly("org.xerial:sqlite-jdbc:3.45.3.0")
@@ -35,6 +33,7 @@ tasks.jar {
@@ -38,6 +36,7 @@ tasks.jar {
val gitHash = git("rev-parse", "--short=7", "HEAD").getText().trim()
val implementationVersion = System.getenv("BUILD_NUMBER") ?: "\"$gitHash\""
val date = git("show", "-s", "--format=%ci", gitHash).getText().trim() // Paper
@ -31,17 +31,17 @@ index a41b15de7eba00d62822f582015d324ccde7dfe7..4d38e90fddc74fb0b0d1be23990d35e6
attributes(
"Main-Class" to "org.bukkit.craftbukkit.Main",
"Implementation-Title" to "CraftBukkit",
@@ -43,6 +42,9 @@ tasks.jar {
@@ -46,6 +45,9 @@ tasks.jar {
"Specification-Title" to "Bukkit",
"Specification-Version" to project.version,
"Specification-Vendor" to "Bukkit Team",
+ "Git-Branch" to gitBranch, // Paper
+ "Git-Commit" to gitHash, // Paper
+ "CraftBukkit-Package-Version" to craftbukkitPackageVersion, // Paper
+ "CraftBukkit-Package-Version" to paperweight.craftBukkitPackageVersion.get(), // Paper
)
for (tld in setOf("net", "com", "org")) {
attributes("$tld/bukkit", "Sealed" to true)
@@ -55,6 +57,17 @@ publishing {
@@ -58,6 +60,17 @@ publishing {
}
}
@ -59,7 +59,7 @@ index a41b15de7eba00d62822f582015d324ccde7dfe7..4d38e90fddc74fb0b0d1be23990d35e6
tasks.test {
exclude("org/bukkit/craftbukkit/inventory/ItemStack*Test.class")
useJUnitPlatform()
@@ -116,4 +129,5 @@ tasks.registerRunTask("runReobf") {
@@ -119,4 +132,5 @@ tasks.registerRunTask("runReobf") {
tasks.registerRunTask("runDev") {
description = "Spin up a non-relocated Mojang-mapped test server"
classpath(sourceSets.main.map { it.runtimeClasspath })

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Test changes
diff --git a/build.gradle.kts b/build.gradle.kts
index 4d38e90fddc74fb0b0d1be23990d35e60ccd9544..583f2c236d98d2c8348787eadc813d1218e25336 100644
index 0d0e1191df8c68fc7142d3d63bd9416477811a17..842a73be79b755009acd830760fe0d2b405c2a8e 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -22,6 +22,7 @@ dependencies {
@ -15,8 +15,8 @@ index 4d38e90fddc74fb0b0d1be23990d35e60ccd9544..583f2c236d98d2c8348787eadc813d12
+ testImplementation("org.junit-pioneer:junit-pioneer:2.2.0") // Paper - CartesianTest
}
val craftbukkitPackageVersion = "1_20_R4" // Paper
@@ -52,6 +53,12 @@ tasks.jar {
paperweight {
@@ -55,6 +56,12 @@ tasks.jar {
}
}

View file

@ -15,7 +15,7 @@ public net.minecraft.server.dedicated.DedicatedServerProperties reload(Lnet/mine
public net.minecraft.world.level.NaturalSpawner SPAWNING_CATEGORIES
diff --git a/build.gradle.kts b/build.gradle.kts
index 583f2c236d98d2c8348787eadc813d1218e25336..2a7db88148b708754d5f33ed5266ecefcad9d27c 100644
index 842a73be79b755009acd830760fe0d2b405c2a8e..4640fc676ca3d4a9eb6276e027e086862ed655b0 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -10,6 +10,7 @@ dependencies {

View file

@ -25,7 +25,7 @@ Other changes:
Co-Authored-By: Emilia Kond <emilia@rymiel.space>
diff --git a/build.gradle.kts b/build.gradle.kts
index 2a7db88148b708754d5f33ed5266ecefcad9d27c..0aed38d217707a916f2a42ede9525b88560b6c8b 100644
index 4640fc676ca3d4a9eb6276e027e086862ed655b0..869df6523b3c502e0331810953cb8b3b30ae58a5 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -5,9 +5,29 @@ plugins {
@ -59,7 +59,7 @@ index 2a7db88148b708754d5f33ed5266ecefcad9d27c..0aed38d217707a916f2a42ede9525b88
implementation("org.apache.logging.log4j:log4j-iostreams:2.22.1") // Paper - remove exclusion
implementation("org.ow2.asm:asm-commons:9.7")
implementation("org.spongepowered:configurate-yaml:4.2.0-SNAPSHOT") // Paper - config files
@@ -75,6 +95,19 @@ tasks.check {
@@ -78,6 +98,19 @@ tasks.check {
dependsOn(scanJar)
}
// Paper end

View file

@ -15,7 +15,7 @@ This may cause additional prefixes to be disabled for plugins bypassing
the plugin logger.
diff --git a/build.gradle.kts b/build.gradle.kts
index 0aed38d217707a916f2a42ede9525b88560b6c8b..4260860c3dc0335b570899ab461c17f0ade00ed6 100644
index 869df6523b3c502e0331810953cb8b3b30ae58a5..53b5724c16a54cb7ca0c3095724cd2a9271c98b9 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -23,7 +23,7 @@ dependencies {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Use AsyncAppender to keep logging IO off main thread
diff --git a/build.gradle.kts b/build.gradle.kts
index 4260860c3dc0335b570899ab461c17f0ade00ed6..d3005f310a256c000a62314832d5e90eecfefbf6 100644
index 53b5724c16a54cb7ca0c3095724cd2a9271c98b9..90983bcc4ec752b6266afb70b5d9b939a1812815 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -32,8 +32,7 @@ dependencies {

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Deobfuscate stacktraces in log messages, crash reports, and
diff --git a/build.gradle.kts b/build.gradle.kts
index d3005f310a256c000a62314832d5e90eecfefbf6..3587ff0a4c0fe92c99501aa5251f379481e43437 100644
index 90983bcc4ec752b6266afb70b5d9b939a1812815..f4198f997d82ccf761137cda8c1827e202686c75 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -43,6 +43,7 @@ dependencies {
@ -16,7 +16,7 @@ index d3005f310a256c000a62314832d5e90eecfefbf6..3587ff0a4c0fe92c99501aa5251f3794
+ implementation("net.neoforged:srgutils:1.0.9") // Paper - mappings handling
}
val craftbukkitPackageVersion = "1_20_R4" // Paper
paperweight {
diff --git a/src/log4jPlugins/java/io/papermc/paper/logging/StacktraceDeobfuscatingRewritePolicy.java b/src/log4jPlugins/java/io/papermc/paper/logging/StacktraceDeobfuscatingRewritePolicy.java
new file mode 100644
index 0000000000000000000000000000000000000000..66b6011ee3684695b2ab9292961c80bf2a420ee9

View file

@ -6,34 +6,18 @@ Subject: [PATCH] Plugin remapping
Co-authored-by: Nassim Jahnke <nassim@njahnke.dev>
diff --git a/build.gradle.kts b/build.gradle.kts
index 3587ff0a4c0fe92c99501aa5251f379481e43437..600b442986fa5ca9dd12f900caa284b854cc30ca 100644
index f4198f997d82ccf761137cda8c1827e202686c75..600b442986fa5ca9dd12f900caa284b854cc30ca 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -44,9 +44,13 @@ dependencies {
@@ -44,6 +44,7 @@ dependencies {
testImplementation("org.ow2.asm:asm-tree:9.7")
testImplementation("org.junit-pioneer:junit-pioneer:2.2.0") // Paper - CartesianTest
implementation("net.neoforged:srgutils:1.0.9") // Paper - mappings handling
+ implementation("net.neoforged:AutoRenamingTool:2.0.3") // Paper - remap plugins
+}
+
+paperweight {
+ craftBukkitPackageVersion.set("v1_20_R4") // also needs to be updated in MappingEnvironment
}
-val craftbukkitPackageVersion = "1_20_R4" // Paper
tasks.jar {
archiveClassifier.set("dev")
@@ -66,7 +70,7 @@ tasks.jar {
"Specification-Vendor" to "Bukkit Team",
"Git-Branch" to gitBranch, // Paper
"Git-Commit" to gitHash, // Paper
- "CraftBukkit-Package-Version" to craftbukkitPackageVersion, // Paper
+ "CraftBukkit-Package-Version" to paperweight.craftBukkitPackageVersion.get(), // Paper
)
for (tld in setOf("net", "com", "org")) {
attributes("$tld/bukkit", "Sealed" to true)
@@ -155,20 +159,41 @@ val runtimeClasspathWithoutVanillaServer = configurations.runtimeClasspath.flatM
paperweight {
@@ -158,20 +159,41 @@ val runtimeClasspathWithoutVanillaServer = configurations.runtimeClasspath.flatM
runtime.filterNot { it.asFile.absolutePath == vanilla }
}