Start cleaning up plugin remapping patches

This commit is contained in:
Jason Penilla 2024-04-27 13:27:01 -07:00
parent ba5fe77f0f
commit a97258b9ee
5 changed files with 22 additions and 108 deletions

View File

@ -1,48 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
Date: Mon, 12 Feb 2024 22:19:03 -0700
Subject: [PATCH] Add WorldEdit plugin flag test task
diff --git a/build.gradle.kts b/build.gradle.kts
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -0,0 +0,0 @@
import io.papermc.paperweight.util.*
+import xyz.jpenilla.runpaper.task.RunServer
plugins {
java
`maven-publish`
id("com.github.johnrengelman.shadow")
+ id("xyz.jpenilla.run-paper") version "2.2.3" apply false
}
val log4jPlugins = sourceSets.create("log4jPlugins")
@@ -0,0 +0,0 @@ tasks.registerRunTask("runDevServer") {
jvmArgs("-DPaper.pushPaperAssetsRoot=true")
}
+tasks.register<RunServer>("runWithPlugins") {
+ version.set(providers.gradleProperty("mcVersion"))
+ runJar(rootProject.tasks.named<io.papermc.paperweight.tasks.CreateBundlerJar>("createMojmapBundlerJar").flatMap { it.outputZip })
+ downloadPlugins {
+ url("https://ci.enginehub.org/repository/download/bt10/23382:id/worldedit-bukkit-7.2.19-dist.jar?branch=version/7.2.x&guest=1")
+ url("https://www.patreon.com/file?h=89830486&i=15920178")
+ url("https://dev.bukkit.org/projects/grief-prevention/files/4433061/download")
+ github("EssentialsX", "Essentials", "2.20.1", "EssentialsX-2.20.1.jar")
+ hangar("squaremap", "1.2.3")
+ hangar("FancyHolograms", "2.0.5")
+ hangar("Chunky", "1.3.92")
+ hangar("Multiverse-Core", "4.3.12")
+ // Once they fix package parsing
+ // hangar("Denizen", "1.3.0-Build-1803")
+ // hangar("GrimAnticheat", "2.3.58")
+ // hangar("ProtocolLib", "5.1.0")
+ }
+ runDirectory.set(rootProject.layout.projectDirectory.dir("run"))
+}
tasks.registerRunTask("runBundler") {
description = "Spin up a test server from the Mojang mapped bundler jar"
classpath(rootProject.tasks.named<io.papermc.paperweight.tasks.CreateBundlerJar>("createMojmapBundlerJar").flatMap { it.outputZip })

View File

@ -41,14 +41,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
)
for (tld in setOf("net", "com", "org")) {
attributes("$tld/bukkit", "Sealed" to true)
@@ -0,0 +0,0 @@ tasks.shadowJar {
configurations = listOf(project.configurations.vanillaServer.get())
@@ -0,0 +0,0 @@ publishing {
}
}
+// Paper start
+val scanJar = tasks.register("scanJarForBadCalls", io.papermc.paperweight.tasks.ScanJarForBadCalls::class) {
+ badAnnotations.add("Lio/papermc/paper/annotation/DoNotUse;")
+ jarToScan.set(tasks.shadowJar.flatMap { it.archiveFile })
+ jarToScan.set(tasks.serverJar.flatMap { it.archiveFile })
+ classpath.from(configurations.compileClasspath)
+}
+tasks.check {

View File

@ -37,7 +37,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+plugins {
+ java
+ `maven-publish`
+ id("com.github.johnrengelman.shadow")
+}
+
+dependencies {
@ -90,10 +89,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+}
+
+tasks.shadowJar {
+ configurations = listOf(project.configurations.vanillaServer.get())
+}
+
+tasks.test {
+ exclude("org/bukkit/craftbukkit/inventory/ItemStack*Test.class")
+ useJUnitPlatform()

View File

@ -29,7 +29,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -0,0 +0,0 @@ plugins {
id("com.github.johnrengelman.shadow")
`maven-publish`
}
+val log4jPlugins = sourceSets.create("log4jPlugins")
@ -60,15 +60,26 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
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
@@ -0,0 +0,0 @@ publishing {
@@ -0,0 +0,0 @@ tasks.check {
dependsOn(scanJar)
}
// Paper end
+// Paper start - use TCA for console improvements
+tasks.serverJar {
+ from(alsoShade.elements.map {
+ it.map { f ->
+ if (f.asFile.isFile) {
+ zipTree(f.asFile)
+ } else {
+ f.asFile
+ }
+ }
+ })
+}
+// Paper end - use TCA for console improvements
tasks.shadowJar {
- configurations = listOf(project.configurations.vanillaServer.get())
+ configurations = listOf(project.configurations.vanillaServer.get(), alsoShade) // Paper
}
// Paper start
tasks.test {
exclude("org/bukkit/craftbukkit/inventory/ItemStack*Test.class")
diff --git a/src/log4jPlugins/java/io/papermc/paper/console/StripANSIConverter.java b/src/log4jPlugins/java/io/papermc/paper/console/StripANSIConverter.java
new file mode 100644
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000

View File

@ -1,44 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
Date: Thu, 18 Apr 2024 13:39:18 -0700
Subject: [PATCH] build: replace use of shadow plugin
diff --git a/build.gradle.kts b/build.gradle.kts
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -0,0 +0,0 @@ import xyz.jpenilla.runpaper.task.RunServer
plugins {
java
`maven-publish`
- id("com.github.johnrengelman.shadow")
id("xyz.jpenilla.run-paper") version "2.2.3" apply false
}
@@ -0,0 +0,0 @@ publishing {
}
}
-tasks.shadowJar {
- configurations = listOf(project.configurations.vanillaServer.get(), alsoShade) // Paper
+tasks.serverJar {
+ from(alsoShade.elements.map {
+ it.map { f ->
+ if (f.asFile.isFile) {
+ zipTree(f.asFile)
+ } else {
+ f.asFile
+ }
+ }
+ })
}
// Paper start
val scanJar = tasks.register("scanJarForBadCalls", io.papermc.paperweight.tasks.ScanJarForBadCalls::class) {
badAnnotations.add("Lio/papermc/paper/annotation/DoNotUse;")
- jarToScan.set(tasks.shadowJar.flatMap { it.archiveFile })
+ jarToScan.set(tasks.serverJar.flatMap { it.archiveFile })
classpath.from(configurations.compileClasspath)
}
tasks.check {