Skip to content

Commit

Permalink
Merge pull request #997 from angelix/ave-update-kmp
Browse files Browse the repository at this point in the history
Update bindings-kotlin-multiplatform to use version catalog
  • Loading branch information
dangeross authored Jun 17, 2024
2 parents e998692 + 050194c commit 2225617
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 15 deletions.
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

0 comments on commit 2225617

Please sign in to comment.