From a93aefa015468f5c960785e0283f2f6039186a0c Mon Sep 17 00:00:00 2001 From: Keuin Date: Sun, 22 Aug 2021 19:05:55 +0800 Subject: Switch lang level to Java 16. --- build.gradle | 41 +++++++++++++++++++----------------- src/main/resources/blame.mixins.json | 2 +- 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/build.gradle b/build.gradle index 20b91d4..596eef1 100644 --- a/build.gradle +++ b/build.gradle @@ -1,21 +1,24 @@ plugins { - id 'fabric-loom' version '0.6-SNAPSHOT' + id 'fabric-loom' version '0.8-SNAPSHOT' id 'maven-publish' } -sourceCompatibility = JavaVersion.VERSION_1_8 -targetCompatibility = JavaVersion.VERSION_1_8 +sourceCompatibility = JavaVersion.VERSION_16 +targetCompatibility = JavaVersion.VERSION_16 archivesBaseName = project.archives_base_name version = project.mod_version group = project.maven_group -dependencies { - - implementation 'junit:junit:4.12' - implementation 'org.mongodb:mongo-java-driver:3.12.7' - include 'org.mongodb:mongo-java-driver:3.12.7' +repositories { + // Add repositories to retrieve artifacts from in here. + // You should only use this when depending on other mods because + // Loom adds the essential maven repositories to download Minecraft and libraries from automatically. + // See https://docs.gradle.org/current/userguide/declaring_repositories.html + // for more information about repositories. +} +dependencies { // To change the versions see the gradle.properties file minecraft "com.mojang:minecraft:${project.minecraft_version}" mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" @@ -26,6 +29,9 @@ dependencies { // PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs. // You may need to force-disable transitiveness on them. + implementation 'junit:junit:4.12' + implementation 'org.mongodb:mongo-java-driver:3.12.7' + include 'org.mongodb:mongo-java-driver:3.12.7' } processResources { @@ -43,13 +49,8 @@ tasks.withType(JavaCompile).configureEach { // If Javadoc is generated, this must be specified in that task too. it.options.encoding = "UTF-8" - // The Minecraft launcher currently installs Java 8 for users, so your mod probably wants to target Java 8 too - // JDK 9 introduced a new way of specifying this that will make sure no newer classes or methods are used. - // We'll use that if it's available, but otherwise we'll use the older option. - def targetVersion = 8 - if (JavaVersion.current().isJava9Compatible()) { - it.options.release = targetVersion - } + // Minecraft 1.17 (21w19a) upwards uses Java 16. + it.options.release = 16 } java { @@ -79,9 +80,11 @@ publishing { } } - // Select the repositories you want to publish to - // To publish to maven local, no extra repositories are necessary. Just use the task `publishToMavenLocal`. + // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. repositories { - // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. + // Add repositories to publish to here. + // Notice: This block does NOT have the same function as the block in the top level. + // The repositories here will be used for publishing your artifact, not for + // retrieving dependencies. } -} +} \ No newline at end of file diff --git a/src/main/resources/blame.mixins.json b/src/main/resources/blame.mixins.json index 63ddc28..b189228 100644 --- a/src/main/resources/blame.mixins.json +++ b/src/main/resources/blame.mixins.json @@ -2,7 +2,7 @@ "required": true, "minVersion": "0.8", "package": "com.keuin.blame.mixin", - "compatibilityLevel": "JAVA_8", + "compatibilityLevel": "JAVA_16", "injectors": { "defaultRequire": 1 }, -- cgit v1.2.3