mirror of
https://github.com/PaperMC/Paper.git
synced 2025-05-19 05:30:23 -07:00
[ci skip] Add a test plugin (#6133)
This commit is contained in:
parent
43e9be4586
commit
5fe7fbd769
3
.gitignore
vendored
3
.gitignore
vendored
@ -24,7 +24,6 @@ dependency-reduced-pom.xml
|
|||||||
.*.sw[a-p]
|
.*.sw[a-p]
|
||||||
|
|
||||||
# various other potential build files
|
# various other potential build files
|
||||||
build/
|
|
||||||
bin/
|
bin/
|
||||||
dist/
|
dist/
|
||||||
manifest.mf
|
manifest.mf
|
||||||
@ -68,3 +67,5 @@ paperclip-*.jar
|
|||||||
paperclip.properties
|
paperclip.properties
|
||||||
|
|
||||||
!gradle/wrapper/gradle-wrapper.jar
|
!gradle/wrapper/gradle-wrapper.jar
|
||||||
|
|
||||||
|
test-plugin.settings.gradle.kts
|
||||||
|
@ -127,6 +127,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ workingDir = rootProject.layout.projectDirectory.dir(
|
+ workingDir = rootProject.layout.projectDirectory.dir(
|
||||||
+ providers.gradleProperty("runWorkDir").forUseAtConfigurationTime().orElse("run")
|
+ providers.gradleProperty("runWorkDir").forUseAtConfigurationTime().orElse("run")
|
||||||
+ ).get().asFile
|
+ ).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")
|
+ args("--nogui")
|
||||||
+ systemProperty("net.kyori.adventure.text.warnWhenLegacyFormattingDetected", true)
|
+ systemProperty("net.kyori.adventure.text.warnWhenLegacyFormattingDetected", true)
|
||||||
+ if (project.hasProperty("disableWatchdog")) {
|
+ if (project.hasProperty("disableWatchdog")) {
|
||||||
|
@ -8,3 +8,10 @@ pluginManagement {
|
|||||||
rootProject.name = "Paper"
|
rootProject.name = "Paper"
|
||||||
|
|
||||||
include("Paper-API", "Paper-Server", "Paper-MojangAPI")
|
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
Normal file
17
test-plugin/build.gradle.kts
Normal file
@ -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)
|
||||||
|
}
|
||||||
|
}
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
7
test-plugin/src/main/resources/plugin.yml
Normal file
7
test-plugin/src/main/resources/plugin.yml
Normal file
@ -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
|
Loading…
x
Reference in New Issue
Block a user