Skip to content

Commit

Permalink
Use app scripts instead of fat excutable jars
Browse files Browse the repository at this point in the history
It doesn't actually work to build fat executable jars because we always
have bouncycastle jars that need to exist outside of the fat jar. This
change drops building fat jars altogether in favor of using Gradle's
built-in `application` plugin to write simple scripts that invoke java
with the correct classpath against a directory of all dependencies
(including bouncycastle) without the need to have a fat jar in the mix.

Essentially, you should now run:

    ./gradlew build
    ./build/app/bin/bisq-desktop [options]

Instead of `java -jar build/libs/bisq-desktop.jar`.

See updated doc/build.md for details.
  • Loading branch information
cbeams committed Mar 22, 2018
1 parent 50dbe1d commit 9d4e015
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 22 deletions.
10 changes: 4 additions & 6 deletions build.gradle
Expand Up @@ -11,7 +11,6 @@ buildscript {
apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'maven'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'witness'

group = 'network.bisq'
Expand All @@ -21,11 +20,6 @@ sourceCompatibility = 1.8

mainClassName = 'bisq.desktop.app.BisqAppMain'

shadowJar {
classifier = null
version = null
}

tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
Expand Down Expand Up @@ -61,6 +55,10 @@ dependencies {
testAnnotationProcessor 'org.projectlombok:lombok:1.16.16'
}

build.dependsOn installDist
installDist.destinationDir = file('build/app')
distZip.enabled = false

// generated with `./gradlew -q calculateChecksums | grep -v network.bisq:bisq-`
dependencyVerification {
verify = [
Expand Down
15 changes: 5 additions & 10 deletions doc/build.md
Expand Up @@ -86,18 +86,13 @@ https://plugins.jetbrains.com/plugin/6317-lombok-plugin
Build Bisq
-----------------

### 1. Build final Bisq jar

Now we have all prepared to build the correct Bisq jar.

$ git clone https://github.com/bisq-network/bisq-desktop.git
$ cd bisq-desktop
$ ./gradlew build

When the build completes, you will find an executable jar: `build/libs/bisq-desktop.jar`.
To run it use:
When the build completes, run Bisq with the following script:

$ java -jar build/libs/bisq-desktop.jar
$ ./build/app/bin/bisq-desktop

Build binaries
-----------------
Expand All @@ -120,11 +115,11 @@ and how to use [regtest](https://github.com/bisq-network/bisq-desktop/wiki/4.2.1

Here are example program arguments for using regtest with localhost environment (not using Tor):

$ java -jar build/libs/bisq-desktop.jar --baseCurrencyNetwork=BTC_REGTEST --useLocalhost=true --myAddress=localhost:2222 --nodePort=2222 --appName=bisq-Local-Regtest-Arbitrator
$ bisq-desktop --baseCurrencyNetwork=BTC_REGTEST --useLocalhost=true --myAddress=localhost:2222 --nodePort=2222 --appName=bisq-Local-Regtest-Arbitrator

$ java -jar build/libs/bisq-desktop.jar --baseCurrencyNetwork=BTC_REGTEST --useLocalhost=true --myAddress=localhost:3333 --nodePort=3333 --appName=bisq-Local-Regtest-Alice
$ bisq-desktop --baseCurrencyNetwork=BTC_REGTEST --useLocalhost=true --myAddress=localhost:3333 --nodePort=3333 --appName=bisq-Local-Regtest-Alice

$ java -jar build/libs/bisq-desktop.jar --baseCurrencyNetwork=BTC_REGTEST --useLocalhost=true --myAddress=localhost:4444 --nodePort=4444 --appName=bisq-Local-Regtest-Bob
$ bisq-desktop --baseCurrencyNetwork=BTC_REGTEST --useLocalhost=true --myAddress=localhost:4444 --nodePort=4444 --appName=bisq-Local-Regtest-Bob


Running local seed node with Tor and RegTest
Expand Down
4 changes: 1 addition & 3 deletions doc/install_on_unix_fin.sh
Expand Up @@ -18,6 +18,4 @@ mkdir .local
mkdir .local/share

echo "Start Bisq"
java -jar ~/bisq/build/libs/bisq-desktop.jar


./build/app/bin/bisq-desktop
4 changes: 2 additions & 2 deletions package/stresstest/init.sh
Expand Up @@ -12,11 +12,11 @@ mkdir -p $logpath
# rm "$datapath/BS_arb/mainnet/db/SequenceNumberMap"
# rm "$datapath/BS_arb/mainnet/db/PersistedPeers"

nohup java -jar SeedNode.jar hlitt7z4bec4kdh4.onion:8000 0 500 >/dev/null 2>$logpath/ST_0_seednode.log &
nohup bisq-seednode hlitt7z4bec4kdh4.onion:8000 0 500 >/dev/null 2>$logpath/ST_0_seednode.log &
sleep 40

cd ../../build
nohup java -jar libs/bisq-desktop.jar --app.name=BS_arb --maxConnections=12 >/dev/null 2>$logpath/ST_0_arb.log &
nohup build/app/bin/bisq-desktop --app.name=BS_arb --maxConnections=12 >/dev/null 2>$logpath/ST_0_arb.log &

# kill `ps -ef | grep java | grep -v grep | awk '{print $2}'`

2 changes: 1 addition & 1 deletion package/stresstest/start.sh
Expand Up @@ -12,7 +12,7 @@ delay=40
for i in `seq 0 0`;
do
echo $i
nohup java -jar libs/bisq-desktop.jar --app.name=BS_$i --maxConnections=12 >/dev/null 2>$logpath/ST_$i.log &
nohup build/app/bin/bisq-desktop --app.name=BS_$i --maxConnections=12 >/dev/null 2>$logpath/ST_$i.log &
sleep $delay
done

Expand Down

0 comments on commit 9d4e015

Please sign in to comment.