From 2b51896a01a1280f9499b2b467476da7c814c548 Mon Sep 17 00:00:00 2001 From: Phillipp Glanz Date: Fri, 7 Apr 2023 15:10:14 +0200 Subject: [PATCH] Improve testability by adding more versions of runPaper to the build scripts (#2172) * Improve testability * Change to import --- build.gradle.kts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 3c6dfb1a2..5bbde35da 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,8 +1,9 @@ import org.ajoberstar.grgit.Grgit -import java.time.format.DateTimeFormatter import org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL import org.gradle.api.tasks.testing.logging.TestLogEvent.FAILED import java.net.URI +import java.time.format.DateTimeFormatter +import xyz.jpenilla.runpaper.task.RunServer plugins { id("io.github.gradle-nexus.publish-plugin") version "1.3.0" @@ -82,8 +83,19 @@ allprojects { } applyCommonConfiguration() +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(":worldedit-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")) + } + } runServer { minecraftVersion("1.19.3") pluginJars(*project(":worldedit-bukkit").getTasksByName("shadowJar", false).map { (it as Jar).archiveFile }