From 284e5360d2721afafec44f5934a18819cc20a973 Mon Sep 17 00:00:00 2001 From: Tyler Arehart Date: Sat, 23 Feb 2019 12:33:12 -0800 Subject: [PATCH] Making the generated batch file set user.dir so relative path lookups work. --- build.gradle | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index b4ccb9f..7863d80 100644 --- a/build.gradle +++ b/build.gradle @@ -15,7 +15,15 @@ mainClassName = 'rlbotexample.JavaExample' // This directory will be created and the interface dll copied into it at runtime. // The end result is that the interface dll will be available for loading. def dllDirectory = 'build/dll' -applicationDefaultJvmArgs = ["-Djna.library.path=" + dllDirectory] + +applicationDefaultJvmArgs = ["-Djna.library.path=" + dllDirectory, "-Duser.dir=MY_WORKING_DIR"] + +// https://www.mkyong.com/gradle/gradle-application-plugin-app_home-in-applicationdefaultjvmargs/ +startScripts { + doLast { + windowsScript.text = windowsScript.text.replace('MY_WORKING_DIR', "%~dp0.") + } +} dependencies { // Fetch the framework jar file