Skip to content
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

Update bindings-kotlin-multiplatform to use version catalog #997

Merged
merged 1 commit into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions libs/sdk-bindings/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ See [Add your AAR or JAR as a dependency](https://developer.android.com/studio/p

#### Known Issues

The Kotlin bindings for the Breez SDK rely on [JNA](https://github.com/java-native-access/jna) to call native methods. JNA 5.13 or greater is required. Depending on the JVM version you use, you might not have the JNA dependency in your classpath. The exception thrown will be something like:
The Kotlin bindings for the Breez SDK rely on [JNA](https://github.com/java-native-access/jna) to call native methods. JNA 5.14 or greater is required. Depending on the JVM version you use, you might not have the JNA dependency in your classpath. The exception thrown will be something like:

```
class file for com.sun.jna.Pointer not found
Expand All @@ -112,7 +112,7 @@ The solution is to add JNA as a dependency:
```
dependencies {
// ...
implementation "net.java.dev.jna:jna:5.13.0@aar"
implementation "net.java.dev.jna:jna:5.14.0@aar"
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ kotlin {

val commonMain by getting {
dependencies {
implementation("com.squareup.okio:okio:3.6.0")
implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.4.1")
implementation(libs.okio)
implementation(libs.kotlinx.datetime)
}
}

Expand All @@ -69,15 +69,15 @@ kotlin {
val jvmMain by getting {
dependsOn(commonMain)
dependencies {
implementation("net.java.dev.jna:jna:5.13.0")
implementation(libs.jna)
}
}

val androidMain by getting {
dependsOn(commonMain)
dependencies {
implementation("net.java.dev.jna:jna:5.13.0@aar")
implementation("org.jetbrains.kotlinx:atomicfu:0.23.1")
implementation("${libs.jna.get()}@aar")
implementation(libs.atomicfu)
}
}
}
Expand Down Expand Up @@ -137,4 +137,4 @@ publishing {
}
}
}
}
}
16 changes: 10 additions & 6 deletions libs/sdk-bindings/bindings-kotlin-multiplatform/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@

buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:8.1.0")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.21")
classpath("org.jetbrains.kotlinx:atomicfu-gradle-plugin:0.23.1")
classpath(libs.android.gradle.plugin)
classpath(libs.kotlin.gradle.plugin)
classpath(libs.atomicfu)
}
}

plugins {
//trick: for the same plugin versions in all sub-modules
id("com.android.library").version("8.1.0").apply(false)
kotlin("multiplatform").version("1.9.21").apply(false)
alias(libs.plugins.androidLibrary) apply false
alias(libs.plugins.kotlinMultiplatform) apply false
}


tasks.register("clean", Delete::class) {
delete(rootProject.buildDir)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[versions]
atomicfu = "0.24.0"
android-gradle-plugin = "8.4.1"
jna = "5.14.0"
kotlin = "1.9.24"
kotlinx-datetime = "0.6.0"
okio = "3.9.0"

[libraries]
atomicfu = { module = "org.jetbrains.kotlinx:atomicfu-gradle-plugin", version.ref = "atomicfu" }
android-gradle-plugin = { module = "com.android.tools.build:gradle", version.ref = "android-gradle-plugin" }
jna = { module = "net.java.dev.jna:jna", version.ref = "jna" }
kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
kotlinx-datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version.ref = "kotlinx-datetime" }
okio = { module = "com.squareup.okio:okio", version.ref = "okio" }

[plugins]
androidLibrary = { id = "com.android.library", version.ref = "android-gradle-plugin" }
kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Thu Jul 13 02:13:42 EEST 2023
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading