From 9809c9e47b280f090be06be07ad376e9fc2a8ea7 Mon Sep 17 00:00:00 2001 From: Kyle Wood Date: Fri, 26 Nov 2021 00:08:46 -0600 Subject: [PATCH] Upgrade paperweight with bundler jar updates This allows creating paperclip jars pre-patch (only the reobf'd jar for now). --- Paper-MojangAPI/build.gradle.kts | 5 +---- build.gradle.kts | 4 ++-- patches/api/Convert-project-to-Gradle.patch | 5 +---- patches/server/Build-system-changes.patch | 2 +- ...te-stacktraces-in-log-messages-crash-report.patch | 2 +- patches/server/Implement-Brigadier-Mojang-API.patch | 4 ++-- ...nyPlayerCloseEnoughForSpawning-to-use-dist.patch} | 0 patches/server/Setup-Gradle-project.patch | 4 +--- ...nalConsoleAppender-for-console-improvements.patch | 2 +- ...Use-Velocity-compression-and-cipher-natives.patch | 6 +++++- settings.gradle.kts | 12 +++++++----- 11 files changed, 22 insertions(+), 24 deletions(-) rename patches/server/{Optimize-anyPlayerCloseEnoughForSpawning-to-use-distance-maps.patch => Optimize-anyPlayerCloseEnoughForSpawning-to-use-dist.patch} (100%) diff --git a/Paper-MojangAPI/build.gradle.kts b/Paper-MojangAPI/build.gradle.kts index f7bf0ff771..854971e10d 100644 --- a/Paper-MojangAPI/build.gradle.kts +++ b/Paper-MojangAPI/build.gradle.kts @@ -1,5 +1,3 @@ -import java.util.Locale - plugins { `java-library` `maven-publish` @@ -16,7 +14,7 @@ repositories { } dependencies { - implementation(project(":Paper-API")) + implementation(project(":paper-api")) api("com.mojang:brigadier:1.0.18") compileOnly("it.unimi.dsi:fastutil:8.2.2") @@ -29,7 +27,6 @@ dependencies { configure { publications.create("maven") { - artifactId = project.name.toLowerCase(Locale.ENGLISH) from(components["java"]) } } diff --git a/build.gradle.kts b/build.gradle.kts index 4f69aafe47..4885c0be6e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -49,12 +49,12 @@ dependencies { paramMappings("net.fabricmc:yarn:1.18-pre8+build.4:mergedv2") remapper("net.fabricmc:tiny-remapper:0.7.0:fat") decompiler("net.minecraftforge:forgeflower:1.5.498.22") - paperclip("io.papermc:paperclip:2.0.1") + paperclip("io.papermc:paperclip:3.0.0-SNAPSHOT") } paperweight { minecraftVersion.set(providers.gradleProperty("mcVersion")) - serverProject.set(project(":Paper-Server")) + serverProject.set(project(":paper-server")) paramMappingsRepo.set("https://maven.fabricmc.net/") remapRepo.set("https://maven.fabricmc.net/") diff --git a/patches/api/Convert-project-to-Gradle.patch b/patches/api/Convert-project-to-Gradle.patch index 6a4b0fc8d9..216d91716e 100644 --- a/patches/api/Convert-project-to-Gradle.patch +++ b/patches/api/Convert-project-to-Gradle.patch @@ -31,8 +31,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +0,0 @@ -+import java.util.Locale -+ +plugins { + `java-library` + `maven-publish` @@ -66,7 +64,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + +configure { + publications.create("maven") { -+ artifactId = project.name.toLowerCase(Locale.ENGLISH) + from(components["java"]) + } +} @@ -82,7 +79,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + +tasks.jar { + from(generateApiVersioningFile.map { it.outputs.files.singleFile }) { -+ into("META-INF/maven/${project.group}/${project.name.toLowerCase(Locale.ENGLISH)}") ++ into("META-INF/maven/${project.group}/${project.name}") + } + manifest { + attributes( diff --git a/patches/server/Build-system-changes.patch b/patches/server/Build-system-changes.patch index db9d8e19cd..755b553750 100644 --- a/patches/server/Build-system-changes.patch +++ b/patches/server/Build-system-changes.patch @@ -10,7 +10,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/build.gradle.kts @@ -0,0 +0,0 @@ repositories { dependencies { - implementation(project(":Paper-API")) + implementation(project(":paper-api")) implementation("jline:jline:2.12.1") - implementation("org.apache.logging.log4j:log4j-iostreams:2.14.1") { - exclude(group = "org.apache.logging.log4j", module = "log4j-api") diff --git a/patches/server/Deobfuscate-stacktraces-in-log-messages-crash-report.patch b/patches/server/Deobfuscate-stacktraces-in-log-messages-crash-report.patch index 27c63f374f..2831405cac 100644 --- a/patches/server/Deobfuscate-stacktraces-in-log-messages-crash-report.patch +++ b/patches/server/Deobfuscate-stacktraces-in-log-messages-crash-report.patch @@ -13,9 +13,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +import io.papermc.paperweight.tasks.BaseTask import io.papermc.paperweight.util.* +import java.nio.file.Files - import java.util.Locale plugins { + java @@ -0,0 +0,0 @@ plugins { repositories { diff --git a/patches/server/Implement-Brigadier-Mojang-API.patch b/patches/server/Implement-Brigadier-Mojang-API.patch index 3d2e9ef586..1366faba7f 100644 --- a/patches/server/Implement-Brigadier-Mojang-API.patch +++ b/patches/server/Implement-Brigadier-Mojang-API.patch @@ -16,8 +16,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ repositories { dependencies { - implementation(project(":Paper-API")) -+ implementation(project(":Paper-MojangAPI")) + implementation(project(":paper-api")) ++ implementation(project(":paper-mojangapi")) // Paper start implementation("org.jline:jline-terminal-jansi:3.21.0") implementation("net.minecrell:terminalconsoleappender:1.3.0") diff --git a/patches/server/Optimize-anyPlayerCloseEnoughForSpawning-to-use-distance-maps.patch b/patches/server/Optimize-anyPlayerCloseEnoughForSpawning-to-use-dist.patch similarity index 100% rename from patches/server/Optimize-anyPlayerCloseEnoughForSpawning-to-use-distance-maps.patch rename to patches/server/Optimize-anyPlayerCloseEnoughForSpawning-to-use-dist.patch diff --git a/patches/server/Setup-Gradle-project.patch b/patches/server/Setup-Gradle-project.patch index da94fac057..84e45d4466 100644 --- a/patches/server/Setup-Gradle-project.patch +++ b/patches/server/Setup-Gradle-project.patch @@ -33,7 +33,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/build.gradle.kts @@ -0,0 +0,0 @@ +import io.papermc.paperweight.util.* -+import java.util.Locale + +plugins { + java @@ -46,7 +45,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +} + +dependencies { -+ implementation(project(":Paper-API")) ++ implementation(project(":paper-api")) + implementation("jline:jline:2.12.1") + implementation("org.apache.logging.log4j:log4j-iostreams:2.14.1") { + exclude(group = "org.apache.logging.log4j", module = "log4j-api") @@ -92,7 +91,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + +publishing { + publications.create("maven") { -+ artifactId = rootProject.name.toLowerCase(Locale.ENGLISH) + artifact(tasks.reobfJar) { + classifier = null + } diff --git a/patches/server/Use-TerminalConsoleAppender-for-console-improvements.patch b/patches/server/Use-TerminalConsoleAppender-for-console-improvements.patch index d71b31a481..396d79d1c9 100644 --- a/patches/server/Use-TerminalConsoleAppender-for-console-improvements.patch +++ b/patches/server/Use-TerminalConsoleAppender-for-console-improvements.patch @@ -25,7 +25,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ repositories { dependencies { - implementation(project(":Paper-API")) + implementation(project(":paper-api")) - implementation("jline:jline:2.12.1") + // Paper start + implementation("org.jline:jline-terminal-jansi:3.21.0") diff --git a/patches/server/Use-Velocity-compression-and-cipher-natives.patch b/patches/server/Use-Velocity-compression-and-cipher-natives.patch index ad61d5975a..6fafd6c4b9 100644 --- a/patches/server/Use-Velocity-compression-and-cipher-natives.patch +++ b/patches/server/Use-Velocity-compression-and-cipher-natives.patch @@ -12,7 +12,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.7.0") implementation("net.fabricmc:mapping-io:0.3.0") // Paper - needed to read mappings for stacktrace deobfuscation -+ implementation("com.velocitypowered:velocity-native:1.1.0-SNAPSHOT") // Paper ++ // Paper start - Use Velocity cipher ++ implementation("com.velocitypowered:velocity-native:1.1.0-SNAPSHOT") { ++ isTransitive = false ++ } ++ // Paper end testImplementation("io.github.classgraph:classgraph:4.8.47") // Paper - mob goal test testImplementation("junit:junit:4.13.1") diff --git a/settings.gradle.kts b/settings.gradle.kts index de13572ae2..93c30c81d9 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,3 +1,5 @@ +import java.util.Locale + pluginManagement { repositories { gradlePluginPortal() @@ -7,11 +9,11 @@ pluginManagement { rootProject.name = "Paper" -include( - "Paper-API", - "Paper-Server", - "Paper-MojangAPI", -) +for (name in listOf("Paper-API", "Paper-Server", "Paper-MojangAPI")) { + val projName = name.toLowerCase(Locale.ENGLISH) + include(projName) + findProject(":$projName")!!.projectDir = file(name) +} val testPlugin = file("test-plugin.settings.gradle.kts") if (testPlugin.exists()) {