From f2359c75f4a5c820874d1798926e32005fcffba2 Mon Sep 17 00:00:00 2001 From: Quentin Legot Date: Thu, 23 Mar 2023 01:33:03 +0100 Subject: [PATCH] Fix build and reduce memory footprint by fixing max memory usage to 2G instead of 4G Signed-off-by: Quentin Legot --- Pagination/build.gradle | 35 ----------------------------------- Tasks/build.gradle | 15 --------------- build.gradle | 15 +++------------ gradle.properties | 2 +- 4 files changed, 4 insertions(+), 63 deletions(-) diff --git a/Pagination/build.gradle b/Pagination/build.gradle index 75f7707..e69de29 100644 --- a/Pagination/build.gradle +++ b/Pagination/build.gradle @@ -1,35 +0,0 @@ -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/Tasks/build.gradle b/Tasks/build.gradle index 2d673a0..e69de29 100644 --- a/Tasks/build.gradle +++ b/Tasks/build.gradle @@ -1,15 +0,0 @@ -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 - } -} diff --git a/build.gradle b/build.gradle index a33d141..d168d1d 100644 --- a/build.gradle +++ b/build.gradle @@ -1,10 +1,8 @@ plugins { - id 'java' - id 'fabric-loom' version '1.1-SNAPSHOT' + id 'fabric-loom' version '1.1-SNAPSHOT' apply false } allprojects { - apply plugin: 'java' apply plugin: 'maven-publish' apply plugin: 'fabric-loom' @@ -35,7 +33,7 @@ allprojects { mavenJava(MavenPublication) { from components.java } - } + } repositories { maven { name 'altarik' @@ -78,13 +76,6 @@ allprojects { minecraft "com.mojang:minecraft:${project.minecraft_version}" mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" - } - -} - -subprojects { - - dependencies { modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" } @@ -100,7 +91,7 @@ subprojects { } dependencies { - include allprojects.collect { project -> project } + include subprojects.collect { project -> project } } /*jar { diff --git a/gradle.properties b/gradle.properties index f76810d..16c0d2a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -org.gradle.jvmargs=-Xmx4G +org.gradle.jvmargs=-Xmx2G junit_version=5.9.0