3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-14 18:40:10 +01:00

[ci skip] Add a test plugin (#6133)

Dieser Commit ist enthalten in:
Jason 2021-07-09 03:04:33 -07:00 committet von GitHub
Ursprung 416ec98982
Commit 20ff0b058c
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23
6 geänderte Dateien mit 53 neuen und 3 gelöschten Zeilen

3
.gitignore vendored
Datei anzeigen

@ -24,7 +24,6 @@ dependency-reduced-pom.xml
.*.sw[a-p]
# various other potential build files
build/
bin/
dist/
manifest.mf
@ -68,3 +67,5 @@ paperclip-*.jar
paperclip.properties
!gradle/wrapper/gradle-wrapper.jar
test-plugin.settings.gradle.kts

Datei anzeigen

@ -20,10 +20,10 @@ index 67fb370cad6924895a6b27052dbd5c1767e3f0c9..3e05459f27c4c5697ae65da504d67a6a
/.project
diff --git a/build.gradle.kts b/build.gradle.kts
new file mode 100644
index 0000000000000000000000000000000000000000..be565d252e326991f491cab3bfd3acc8356bbc7f
index 0000000000000000000000000000000000000000..e76b9f9012c7ba7253f455fa92b3891737f4ffd3
--- /dev/null
+++ b/build.gradle.kts
@@ -0,0 +1,138 @@
@@ -0,0 +1,145 @@
+import com.github.jengelman.gradle.plugins.shadow.transformers.Log4j2PluginsCacheFileTransformer
+import com.github.jengelman.gradle.plugins.shadow.transformers.Transformer
+import io.papermc.paperweight.util.Git
@ -127,6 +127,13 @@ index 0000000000000000000000000000000000000000..be565d252e326991f491cab3bfd3acc8
+ workingDir = rootProject.layout.projectDirectory.dir(
+ providers.gradleProperty("runWorkDir").forUseAtConfigurationTime().orElse("run")
+ ).get().asFile
+
+ if (rootProject.childProjects["test-plugin"] != null) {
+ val testPluginJar = rootProject.project(":test-plugin").tasks.jar.flatMap { it.archiveFile }
+ inputs.file(testPluginJar)
+ args("-add-plugin=${testPluginJar.get().asFile.absolutePath}")
+ }
+
+ args("--nogui")
+ systemProperty("net.kyori.adventure.text.warnWhenLegacyFormattingDetected", true)
+ if (project.hasProperty("disableWatchdog")) {

Datei anzeigen

@ -8,3 +8,10 @@ pluginManagement {
rootProject.name = "Paper"
include("Paper-API", "Paper-Server", "Paper-MojangAPI")
val testPlugin = file("test-plugin.settings.gradle.kts")
if (testPlugin.exists()) {
apply(from = testPlugin)
} else {
testPlugin.writeText("// Uncomment to enable the test plugin module\n//include(\":test-plugin\")\n")
}

17
test-plugin/build.gradle.kts Normale Datei
Datei anzeigen

@ -0,0 +1,17 @@
version = "1.0.0-SNAPSHOT"
repositories {
maven("https://libraries.minecraft.net")
}
dependencies {
compileOnly(project(":Paper-API"))
compileOnly(project(":Paper-MojangAPI"))
}
tasks.processResources {
inputs.property("version", project.version)
filesMatching("plugin.yml") {
expand("version" to project.version)
}
}

Datei anzeigen

@ -0,0 +1,11 @@
package io.papermc.paper.testplugin;
import org.bukkit.event.Listener;
import org.bukkit.plugin.java.JavaPlugin;
public final class TestPlugin extends JavaPlugin implements Listener {
@Override
public void onEnable() {
this.getServer().getPluginManager().registerEvents(this, this);
}
}

Datei anzeigen

@ -0,0 +1,7 @@
name: Paper-Test-Plugin
version: ${version}
main: io.papermc.paper.testplugin.TestPlugin
description: Paper Test Plugin
author: PaperMC
api-version: 1.17
load: STARTUP