From 16dff9556d97dc05068feb5596097939294fd82d Mon Sep 17 00:00:00 2001 From: Quentin Legot Date: Thu, 2 Mar 2023 14:51:17 +0100 Subject: [PATCH] Fix task build.gradle Signed-off-by: Quentin Legot --- Pagination/build.gradle | 35 +++++++++++++++++++ .../main/java/fr/altarik/toolbox/Main.java | 7 ---- Tasks/build.gradle | 2 +- build.gradle | 5 --- 4 files changed, 36 insertions(+), 13 deletions(-) delete mode 100644 Pagination/src/main/java/fr/altarik/toolbox/Main.java diff --git a/Pagination/build.gradle b/Pagination/build.gradle index e69de29..75f7707 100644 --- a/Pagination/build.gradle +++ b/Pagination/build.gradle @@ -0,0 +1,35 @@ +plugins { + id 'fabric-loom' +} + +dependencies { + minecraft "com.mojang:minecraft:${project.minecraft_version}" + mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" + modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" + + modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" +} + +processResources { + inputs.property "version", project.version + + filesMatching("fabric.mod.json") { + expand "version": project.version + } +} + +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 = 17 + if (JavaVersion.current().isJava9Compatible()) { + it.options.release = targetVersion + } +} \ No newline at end of file diff --git a/Pagination/src/main/java/fr/altarik/toolbox/Main.java b/Pagination/src/main/java/fr/altarik/toolbox/Main.java deleted file mode 100644 index 88dbeed..0000000 --- a/Pagination/src/main/java/fr/altarik/toolbox/Main.java +++ /dev/null @@ -1,7 +0,0 @@ -package fr.altarik.toolbox; - -public class Main { - public static void main(String[] args) { - System.out.println("Hello world!"); - } -} \ No newline at end of file diff --git a/Tasks/build.gradle b/Tasks/build.gradle index 1bb2636..77c4a5a 100644 --- a/Tasks/build.gradle +++ b/Tasks/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'fabric-loom' version '1.1-SNAPSHOT' + id 'fabric-loom' } diff --git a/build.gradle b/build.gradle index 836efbb..7ab39e6 100644 --- a/build.gradle +++ b/build.gradle @@ -66,11 +66,6 @@ subprojects { } -dependencies { - implementation project(':Pagination') -} - - jar { dependsOn subprojects.jar subprojects.each { project ->