bisq/desktop/build.gradle
Devin Bileck 5016ad8951
Reduce bundled javacv library size
With the introduction of the javacv library when re-adding the QR code
scanner feature for mobile notification pairing in #7050, the Bisq
binary increased to nearly 1 GB from its previous size of around 300 MB.

When including the javacv-platform dependency, it pulls in binaries
for all platforms. But it is possible to limit this by utilizing
the gradle-javacpp platform plugin which by default will pull in
binaries only for the current platform.

Reference: https://github.com/bytedeco/gradle-javacpp#the-platform-plugin

With this change, the included libs went from ~980 MB down to ~366 MB.
2024-06-22 23:17:27 -07:00

69 lines
2.2 KiB
Groovy

plugins {
id 'bisq.application'
id 'bisq.javafx'
id 'bisq.gradle.app_start_plugin.AppStartPlugin'
id 'bisq.gradle.packaging.PackagingPlugin'
alias(libs.plugins.gradle.javacpp.platform)
}
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']
}
javafx {
modules = ['javafx.controls', 'javafx.fxml']
}
mainClassName = 'bisq.desktop.app.BisqAppMain'
sourceSets.main.resources.srcDirs += ['src/main/java'] // to copy fxml and css files
dependencies {
implementation enforcedPlatform(project(':platform'))
implementation project(':assets')
implementation project(':common')
implementation project(':proto')
implementation project(':p2p')
implementation project(':core')
annotationProcessor libs.lombok
compileOnly libs.lombok
implementation libs.logback.classic
implementation libs.logback.core
implementation libs.google.gson
implementation libs.google.guava
implementation libs.jcsv
implementation libs.jfoenix
implementation libs.commons.io
implementation libs.fontawesomefx
implementation libs.fontawesomefx.commons
implementation libs.fontawesomefx.materialdesign.font
implementation libs.qrgen
implementation libs.javacv
implementation libs.apache.commons.lang3
implementation libs.bouncycastle.bcpg.jdk15on
implementation libs.fxmisc.easybind
implementation libs.jetbrains.annotations
implementation libs.slf4j.api
implementation(libs.bitcoinj) {
exclude(module: 'bcprov-jdk15on')
exclude(module: 'guava')
exclude(module: 'jsr305')
exclude(module: 'okhttp')
exclude(module: 'okio')
exclude(module: 'slf4j-api')
}
implementation(libs.google.guice) {
exclude(module: 'guava')
}
testAnnotationProcessor libs.lombok
testCompileOnly libs.lombok
testImplementation libs.natpryce.make.it.easy
}
test {
systemProperty 'jdk.attach.allowAttachSelf', true
}