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
This commit is contained in:
Pierre Maurice Schwang 2023-09-30 01:32:50 +02:00 committed by GitHub
parent ca50b53f94
commit e138dc0267
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 5 deletions

5
.gitignore vendored
View File

@ -138,6 +138,5 @@ build/
.DS_Store .DS_Store
# Ignore run folders # Ignore run folders
run-[0-0].[0-9]/ run-[0-9].[0-9][0-9]/
run-[0-0].[0-9].[0-9]/ run-[0-9].[0-9][0-9].[0-9]/

View File

@ -1,5 +1,6 @@
import com.diffplug.gradle.spotless.SpotlessPlugin import com.diffplug.gradle.spotless.SpotlessPlugin
import com.github.jengelman.gradle.plugins.shadow.ShadowPlugin import com.github.jengelman.gradle.plugins.shadow.ShadowPlugin
import groovy.json.JsonSlurper
import java.net.URI import java.net.URI
import xyz.jpenilla.runpaper.task.RunServer import xyz.jpenilla.runpaper.task.RunServer
@ -218,14 +219,23 @@ tasks.getByName<Jar>("jar") {
enabled = false 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 { 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 { supportedVersions.forEach {
register<RunServer>("runServer-$it") { register<RunServer>("runServer-$it") {
minecraftVersion(it) minecraftVersion(it)
pluginJars(*project(":plotsquared-bukkit").getTasksByName("shadowJar", false).map { (it as Jar).archiveFile } pluginJars(*project(":plotsquared-bukkit").getTasksByName("shadowJar", false).map { (it as Jar).archiveFile }
.toTypedArray()) .toTypedArray())
jvmArgs("-DPaper.IgnoreJavaVersion=true", "-Dcom.mojang.eula.agree=true") jvmArgs("-DPaper.IgnoreJavaVersion=true", "-Dcom.mojang.eula.agree=true")
downloadPlugins {
url("https://ci.athion.net/job/FastAsyncWorldEdit/lastSuccessfulBuild/artifact/artifacts/$artifact")
}
group = "run paper" group = "run paper"
runDirectory.set(file("run-$it")) runDirectory.set(file("run-$it"))
} }

View File

@ -37,7 +37,7 @@ shadow = "8.1.1"
grgit = "4.1.1" grgit = "4.1.1"
spotless = "6.21.0" spotless = "6.21.0"
nexus = "1.3.0" nexus = "1.3.0"
runPaper = "2.1.0" runPaper = "2.2.0"
[libraries] [libraries]
# Platform expectations # Platform expectations