From 0c2f002bad796846f14d6923b88c562907d91571 Mon Sep 17 00:00:00 2001 From: Pierre Maurice Schwang Date: Tue, 26 Sep 2023 21:47:13 +0200 Subject: [PATCH] chore/feat: download fawe & only use latest patch versions in runServer --- build.gradle.kts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 83ee76f8e..ddca63989 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,5 +1,6 @@ import com.diffplug.gradle.spotless.SpotlessPlugin import com.github.jengelman.gradle.plugins.shadow.ShadowPlugin +import groovy.json.JsonSlurper import java.net.URI import xyz.jpenilla.runpaper.task.RunServer @@ -218,14 +219,23 @@ 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", "1.20") +val supportedVersions = listOf("1.16.5", "1.17.1", "1.18.2", "1.19.4", "1.20.1") tasks { + val lastSuccessfulBuildUrl = uri("https://ci.athion.net/job/FastAsyncWorldEdit/lastSuccessfulBuild/api/json").toURL() + val artifact = ((JsonSlurper().parse(lastSuccessfulBuildUrl) as Map<*, *>)["artifacts"] as List<*>) + .map { it as Map<*, *> } + .map { it["fileName"] as String } + .first { it.contains("Bukkit") } + 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") + downloadPlugins { + url("https://ci.athion.net/job/FastAsyncWorldEdit/lastSuccessfulBuild/artifact/artifacts/$artifact") + } group = "run paper" runDirectory.set(file("run-$it")) }