From 19412dce07d3a10734e8820b551275da85692980 Mon Sep 17 00:00:00 2001 From: anhgelus Date: Sun, 1 Jun 2025 19:57:52 +0000 Subject: build(fabric): upgrade everything --- build.gradle | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) (limited to 'build.gradle') diff --git a/build.gradle b/build.gradle index 31c6ce0..a6022a9 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'fabric-loom' version '1.9-SNAPSHOT' + id 'fabric-loom' version '1.10-SNAPSHOT' id 'maven-publish' } @@ -48,29 +48,43 @@ dependencies { processResources { inputs.property "version", project.version + inputs.property "minecraft_version", project.minecraft_version + inputs.property "loader_version", project.loader_version + filteringCharset "UTF-8" filesMatching("fabric.mod.json") { - expand "version": project.version + expand "version": project.version, + "minecraft_version": project.minecraft_version, + "loader_version": project.loader_version } } +def targetJavaVersion = 21 tasks.withType(JavaCompile).configureEach { - it.options.release = 21 + // 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" + if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) { + it.options.release.set(targetJavaVersion) + } } java { + def javaVersion = JavaVersion.toVersion(targetJavaVersion) + if (JavaVersion.current() < javaVersion) { + toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion) + } // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task // if it is present. // If you remove this line, sources will not be generated. withSourcesJar() - - sourceCompatibility = JavaVersion.VERSION_21 - targetCompatibility = JavaVersion.VERSION_21 } jar { from("LICENSE") { - rename { "${it}_${project.base.archivesName.get()}"} + rename { "${it}_${project.archivesBaseName}"} } } -- cgit v1.2.3