Merge pull request #3119 from Multiverse/ben/mv5/java-21

Make test run on java 21 for latest mockbukkit to work
This commit is contained in:
Ben Woo 2024-11-10 16:29:55 +08:00 committed by GitHub
commit 4264c0c9d2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 22 additions and 10 deletions

View File

@ -49,7 +49,7 @@ jobs:
- uses: actions/setup-java@v3
with:
java-version: '11'
java-version: '21'
distribution: 'adopt'
cache: gradle

View File

@ -18,7 +18,7 @@ jobs:
- uses: actions/setup-java@v3
with:
java-version: '17'
java-version: '21'
distribution: 'adopt'
cache: gradle

View File

@ -1,19 +1,31 @@
import org.apache.tools.ant.filters.ReplaceTokens
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
plugins {
id 'java-library'
id 'maven-publish'
id 'com.github.johnrengelman.shadow' version '7.1.2'
id "org.jetbrains.kotlin.jvm" version "1.8.10"
id "org.jetbrains.kotlin.jvm" version "2.0.21"
}
version = System.getenv('GITHUB_VERSION') ?: 'local'
group = 'org.mvplugins.multiverse.core'
description = 'Multiverse-Core'
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
compileJava {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
compileTestJava {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
compileTestKotlin {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_21)
javaParameters.set(true)
}
}
@ -121,8 +133,8 @@ dependencies {
shadowed 'io.papermc:paperlib:1.0.8'
// Tests
testImplementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.10'
testImplementation 'com.github.seeseemelk:MockBukkit-v1.20:3.20.2'
testImplementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.0.21'
testImplementation 'com.github.seeseemelk:MockBukkit-v1.21:3.133.0'
testImplementation('com.googlecode.json-simple:json-simple:1.1.1') {
exclude group: 'junit', module: 'junit'
}
@ -299,7 +311,7 @@ shadowJar {
configurations = [project.configurations.shadowed]
archiveFileName = "$baseName-$version.$extension"
archiveFileName = "$archiveBaseName-$archiveVersion.$archiveExtension"
dependencies {
exclude(dependency {

View File

@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists