Skip to content

Commit

Permalink
Reduce bundled javacv library size
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
devinbileck authored and alejandrogarcia83 committed Jun 24, 2024
1 parent 707349f commit 8e9e665
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions desktop/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ plugins {
id 'bisq.javafx'
id 'bisq.gradle.app_start_plugin.AppStartPlugin'
id 'bisq.gradle.packaging.PackagingPlugin'
alias(libs.plugins.gradle.javacpp.platform)
}

application {
Expand Down
3 changes: 3 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,6 @@ protobuf-java = { module = "com.google.protobuf:protobuf-java", version.ref = "p
qrgen = { module = "net.glxn:qrgen", version.ref = "qrgen" }
javacv = { module = "org.bytedeco:javacv-platform", version.ref = "javacv" }
slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" }

[plugins]
gradle-javacpp-platform = { id = "org.bytedeco.gradle-javacpp-platform", version.ref = "javacv" }
13 changes: 13 additions & 0 deletions gradle/verification-metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1261,6 +1261,14 @@
<sha256 value="3ded23320c6f35eecfd7a90084825211a232490cf26783abffa4afe4ed8ac5a4" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.bytedeco" name="gradle-javacpp" version="1.5.10">
<artifact name="gradle-javacpp-1.5.10.jar">
<sha256 value="8bcd41c4f582613a146572e77e7cf90c72186dd398aad1252cb17b82f5a9d5be" origin="Generated by Gradle"/>
</artifact>
<artifact name="gradle-javacpp-1.5.10.module">
<sha256 value="c0e2dfb8f2c8eeb73c4e039be67686af4f878179ea40dbdfe5c0a11b06cd0be2" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.bytedeco" name="javacpp" version="1.5.10">
<artifact name="javacpp-1.5.10-android-arm64.jar">
<sha256 value="06393202f8ec8ec42e4f80b511cfb946318d641ced112cea9fff84d3dd2f7c63" origin="Generated by Gradle"/>
Expand Down Expand Up @@ -1709,6 +1717,11 @@
<sha256 value="46269a5bfcd2d4d19db8c1edd06b7f4eda157ae265a0d23ddb4d07065b48ba24" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.bytedeco.gradle-javacpp-platform" name="org.bytedeco.gradle-javacpp-platform.gradle.plugin" version="1.5.10">
<artifact name="org.bytedeco.gradle-javacpp-platform.gradle.plugin-1.5.10.pom">
<sha256 value="cd1ce43c316327f4d8eb65cbb10831240ec3f4c70dceb66c353db17f3dd7ffcb" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.checkerframework" name="checker-qual" version="2.11.1">
<artifact name="checker-qual-2.11.1.jar">
<sha256 value="015224a4b1dc6de6da053273d4da7d39cfea20e63038169fc45ac0d1dc9c5938" origin="Generated by Gradle"/>
Expand Down

0 comments on commit 8e9e665

Please sign in to comment.