From 0484ac73afeb5f31c62d09af694fbd936c481add Mon Sep 17 00:00:00 2001
From: Phillipp Glanz
Date: Sat, 22 Apr 2023 11:33:00 +0200
Subject: [PATCH] Improve testability for different versions (#4018)
* Ignore run folders
* Add a bulk of supported test environments
* Fix gitignore
* Fix gitignore
* Fix gitignore
---
.gitignore | 4 ++++
build.gradle.kts | 17 +++++++++++++++++
2 files changed, 21 insertions(+)
diff --git a/.gitignore b/.gitignore
index b0ccc3fff..0b17ea5b1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -137,3 +137,7 @@ docs/
build/
.DS_Store
+# Ignore run folders
+run-[0-0].[0-9]/
+run-[0-0].[0-9].[0-9]/
+
diff --git a/build.gradle.kts b/build.gradle.kts
index 083d2b82f..83f233d08 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -1,6 +1,7 @@
import com.diffplug.gradle.spotless.SpotlessPlugin
import com.github.jengelman.gradle.plugins.shadow.ShadowPlugin
import java.net.URI
+import xyz.jpenilla.runpaper.task.RunServer
plugins {
java
@@ -15,6 +16,8 @@ plugins {
eclipse
idea
+
+ id("xyz.jpenilla.run-paper") version "2.0.1"
}
group = "com.plotsquared"
@@ -218,3 +221,17 @@ nexusPublishing {
tasks.getByName("jar") {
enabled = false
}
+
+val supportedVersions = listOf("1.16.5", "1.17", "1.17.1", "1.18.2", "1.19", "1.19.1", "1.19.2", "1.19.3", "1.19.4")
+tasks {
+ supportedVersions.forEach {
+ register("runServer-$it") {
+ minecraftVersion(it)
+ pluginJars(*project(":PlotSquared-Bukkit").getTasksByName("shadowJar", false).map { (it as Jar).archiveFile }
+ .toTypedArray())
+ jvmArgs("-DPaper.IgnoreJavaVersion=true", "-Dcom.mojang.eula.agree=true")
+ group = "run paper"
+ runDirectory.set(file("run-$it"))
+ }
+ }
+}