From 13acf344e14189146c0a8b90a7e1df0b1544192f Mon Sep 17 00:00:00 2001 From: Waiting Idly <25394029+WaitingIdly@users.noreply.github.com> Date: Sun, 30 Jun 2024 17:22:29 -0700 Subject: [PATCH] add additionalJavaArguments (#98) --- build.gradle | 5 +++++ gradle.properties | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/build.gradle b/build.gradle index ca81566..17c9caf 100644 --- a/build.gradle +++ b/build.gradle @@ -69,6 +69,7 @@ propertyDefaultIfUnset("includeMCVersionJar", false) propertyDefaultIfUnset("autoUpdateBuildScript", false) propertyDefaultIfUnset("modArchivesBaseName", project.modId) propertyDefaultIfUnsetWithEnvVar("developmentEnvironmentUserName", "Developer", "DEV_USERNAME") +propertyDefaultIfUnset("additionalJavaArguments", "") propertyDefaultIfUnset("enableJava17RunTasks", false) propertyDefaultIfUnset("generateGradleTokenClass", "") propertyDefaultIfUnset("gradleTokenModId", "") @@ -382,6 +383,10 @@ minecraft { ]) } + if (additionalJavaArguments.size() != 0) { + extraRunJvmArguments.addAll(additionalJavaArguments.split(';')) + } + if (enableJava17RunTasks.toBoolean()) { lwjgl3Version = "3.3.2" } diff --git a/gradle.properties b/gradle.properties index 7c671fb..c9de5d3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -27,6 +27,11 @@ minecraftVersion = 1.12.2 # Alternatively this can be set with the 'DEV_USERNAME' environment variable. developmentEnvironmentUserName = Developer +# Additional arguments applied to the JVM when launching minecraft +# Syntax: -arg1=value1;-arg2=value2;... +# Example value: -Dmixin.debug.verify=true;-XX:+UnlockExperimentalVMOptions +additionalJavaArguments = + # Enables using modern java syntax (up to version 17) via Jabel, while still targeting JVM 8. # See https://github.com/bsideup/jabel for details on how this works. # Using this requires that you use a Java 17 JDK for development.