Target Java 14

This commit is contained in:
Username404-59 2021-05-12 17:10:14 +02:00
parent a417ebe86f
commit 44f5b41c29
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
4 changed files with 10 additions and 9 deletions

View File

@ -1,3 +1,3 @@
# SnowyGUI # SnowyGUI
This mod requires fabric-language-kotlin on fabric, and kotlinforforge on forge. This mod requires fabric-language-kotlin on fabric, kotlinforforge on forge **and also needs Java 14 or higher**.

View File

@ -86,6 +86,7 @@ subprojects {
} }
} }
val javaVer: String = "14"
val kotlinVer = rootProject.property("kotlin_stdlib_version").toString() + ".0" val kotlinVer = rootProject.property("kotlin_stdlib_version").toString() + ".0"
val mcBase: String = rootProject.architectury.minecraft.dropLast(2) val mcBase: String = rootProject.architectury.minecraft.dropLast(2)
allprojects { allprojects {
@ -105,8 +106,8 @@ allprojects {
implementation(kotlin("stdlib-jdk8", kotlinVer)) implementation(kotlin("stdlib-jdk8", kotlinVer))
} }
java { java {
targetCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_14
sourceCompatibility = JavaVersion.VERSION_1_8 sourceCompatibility = JavaVersion.VERSION_14
} }
tasks { tasks {
withType(ShadowJar::class) { withType(ShadowJar::class) {
@ -127,7 +128,7 @@ allprojects {
withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile::class) { withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile::class) {
with(kotlinOptions) { with(kotlinOptions) {
freeCompilerArgs = listOf("-Xjvm-default=all", "-Xlambdas=indy") freeCompilerArgs = listOf("-Xjvm-default=all", "-Xlambdas=indy")
jvmTarget = "1.8" jvmTarget = javaVer
languageVersion = "1.5" languageVersion = "1.5"
apiVersion = rootProject.property("kotlin_stdlib_version").toString() apiVersion = rootProject.property("kotlin_stdlib_version").toString()
} }
@ -135,9 +136,7 @@ allprojects {
withType(JavaCompile::class) { withType(JavaCompile::class) {
with(options) { with(options) {
encoding = "UTF-8" encoding = "UTF-8"
if (JavaVersion.current().isJava9Compatible) { release.set(javaVer.toInt()); isFork = true
release.set(8)
}; isFork = true
} }
} }
withType(net.fabricmc.loom.task.RemapJarTask::class) { withType(net.fabricmc.loom.task.RemapJarTask::class) {
@ -157,6 +156,7 @@ allprojects {
val modProperties = mapOf( val modProperties = mapOf(
"mod_version" to (rootProject.version as String), "mod_version" to (rootProject.version as String),
"minecraft_version" to mcBase, "minecraft_version" to mcBase,
"java_version" to javaVer,
"mod_group" to this@allprojects.group, "mod_group" to this@allprojects.group,
"fabric_kotlin" to rootProject.property("fabric_language_kotlin"), "fabric_kotlin" to rootProject.property("fabric_language_kotlin"),
"kotlinforforge" to rootProject.property("kotlinforforge") "kotlinforforge" to rootProject.property("kotlinforforge")

View File

@ -1,7 +1,7 @@
{ {
"required": true, "required": true,
"package": "fr.username404.snowygui.mixins", "package": "fr.username404.snowygui.mixins",
"compatibilityLevel": "JAVA_8", "compatibilityLevel": "JAVA_14",
"client": [ "client": [
"KeysAccessor", "KeysAccessor",
"KeyMappings", "KeyMappings",

View File

@ -31,13 +31,14 @@
"snowygui-mixins.json" "snowygui-mixins.json"
], ],
"depends": { "depends": {
"fabricloader": ">=0.9.3", "fabricloader": ">=0.11.0",
"fabric-language-kotlin": ">=${fabric_kotlin}", "fabric-language-kotlin": ">=${fabric_kotlin}",
"fabric-resource-loader-v0": "*", "fabric-resource-loader-v0": "*",
"fabric-rendering-v1": "*", "fabric-rendering-v1": "*",
"minecraft": ">=${minecraft_version}" "minecraft": ">=${minecraft_version}"
}, },
"breaks": { "breaks": {
"java": "<${java_version}",
"modmenu": "<1.15.0" "modmenu": "<1.15.0"
}, },
"suggests": { "suggests": {