Improve testability for different versions (#4018)

* Ignore run folders

* Add a bulk of supported test environments

* Fix gitignore

* Fix gitignore

* Fix gitignore
This commit is contained in:
Phillipp Glanz 2023-04-22 11:33:00 +02:00 committed by GitHub
parent 1a712ad3c1
commit 0484ac73af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 0 deletions

4
.gitignore vendored
View File

@ -137,3 +137,7 @@ docs/
build/ build/
.DS_Store .DS_Store
# Ignore run folders
run-[0-0].[0-9]/
run-[0-0].[0-9].[0-9]/

View File

@ -1,6 +1,7 @@
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 java.net.URI import java.net.URI
import xyz.jpenilla.runpaper.task.RunServer
plugins { plugins {
java java
@ -15,6 +16,8 @@ plugins {
eclipse eclipse
idea idea
id("xyz.jpenilla.run-paper") version "2.0.1"
} }
group = "com.plotsquared" group = "com.plotsquared"
@ -218,3 +221,17 @@ nexusPublishing {
tasks.getByName<Jar>("jar") { 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")
tasks {
supportedVersions.forEach {
register<RunServer>("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")
group = "run paper"
runDirectory.set(file("run-$it"))
}
}
}