Fix build and reduce memory footprint by fixing max memory usage to 2G instead of 4G

Signed-off-by: Quentin Legot <legotquentin@gmail.com>
This commit is contained in:
Quentin Legot 2023-03-23 01:33:03 +01:00
parent 5a1e741eac
commit f2359c75f4
4 changed files with 4 additions and 63 deletions

View File

@ -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
}
}

View File

@ -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
}
}

View File

@ -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 {

View File

@ -1,4 +1,4 @@
org.gradle.jvmargs=-Xmx4G
org.gradle.jvmargs=-Xmx2G
junit_version=5.9.0