mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-25 06:36:44 +01:00
chore/fix(:runServer): cache fawe artifact and fix java 21 (#4209)
chore/fix: cache fawe artifact and fix java 21
This commit is contained in:
parent
c013b92e62
commit
16a4ee835c
@ -226,20 +226,25 @@ tasks.getByName<Jar>("jar") {
|
|||||||
|
|
||||||
val supportedVersions = listOf("1.16.5", "1.17.1", "1.18.2", "1.19.4", "1.20.1", "1.20.2")
|
val supportedVersions = listOf("1.16.5", "1.17.1", "1.18.2", "1.19.4", "1.20.1", "1.20.2")
|
||||||
tasks {
|
tasks {
|
||||||
|
register("cacheLatestFaweArtifact") {
|
||||||
val lastSuccessfulBuildUrl = uri("https://ci.athion.net/job/FastAsyncWorldEdit/lastSuccessfulBuild/api/json").toURL()
|
val lastSuccessfulBuildUrl = uri("https://ci.athion.net/job/FastAsyncWorldEdit/lastSuccessfulBuild/api/json").toURL()
|
||||||
val artifact = ((JsonSlurper().parse(lastSuccessfulBuildUrl) as Map<*, *>)["artifacts"] as List<*>)
|
val artifact = ((JsonSlurper().parse(lastSuccessfulBuildUrl) as Map<*, *>)["artifacts"] as List<*>)
|
||||||
.map { it as Map<*, *> }
|
.map { it as Map<*, *> }
|
||||||
.map { it["fileName"] as String }
|
.map { it["fileName"] as String }
|
||||||
.first { it.contains("Bukkit") }
|
.first { it -> it.contains("Bukkit") }
|
||||||
|
project.ext["faweArtifact"] = artifact
|
||||||
|
}
|
||||||
|
|
||||||
supportedVersions.forEach {
|
supportedVersions.forEach {
|
||||||
register<RunServer>("runServer-$it") {
|
register<RunServer>("runServer-$it") {
|
||||||
|
dependsOn(getByName("cacheLatestFaweArtifact"))
|
||||||
minecraftVersion(it)
|
minecraftVersion(it)
|
||||||
pluginJars(*project(":plotsquared-bukkit").getTasksByName("shadowJar", false).map { (it as Jar).archiveFile }
|
pluginJars(*project(":plotsquared-bukkit").getTasksByName("shadowJar", false)
|
||||||
|
.map { task -> (task as Jar).archiveFile }
|
||||||
.toTypedArray())
|
.toTypedArray())
|
||||||
jvmArgs("-DPaper.IgnoreJavaVersion=true", "-Dcom.mojang.eula.agree=true")
|
jvmArgs("-DPaper.IgnoreJavaVersion=true", "-Dcom.mojang.eula.agree=true")
|
||||||
downloadPlugins {
|
downloadPlugins {
|
||||||
url("https://ci.athion.net/job/FastAsyncWorldEdit/lastSuccessfulBuild/artifact/artifacts/$artifact")
|
url("https://ci.athion.net/job/FastAsyncWorldEdit/lastSuccessfulBuild/artifact/artifacts/${project.ext["faweArtifact"]}")
|
||||||
}
|
}
|
||||||
group = "run paper"
|
group = "run paper"
|
||||||
runDirectory.set(file("run-$it"))
|
runDirectory.set(file("run-$it"))
|
||||||
|
Loading…
Reference in New Issue
Block a user