From e138dc02676991333f6c2abd56d18611f96107c1 Mon Sep 17 00:00:00 2001 From: Pierre Maurice Schwang Date: Sat, 30 Sep 2023 01:32:50 +0200 Subject: [PATCH] Update runServer gradle tasks (#4173) * chore/feat: download fawe & only use latest patch versions in runServer * chore: gitignore runServer-1.20 folder as well * chore: exclude minor versions >= 10 by default (no need for < 10) * chore: update gradle plugin --- .gitignore | 5 ++--- build.gradle.kts | 12 +++++++++++- gradle/libs.versions.toml | 2 +- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 0b17ea5b1..b2bc4a8dd 100644 --- a/.gitignore +++ b/.gitignore @@ -138,6 +138,5 @@ build/ .DS_Store # Ignore run folders -run-[0-0].[0-9]/ -run-[0-0].[0-9].[0-9]/ - +run-[0-9].[0-9][0-9]/ +run-[0-9].[0-9][0-9].[0-9]/ 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")) } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 6f23046cc..9690a7856 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -37,7 +37,7 @@ shadow = "8.1.1" grgit = "4.1.1" spotless = "6.21.0" nexus = "1.3.0" -runPaper = "2.1.0" +runPaper = "2.2.0" [libraries] # Platform expectations