Merge pull request #1956 from cbeams/root-scripts

Generate scripts for Bisq executables in root dir
This commit is contained in:
Manfred Karrer 2018-11-23 20:04:07 +01:00 committed by GitHub
commit d372a9e4b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 55 additions and 6 deletions

3
.gitignore vendored
View file

@ -21,7 +21,8 @@ build
*.java.hsp *.java.hsp
*.~ava *.~ava
/bundles /bundles
/bisq* /bisq-*
/lib
/xchange /xchange
desktop.ini desktop.ini
*/target/* */target/*

View file

@ -11,6 +11,14 @@ buildscript {
} }
} }
configure(rootProject) {
// remove the 'bisq-*' scripts and 'lib' dir generated by the 'installDist' task
task clean {
doLast {
delete fileTree(dir: rootProject.projectDir, include: 'bisq-*'), 'lib'
}
}
}
configure(subprojects) { configure(subprojects) {
apply plugin: 'java' apply plugin: 'java'
@ -57,11 +65,51 @@ configure([project(':desktop'),
project(':relay'), project(':relay'),
project(':seednode'), project(':seednode'),
project(':statsnode')]) { project(':statsnode')]) {
apply plugin: 'application' apply plugin: 'application'
build.dependsOn installDist build.dependsOn installDist
installDist.destinationDir = file('build/app') installDist.destinationDir = file('build/app')
distZip.enabled = false distZip.enabled = false
// the 'installDist' and 'startScripts' blocks below configure bisq executables to put
// generated shell scripts in the root project directory, such that users can easily
// discover and invoke e.g. ./bisq-desktop, ./bisq-seednode, etc.
// See https://stackoverflow.com/q/46327736 for details.
installDist {
doLast {
// copy generated shell scripts, e.g. `bisq-desktop` directly to the project
// root directory for discoverability and ease of use
copy {
from "$destinationDir/bin"
into rootProject.projectDir
}
// copy libs required for generated shell script classpaths to 'lib' dir under
// the project root directory
copy {
from "$destinationDir/lib"
into "${rootProject.projectDir}/lib"
}
}
}
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')
}
}
} }

View file

@ -18,9 +18,9 @@ You do _not_ need to install Gradle to complete the following command. The `grad
## Run ## Run
The Bisq executable jar is now available in the `desktop/build/libs/` directory. Run it as follows, replacing `{version}` with the actual version found in the filename: Bisq executables are now available in the root project directory. Run Bisq Desktop as follows:
java -jar desktop/build/libs/desktop-{version}-all.jar ./bisq-desktop
## See also ## See also

View file

@ -61,14 +61,14 @@ Here is an overview:
## Run Bisq seednode ## Run Bisq seednode
For localhost/regtest mode run the `SeedNodeMain.java` class or the `seednode.jar` (inside the `seednode/build/libs` folder) with following program arguments: For localhost/regtest mode run the `SeedNodeMain` class or `./bisq-seednode` script in the root project dir with following program arguments:
--baseCurrencyNetwork=BTC_REGTEST --useLocalhostForP2P=true --useDevPrivilegeKeys=true --nodePort=2002 --myAddress=localhost:2002 --appName=bisq-BTC_REGTEST_Seed_2002 --baseCurrencyNetwork=BTC_REGTEST --useLocalhostForP2P=true --useDevPrivilegeKeys=true --nodePort=2002 --myAddress=localhost:2002 --appName=bisq-BTC_REGTEST_Seed_2002
### Run Bisq arbitrator instance ### Run Bisq arbitrator instance
For localhost/regtest mode run the `BisqAppMain.java` class or the `desktop.jar` (inside the `desktop/build/libs` folder) with following program arguments: For localhost/regtest mode run the `BisqAppMain` class or `./bisq-desktop` script in the root project dir with following program arguments:
--baseCurrencyNetwork=BTC_REGTEST --useLocalhostForP2P=true --useDevPrivilegeKeys=true --nodePort=4444 --appName=bisq-BTC_REGTEST_arbitrator --baseCurrencyNetwork=BTC_REGTEST --useLocalhostForP2P=true --useDevPrivilegeKeys=true --nodePort=4444 --appName=bisq-BTC_REGTEST_arbitrator
@ -79,7 +79,7 @@ _Note: You need only register once but if you have shut down all nodes (includin
### Run two Bisq trade instances ### Run two Bisq trade instances
For localhost/regtest mode run the `BisqAppMain.java` class or the `desktop.jar` (inside the `desktop/build/libs` folder) with following program arguments: For localhost/regtest mode run the `BisqAppMain` class or `./bisq-desktop` script in the root project dir with following program arguments:
--baseCurrencyNetwork=BTC_REGTEST --useLocalhostForP2P=true --useDevPrivilegeKeys=true --nodePort=5555 --appName=bisq-BTC_REGTEST_Alice --baseCurrencyNetwork=BTC_REGTEST --useLocalhostForP2P=true --useDevPrivilegeKeys=true --nodePort=5555 --appName=bisq-BTC_REGTEST_Alice