From 85a35d4d262b6106bdc52108b6339b0f24261352 Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Thu, 20 Apr 2023 08:42:59 -0700 Subject: [PATCH] Remove plugin-yml --- README.md | 2 +- build.gradle.kts | 20 +++++++++----------- src/main/resources/plugin.yml | 8 ++++++++ 3 files changed, 18 insertions(+), 12 deletions(-) create mode 100644 src/main/resources/plugin.yml diff --git a/README.md b/README.md index 0a404fb..8f76454 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ jmp's test plugin for [`paperweight-userdev`](https://github.com/PaperMC/paperwe - `build.gradle.kts` and `settings.gradle.kts` both contain important configuration. - `paperweight-userdev` automatically detects shadow and will use `shadowJar` as input for `reobfJar`. This means no extra configuration is required to use `paperweight-userdev` with shadow. See the `shadow` branch on this repository for an exmaple usage of shadow with `paperweight-userdev`. -- The `plugin-yml` and `run-paper` Gradle plugins are both optional, however I use them in almost all my plugin projects and recommend at least trying them out. `plugin-yml` auto-generates your plugin.yml file from configuration in the build file, and `run-paper` allows for launching a test server with your plugin through the `runServer` and `runMojangMappedServer` tasks. +- The `run-paper` Gradle plugin is optional, it integrates with paperweight and allows for launching a test server with your plugin through the `runServer` and `runMojangMappedServer` tasks. - Due to a [gradle bug](https://github.com/gradle/gradle/issues/17559), independently applying `paperweight-userdev` to multiple projects in a build can result in errors. To work around this, apply `paperweight-userdev` to the root project with `apply false` (i.e., `id("...") version "..." apply false` in Kotlin DSL), and then when applying `paperweight-userdev` to subprojects don't include a version specification. A more advanced solution would involve adding `paperweight-userdev` as a dependency to your build logic, see [`reflection-remapper`](https://github.com/jpenilla/reflection-remapper) and the [`source-remap`](https://github.com/PaperMC/paperweight-test-plugin/tree/source-remap) branch on this repo for examples of this. - The [`source-remap`](https://github.com/PaperMC/paperweight-test-plugin/tree/source-remap) branch on this repo has a special `remapPluginSources` task to remap the source code in `src/main/java` from spigot to Mojang mappings, outputting remapped source in `/src/main/mojangMappedJava`. Note that this will only remap your code, not update it from a prior version. Meaning you must be using the dev bundle for the Minecraft version your source code is for when remapping. - `paperweight-userdev` doesn't provide any utilities for doing reflection. [`reflection-remapper`](https://github.com/jpenilla/reflection-remapper) is a companion library to `paperweight-userdev` assisting with reflection on remapped code. diff --git a/build.gradle.kts b/build.gradle.kts index 8f7b8ed..223feaf 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,10 +1,7 @@ -import net.minecrell.pluginyml.bukkit.BukkitPluginDescription - plugins { `java-library` id("io.papermc.paperweight.userdev") version "1.5.4" id("xyz.jpenilla.run-paper") version "2.0.1" // Adds runServer and runMojangMappedServer tasks for testing - id("net.minecrell.plugin-yml.bukkit") version "0.5.3" // Generates plugin.yml } group = "io.papermc.paperweight" @@ -40,6 +37,15 @@ tasks { } processResources { filteringCharset = Charsets.UTF_8.name() // We want UTF-8 for everything + val props = mapOf( + "name" to project.name, + "version" to project.version, + "description" to project.description, + "apiVersion" to "1.19" + ) + filesMatching("plugin.yml") { + expand(props) + } } /* @@ -50,11 +56,3 @@ tasks { } */ } - -// Configure plugin.yml generation -bukkit { - load = BukkitPluginDescription.PluginLoadOrder.STARTUP - main = "io.papermc.paperweight.testplugin.TestPlugin" - apiVersion = "1.19" - authors = listOf("Author") -} diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml new file mode 100644 index 0000000..e3bab3b --- /dev/null +++ b/src/main/resources/plugin.yml @@ -0,0 +1,8 @@ +name: $name +version: $version +main: io.papermc.paperweight.testplugin.TestPlugin +description: $description +load: STARTUP +authors: + - Author +api-version: $apiVersion