fix velocity build (#332)

This commit is contained in:
zml 2022-01-04 17:57:26 -08:00 committed by Jason
parent 36833588d3
commit a06e592d4a
3 changed files with 13 additions and 3 deletions

View file

@ -19,7 +19,7 @@ object Versions {
const val adventureApi = "4.9.3"
const val adventurePlatform = "4.0.1"
const val paperApi = "1.16.5-R0.1-SNAPSHOT"
const val velocityApi = "1.1.0"
const val velocityApi = "3.1.0"
const val spongeApi7 = "7.3.0"
const val jetbrainsAnnotations = "23.0.0"
const val guava = "21.0-jre"

View file

@ -1,3 +1,7 @@
java {
disableAutoTargetJvm()
}
dependencies {
api(projects.cloudCore)
api(projects.cloudBrigadier)

View file

@ -3,6 +3,10 @@ plugins {
id("cloud.example-conventions")
}
indra {
javaVersions().target(11) // Velocity 3 requires Java 11
}
val velocityRunClasspath by configurations.creating {
attributes {
attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage::class, Usage.JAVA_RUNTIME))
@ -35,7 +39,9 @@ tasks {
group = "cloud"
description = "Spin up a Velocity server environment"
standardInput = System.`in`
javaLauncher.set(project.javaToolchains.launcherFor { languageVersion.set(JavaLanguageVersion.of(11)) })
if (JavaVersion.current() < JavaVersion.VERSION_11) {
javaLauncher.set(project.javaToolchains.launcherFor { languageVersion.set(JavaLanguageVersion.of(11)) })
}
inputs.files(pluginJar)
@ -64,5 +70,5 @@ dependencies {
api(project(":cloud-minecraft-extras"))
api(project(":cloud-annotations"))
annotationProcessor(compileOnly("com.velocitypowered", "velocity-api", Versions.velocityApi))
velocityRunClasspath("com.velocitypowered", "velocity-proxy", "3.0.0")
velocityRunClasspath("com.velocitypowered", "velocity-proxy", Versions.velocityApi)
}