diff --git a/buildPlugin.sh b/buildPlugin.sh new file mode 100644 index 0000000..e159244 --- /dev/null +++ b/buildPlugin.sh @@ -0,0 +1,7 @@ +#!/bin/sh +set -e +# This script builds the plugin on Linux + +export Version="2024.1-EAP" + +./gradlew :buildPlugin \ No newline at end of file diff --git a/src/rider/main/kotlin/run/RunConfiguration.kt b/src/rider/main/kotlin/run/RunConfiguration.kt index 33e5eac..c61fa40 100644 --- a/src/rider/main/kotlin/run/RunConfiguration.kt +++ b/src/rider/main/kotlin/run/RunConfiguration.kt @@ -122,18 +122,22 @@ class RunConfiguration(project: Project, factory: ConfigurationFactory, name: St private fun getRimworldState(environment: ExecutionEnvironment, debugInLinux: Boolean = false): CommandLineState { return object : CommandLineState(environment) { override fun startProcess(): ProcessHandler { - var pathToRun = getScriptName() - var arguments = getCommandLineOptions() + val rimworldPath = getScriptName() + var pathToRun = rimworldPath + // Splitting on space will be a source of future bugs. In the future the arguments should be List as early as possible + val arguments = getCommandLineOptions().split(' ').filter { it.isNotEmpty() }.toMutableList() // If we're debugging in Rimworld, instead of /pwd/RimWorldLinux ...args we want to run /bin/sh /pwd/run.sh /pwd/RimWorldLinux ...args if (debugInLinux) { - val bashScriptPath = "${Path(pathToRun).parent}/run.sh" - arguments = "$bashScriptPath $pathToRun $arguments" pathToRun = "/bin/sh" + val bashScriptPath = "${Path(rimworldPath).parent}/run.sh" + arguments.add(0, bashScriptPath) } + println("Calling $pathToRun with arguments ${arguments.joinToString(" ")} with working directory ${Path(rimworldPath).parent}") val commandLine = GeneralCommandLine(pathToRun) - .withParameters(arguments.split(' ').filter { it.isNotEmpty() }) + .withParameters(arguments) + .withWorkingDirectory(Path(rimworldPath).parent) EnvironmentVariablesData.create(getEnvData(), true).configureCommandLine(commandLine, true) diff --git a/src/rider/main/resources/UnityDoorstop/Linux/Doorstop/0Harmony.dll b/src/rider/main/resources/UnityDoorstop/Linux/Doorstop/0Harmony.dll old mode 100644 new mode 100755 index 7aac19c..5edcd63 Binary files a/src/rider/main/resources/UnityDoorstop/Linux/Doorstop/0Harmony.dll and b/src/rider/main/resources/UnityDoorstop/Linux/Doorstop/0Harmony.dll differ diff --git a/src/rider/main/resources/UnityDoorstop/Linux/run.sh b/src/rider/main/resources/UnityDoorstop/Linux/run.sh index 4071a0e..90428d1 100755 --- a/src/rider/main/resources/UnityDoorstop/Linux/run.sh +++ b/src/rider/main/resources/UnityDoorstop/Linux/run.sh @@ -23,7 +23,7 @@ enabled="1" # Path to the assembly to load and execute # NOTE: The entrypoint must be of format `static void Doorstop.Entrypoint.Start()` -target_assembly="Doorstop.dll" +target_assembly="Doorstop/Doorstop.dll" # Overrides the default boot.config file path boot_config_override= @@ -277,4 +277,4 @@ else fi # shellcheck disable=SC2086 -exec "$executable_path" $rest_args +exec "$executable_path" $rest_args | tee debug.log