From 484e883f3b56b803f7cafa0ec0b888705c7dac6f Mon Sep 17 00:00:00 2001 From: samolego <34912839+samolego@users.noreply.github.com> Date: Thu, 10 Jun 2021 14:00:08 +0200 Subject: [PATCH] update buildscripts --- build.gradle | 18 +++++++++--------- fabric/build.gradle | 2 +- forge/build.gradle | 2 +- settings.gradle | 5 ++--- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/build.gradle b/build.gradle index d4522e836..8cba266dc 100644 --- a/build.gradle +++ b/build.gradle @@ -54,18 +54,18 @@ allprojects { } } - tasks.withType(JavaCompile) { - options.encoding = "UTF-8" + tasks.withType(JavaCompile).configureEach { + // ensure that the encoding is set to UTF-8, no matter what the system default is + // this fixes some edge cases with special characters not displaying correctly + // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html + // 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()) { - options.release = targetVersion - } + // Minecraft 1.17 (21w19a) upwards uses Java 16. + it.options.release = 16 } + java { withSourcesJar() } diff --git a/fabric/build.gradle b/fabric/build.gradle index d70fecc3e..aa072d9b8 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -1,7 +1,7 @@ import com.modrinth.minotaur.TaskModrinthUpload plugins { - id "com.github.johnrengelman.shadow" version "5.0.0" + id "com.github.johnrengelman.shadow" version "5.2.0" id 'com.matthewprenger.cursegradle' id "com.modrinth.minotaur" // Dokka docs diff --git a/forge/build.gradle b/forge/build.gradle index a7f1cd158..36a14cb0c 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -1,7 +1,7 @@ import com.modrinth.minotaur.TaskModrinthUpload plugins { - id "com.github.johnrengelman.shadow" version "5.0.0" + id "com.github.johnrengelman.shadow" version "5.2.0" id 'com.matthewprenger.cursegradle' id "com.modrinth.minotaur" // Dokka docs diff --git a/settings.gradle b/settings.gradle index 680d683a5..dd1b08692 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,13 +1,12 @@ pluginManagement { repositories { maven { url "https://maven.fabricmc.net/" } - maven { url "https://maven.shedaniel.me/" } - maven { url "https://files.minecraftforge.net/maven/" } + maven { url "https://maven.architectury.dev/" } + maven { url "https://maven.minecraftforge.net/" } gradlePluginPortal() } } - include("common") include("fabric") //include("forge")