-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KMP support #3
Comments
Hey that's awesome! I'm happy to migrate the JVM-only dependencies to KMP ones for sure, particularly if you're familiar with them and think they'd be a good replacement (I haven't worked with Kermit for example). A few more thoughts:
|
This was referenced Jun 25, 2024
Branch with progress so far: kirillzh#3 |
thunderbiscuit
pushed a commit
that referenced
this issue
Jun 26, 2024
Use kotlinx.serialization instead of GSON to deserialize Keyset from JSON. Work towards resolving issue #3.
thunderbiscuit
pushed a commit
that referenced
this issue
Jun 26, 2024
slf4j is JVM only and blocks the lib from migrating to KMP. This change migrates to use [Kermit](https://github.com/touchlab/Kermit), developed by touchlab. Kermit is a very simple logger implementation that supports many KMP targets. Kermit is also very lightweight and has no additional dependencies: ```kotlin \--- co.touchlab:kermit:2.0.4 \--- co.touchlab:kermit-jvm:2.0.4 +--- co.touchlab:kermit-core:2.0.4 | \--- co.touchlab:kermit-core-jvm:2.0.4 | \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.22 (*) ``` With slf4j (before, jvm only): ``` 2024-06-25 15:36:41 [Test worker @kotlinx.coroutines.test runner#17] INFO me.tb.cashuclient.Wallet - Wallet initialized with mint url https://testnut.cashu.space and unit 'sat'. ``` With Kermit (now, kmp): ``` Info: (me.tb.cashuclient.Wallet) Wallet initialized with mint url https://testnut.cashu.space and unit 'sat'. ```` Main difference is that `slf4j` by default prints out timestamp of the log along with a thread name, whereas kermit does not. If needed, implementing a more custom log formatting is easy by providing a custom [LogWriter](https://kermit.touchlab.co/docs/details/LOG_WRITER/). Work towards resolving issue #3.
thunderbiscuit
pushed a commit
that referenced
this issue
Jun 29, 2024
Expose is a JVM only lib. SqlDelight provides KMP support out of the box. This migrates the internal db implementation to SqlDelight. Work towards resolving issue #3.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@thunderbiscuit, the library is great! @jmateoac and I are starting to look at Cashu and would love to use the lib for a hackweek app. Is there any interest in migrating the library to KMP?
Going through dependencies, looks like we are halfway there.
Deps that are already KMP:
org.jetbrains.kotlinx:kotlinx-serialization-json
fr.acinq.bitcoin:bitcoin-kmp
fr.acinq.lightning:lightning-kmp
io.ktor:ktor-client-core
Deps that will need replacement:
com.google.code.gson:gson
->org.jetbrains.kotlinx:kotlinx-serialization-json
org.jetbrains.exposed:exposed-core
,org.xerial:sqlite-jdbc
-> SqlDelight is a good option hereorg.slf4j:slf4j-api
,ch.qos.logback:logback-classic
-> KermitWe could migrate in small phases:
lib
to use KMP Gradle plugin, with JVM target to begin withThe text was updated successfully, but these errors were encountered: