From 44581344c115d9066dd0d27f7ffe0808b59204b5 Mon Sep 17 00:00:00 2001 From: Nabil Hachicha Date: Wed, 19 Jun 2024 16:34:51 +0100 Subject: [PATCH] Always unpacking JVM native lib when using SNAPSHOT version --- CHANGELOG.md | 2 +- .../cinterop/src/jvmMain/kotlin/io/realm/kotlin/jvm/SoLoader.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e3631ecee3..9ffdabed97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ - None. ### Enhancements -- None. +- Improved mechanism for unpacking of JVM native libs suitable for local development. (Issue [#1715](https://github.com/realm/realm-kotlin/issues/1715) [JIRA](https://jira.mongodb.org/browse/RKOTLIN-1065)). ### Fixed - None. diff --git a/packages/cinterop/src/jvmMain/kotlin/io/realm/kotlin/jvm/SoLoader.kt b/packages/cinterop/src/jvmMain/kotlin/io/realm/kotlin/jvm/SoLoader.kt index 2bf019be67..e30197adf4 100644 --- a/packages/cinterop/src/jvmMain/kotlin/io/realm/kotlin/jvm/SoLoader.kt +++ b/packages/cinterop/src/jvmMain/kotlin/io/realm/kotlin/jvm/SoLoader.kt @@ -61,7 +61,7 @@ class SoLoader { // path should be /io.realm.kotlin/libraryVersion]/librealmffi.so // if the full path exists then load it otherwise unpack and load it. val libraryInstallationLocation: File = defaultAbsolutePath(libraryName) - if (!libraryInstallationLocation.exists()) { + if (!libraryInstallationLocation.exists() || SDK_VERSION.endsWith("-SNAPSHOT", ignoreCase = true)) { unpackAndInstall(libraryName, libraryInstallationLocation) } @Suppress("UnsafeDynamicallyLoadedCode")