3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-11-16 16:10:07 +01:00

compact run-task configuration

Dieser Commit ist enthalten in:
SirYwell 2023-10-29 11:26:07 +01:00
Ursprung 441c2d452b
Commit 17b7a2cf11
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden

Datei anzeigen

@ -1,6 +1,7 @@
import org.ajoberstar.grgit.Grgit
import org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
import org.gradle.api.tasks.testing.logging.TestLogEvent.FAILED
import org.gradle.configurationcache.extensions.capitalized
import xyz.jpenilla.runpaper.task.RunServer
import java.net.URI
import java.time.format.DateTimeFormatter
@ -87,30 +88,27 @@ val supportedVersions = listOf("1.18.2", "1.19.4", "1.20", "1.20.4")
val foliaSupportedVersions = listOf("1.20.1")
tasks {
supportedVersions.forEach {
register<RunServer>("runServer-$it") {
minecraftVersion(it)
pluginJars(*project(":worldedit-bukkit").getTasksByName("shadowJar", false).map { (it as Jar).archiveFile }
fun registerVersion(version: String, software: String, task: RunServer.() -> Unit = {}) {
register<RunServer>("run${software.capitalized()}-$version") {
minecraftVersion(version)
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"))
group = "run $software"
runDirectory.set(file("run-$software-$version"))
task(this)
}
}
runServer {
minecraftVersion("1.20.4")
pluginJars(*project(":worldedit-bukkit").getTasksByName("shadowJar", false).map { (it as Jar).archiveFile }
.toTypedArray())
registerVersion("1.20.4", "paper")
}
supportedVersions.forEach {
registerVersion(it, "paper")
}
foliaSupportedVersions.forEach {
register<RunServer>("runFolia-$it") {
registerVersion(it, "folia") {
downloadsApiService.set(xyz.jpenilla.runtask.service.DownloadsAPIService.folia(project))
minecraftVersion(it)
group = "run folia"
runDirectory.set(file("run-folia-$it"))
pluginJars(*project(":worldedit-bukkit").getTasksByName("shadowJar", false).map { (it as Jar).archiveFile }
.toTypedArray())
}
}