Skip to content

Commit

Permalink
Merge pull request #6796 from alvasw/move_jvm_args_to_build_gradle_files
Browse files Browse the repository at this point in the history
Move JVM args to build.gradle files
  • Loading branch information
alejandrogarcia83 authored Aug 6, 2023
2 parents 0353ff9 + e999e8e commit c737a20
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 19 deletions.
5 changes: 4 additions & 1 deletion apitest/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ plugins {
id 'bisq.application'
}

mainClassName = 'bisq.apitest.ApiTestMain'
application {
mainClass = 'bisq.apitest.ApiTestMain'
applicationDefaultJvmArgs = ['-Dlogback.configurationFile=apitest/build/resources/main/logback.xml']
}

// The external dao-setup.gradle file contains tasks to install and clean dao-setup
// files downloaded from
Expand Down
18 changes: 0 additions & 18 deletions build-logic/commons/src/main/groovy/bisq.application.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,6 @@ installDist {
def unixScriptFile = file("${rootProject.projectDir}/bisq-$applicationName")
unixScriptFile.text = unixScriptFile.text.replace(
'APP_HOME=$( cd "${APP_HOME:-./}.." && pwd -P ) || exit', 'APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit')

if (applicationName == 'desktop') {
def script = file("${rootProject.projectDir}/bisq-$applicationName")
script.text = script.text.replace(
'DEFAULT_JVM_OPTS=""', 'DEFAULT_JVM_OPTS="-XX:MaxRAM=8g -Xss1280k -XX:+UseG1GC ' +
'-XX:MaxHeapFreeRatio=10 -XX:MinHeapFreeRatio=5 -XX:+UseStringDeduplication ' +
'-Djava.net.preferIPv4Stack=true"')
}

if (applicationName == 'apitest') {
// Pass the logback config file as a system property to avoid chatty
// logback startup due to multiple logback.xml files in the classpath
// (:daemon & :cli).
def script = file("${rootProject.projectDir}/bisq-$applicationName")
script.text = script.text.replace(
'DEFAULT_JVM_OPTS=""', 'DEFAULT_JVM_OPTS="' +
'-Dlogback.configurationFile=apitest/build/resources/main/logback.xml"')
}
}
}

Expand Down
7 changes: 7 additions & 0 deletions desktop/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ plugins {
id "com.github.johnrengelman.shadow" version "5.2.0"
}

application {
mainClass = 'bisq.desktop.app.BisqAppMain'
applicationDefaultJvmArgs = ['-XX:MaxRAM=8g', '-Xss1280k', '-XX:+UseG1GC', '-XX:MaxHeapFreeRatio=10',
'-XX:MinHeapFreeRatio=5', '-XX:+UseStringDeduplication',
'-Djava.net.preferIPv4Stack=true']
}

apply from: 'package/package.gradle'

shadowDistTar.enabled = false
Expand Down

0 comments on commit c737a20

Please sign in to comment.