From 39f1a61c2f0f6054364dc4eba868f9bf79a85fda Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Thu, 8 Jul 2021 19:57:49 -0700 Subject: [PATCH] updates --- 0001-Setup-dev-bundle-publishing.patch | 113 +++++++++++++++++++++++++ build.gradle.kts | 32 +++++-- 2 files changed, 136 insertions(+), 9 deletions(-) create mode 100644 0001-Setup-dev-bundle-publishing.patch diff --git a/0001-Setup-dev-bundle-publishing.patch b/0001-Setup-dev-bundle-publishing.patch new file mode 100644 index 0000000..4cece46 --- /dev/null +++ b/0001-Setup-dev-bundle-publishing.patch @@ -0,0 +1,113 @@ +From fb950cd96500ed930aa561c5f03e777a6c9cec24 Mon Sep 17 00:00:00 2001 +From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> +Date: Thu, 8 Jul 2021 19:56:34 -0700 +Subject: [PATCH] Setup dev bundle publishing + +Gradle property `publishDevBundle` must be set to publish the dev bundle, ex `./gradlew publishToMavenLocal -PpublishDevBundle`. Patches must be already applied in order to generate the dev bundle. +--- + build.gradle.kts | 49 ++++++++++++++++++++++++++------------------- + settings.gradle.kts | 1 + + 2 files changed, 29 insertions(+), 21 deletions(-) + +diff --git a/build.gradle.kts b/build.gradle.kts +index cf0754603..23db4352c 100644 +--- a/build.gradle.kts ++++ b/build.gradle.kts +@@ -1,7 +1,8 @@ + plugins { + java ++ `maven-publish` + id("com.github.johnrengelman.shadow") version "7.0.0" apply false +- id("io.papermc.paperweight.core") version "1.1.8" ++ id("io.papermc.paperweight.core") version "1.1.9-LOCAL-SNAPSHOT" + } + + subprojects { +@@ -25,16 +26,6 @@ subprojects { + filteringCharset = Charsets.UTF_8.name() + } + +- configure { +- repositories { +- maven { +- name = "paperSnapshots" +- url = uri("https://papermc.io/repo/repository/maven-snapshots/") +- credentials(PasswordCredentials::class) +- } +- } +- } +- + if (name == "Paper-MojangAPI") { + return@subprojects + } +@@ -58,16 +49,6 @@ repositories { + onlyForConfigurations("paperclip") + } + } +- maven("https://maven.quiltmc.org/repository/release/") { +- content { +- onlyForConfigurations("paramMappings", "remapper") +- } +- } +- maven("https://files.minecraftforge.net/maven/") { +- content { +- onlyForConfigurations("decompiler") +- } +- } + } + + dependencies { +@@ -85,6 +66,10 @@ paperweight { + spigotApiPatchDir.set(layout.projectDirectory.dir("patches/api")) + spigotServerPatchDir.set(layout.projectDirectory.dir("patches/server")) + ++ paramMappingsRepo.set("https://maven.quiltmc.org/repository/release/") ++ remapRepo.set("https://maven.quiltmc.org/repository/release/") ++ decompileRepo.set("https://files.minecraftforge.net/maven/") ++ + mappingsPatch.set(layout.projectDirectory.file("build-data/mappings-patch.tiny")) + reobfMappingsPatch.set(layout.projectDirectory.file("build-data/reobf-mappings-patch.tiny")) + +@@ -104,6 +89,28 @@ paperweight { + } + } + ++publishing { ++ if (project.hasProperty("publishDevBundle")) { ++ publications.create("devBundle") { ++ artifact(tasks.generateDevelopmentBundle) { ++ artifactId = "dev-bundle" ++ } ++ } ++ } ++} ++ ++allprojects { ++ publishing { ++ repositories { ++ maven { ++ name = "paperSnapshots" ++ url = uri("https://papermc.io/repo/repository/maven-snapshots/") ++ credentials(PasswordCredentials::class) ++ } ++ } ++ } ++} ++ + tasks.register("printMinecraftVersion") { + doLast { + println(providers.gradleProperty("mcVersion").get().trim()) +diff --git a/settings.gradle.kts b/settings.gradle.kts +index 4127fc6b8..d6ffb3730 100644 +--- a/settings.gradle.kts ++++ b/settings.gradle.kts +@@ -1,5 +1,6 @@ + pluginManagement { + repositories { ++ mavenLocal() + gradlePluginPortal() + maven("https://papermc.io/repo/repository/maven-public/") + } +-- +2.32.0 + diff --git a/build.gradle.kts b/build.gradle.kts index d8e179b..617a977 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,23 +1,26 @@ -import net.minecrell.pluginyml.bukkit.BukkitPluginDescription.PluginLoadOrder +import net.minecrell.pluginyml.bukkit.BukkitPluginDescription import xyz.jpenilla.runpaper.task.RunServerTask plugins { `java-library` - id("net.minecrell.plugin-yml.bukkit") version "0.4.0" - id("xyz.jpenilla.run-paper") version "1.0.3" id("io.papermc.paperweight.userdev") version "1.1.9-LOCAL-SNAPSHOT" + id("xyz.jpenilla.run-paper") version "1.0.3" + id("net.minecrell.plugin-yml.bukkit") version "0.4.0" } group = "io.papermc.paperweight" version = "1.0.0-SNAPSHOT" repositories { + mavenLocal() { + content { includeGroup("io.papermc.paper") } + } mavenCentral() maven("https://papermc.io/repo/repository/maven-public/") } dependencies { - paperDevBundle(files("../../temp/117/Paper/build/libs/paperDevBundle-1.17.1-R0.1-SNAPSHOT.zip")) + paperweightDevBundle("1.17.1-R0.1-SNAPSHOT") } runPaper { @@ -25,18 +28,29 @@ runPaper { } tasks { - compileJava { - options.encoding = Charsets.UTF_8.name() - options.release.set(16) - } + // Run reobfJar on build build { dependsOn(reobfJar) } + compileJava { + options.encoding = Charsets.UTF_8.name() + options.release.set(16) + } + javadoc { + options.encoding = Charsets.UTF_8.name() + } + processResources { + filteringCharset = Charsets.UTF_8.name() + } + + // Task to run obfuscated/production server and plugin runServer { minecraftVersion("1.17.1") pluginJars.from(reobfJar.flatMap { it.outputJar }) } + + // Task to run mojang mapped/dev server and plugin register("runMojangMappedServer") { minecraftVersion("1.17.1") pluginJars.from(jar.flatMap { it.archiveFile }) @@ -45,7 +59,7 @@ tasks { } bukkit { - load = PluginLoadOrder.STARTUP + load = BukkitPluginDescription.PluginLoadOrder.STARTUP main = "io.papermc.paperweight.testplugin.TestPlugin" apiVersion = "1.17" authors = listOf("Author")