From 00f01748dde006ddd8a197b35d29a6cf9c77e8e9 Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Tue, 27 Nov 2018 02:52:35 +0100 Subject: [PATCH 1/2] Fix broken executables in /bin dirs --- build.gradle | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/build.gradle b/build.gradle index 6e5d8df08f7..58ba65e6865 100644 --- a/build.gradle +++ b/build.gradle @@ -104,6 +104,16 @@ configure([project(':desktop'), into "${rootProject.projectDir}/lib" } + // edit generated shell scripts such that they expect to be executed in the + // project root dir as opposed to a 'bin' subdirectory + def windowsScriptFile = file("${rootProject.projectDir}/bisq-$applicationName.bat") + windowsScriptFile.text = windowsScriptFile.text.replace( + 'set APP_HOME=%DIRNAME%..', 'set APP_HOME=%DIRNAME%') + + def unixScriptFile = file("${rootProject.projectDir}/bisq-$applicationName") + unixScriptFile.text = unixScriptFile.text.replace( + 'cd "`dirname \\"$PRG\\"`/.." >/dev/null', 'cd "`dirname \\"$PRG\\"`" >/dev/null') + if (osdetector.os != 'windows') delete fileTree(dir: rootProject.projectDir, include: 'bisq-*.bat') else @@ -114,18 +124,6 @@ configure([project(':desktop'), startScripts { // rename scripts from, e.g. `desktop` to `bisq-desktop` applicationName = "bisq-$applicationName" - - // edit generated shell scripts such that they expect to be executed in the - // project root dir as opposed to a 'bin' subdirectory - doLast { - def windowsScriptFile = file getWindowsScript() - windowsScriptFile.text = windowsScriptFile.text.replace( - 'set APP_HOME=%DIRNAME%..', 'set APP_HOME=%DIRNAME%') - - def unixScriptFile = file getUnixScript() - unixScriptFile.text = unixScriptFile.text.replace( - 'cd "`dirname \\"$PRG\\"`/.." >/dev/null', 'cd "`dirname \\"$PRG\\"`" >/dev/null') - } } } From 2026da0b59279ea61d4330597ef37d085e6cbc10 Mon Sep 17 00:00:00 2001 From: Chris Beams Date: Tue, 27 Nov 2018 10:31:44 +0100 Subject: [PATCH 2/2] Fix `applicationName` variable interpolation error Prior to this fix, the build failed with the following error: FAILURE: Build failed with an exception. * Where: Build file '/Users/cbeams/Work/bisq-network/bisq/build.gradle' line: 109 * What went wrong: Execution failed for task ':desktop:installDist'. > No such property: bat for class: java.lang.String --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 58ba65e6865..3e116b05456 100644 --- a/build.gradle +++ b/build.gradle @@ -106,7 +106,7 @@ configure([project(':desktop'), // edit generated shell scripts such that they expect to be executed in the // project root dir as opposed to a 'bin' subdirectory - def windowsScriptFile = file("${rootProject.projectDir}/bisq-$applicationName.bat") + def windowsScriptFile = file("${rootProject.projectDir}/bisq-${applicationName}.bat") windowsScriptFile.text = windowsScriptFile.text.replace( 'set APP_HOME=%DIRNAME%..', 'set APP_HOME=%DIRNAME%')