Skip to content

Commit 62c8174

Browse files
angelixcdecker
authored andcommitted
fix: KMP android bindings
1 parent 27c3ad7 commit 62c8174

6 files changed

Lines changed: 17 additions & 23 deletions

File tree

libs/gl-sdk-android/gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,7 @@ kotlinx.atomicfu.enableJvmIrTransformation=true
2626
kotlinx.atomicfu.enableNativeIrTransformation=true
2727

2828
kotlin.mpp.enableCInteropCommonization=true
29+
android.builtInKotlin=false
30+
android.newDsl=false
2931

3032
libraryVersion=0.1.2

libs/gl-sdk-android/gradle/libs.versions.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ annotation = "1.9.1"
33
kotlin = "2.2.21"
44
kotlinx-serialization = "1.9.0"
55
kotlinx-coroutines = "1.10.2"
6-
android-gradle-plugin = "8.13.2"
7-
okio = "3.16.0"
6+
android-gradle-plugin = "9.0.0"
7+
okio = "3.16.4"
88
espresso = "3.7.0"
99
jna = "5.18.1"
1010
junit = "4.13.2"
1111
junit-ext = "1.3.0"
12-
maven-publish = "0.35.0"
13-
atomicfu = "0.29.0"
12+
maven-publish = "0.36.0"
13+
atomicfu = "0.31.0"
1414

1515
[libraries]
1616
annotation = { module = "androidx.annotation:annotation", version.ref = "annotation" }
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
#Fri Jan 19 10:34:57 EET 2024
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
56
zipStoreBase=GRADLE_USER_HOME
67
zipStorePath=wrapper/dists

libs/gl-sdk-android/lib/build.gradle.kts

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ kotlin {
1717
compilerOptions { jvmTarget.set(JvmTarget.JVM_1_8) }
1818
}
1919

20-
/*
2120
jvm()
22-
*/
2321

2422
val xcf = XCFramework()
2523

@@ -39,7 +37,6 @@ kotlin {
3937
else -> error("Unsupported target $name")
4038
}
4139

42-
4340
it.compilations["main"].cinterops {
4441
create("glsdkCInterop") {
4542
defFile(project.file("src/nativeInterop/cinterop/glsdk.def"))
@@ -69,11 +66,9 @@ kotlin {
6966
artifact { type = "aar" }
7067
}
7168
}
72-
/*
7369
jvmMain.dependencies {
7470
implementation(libs.jna)
7571
}
76-
*/
7772
androidUnitTest.dependencies {
7873
implementation(libs.junit)
7974
}
@@ -82,11 +77,10 @@ kotlin {
8277
implementation(libs.espresso.core)
8378
}
8479
}
85-
8680
}
8781

8882
android {
89-
namespace = "com.blockstream.glsdk_bindings"
83+
namespace = "com.blockstream.glsdk"
9084
compileSdk = 36
9185

9286
defaultConfig {
@@ -96,15 +90,6 @@ android {
9690
consumerProguardFiles("consumer-rules.pro")
9791
}
9892

99-
buildTypes {
100-
release {
101-
isMinifyEnabled = true
102-
proguardFiles(
103-
getDefaultProguardFile("proguard-android-optimize.txt"),
104-
"proguard-rules.pro"
105-
)
106-
}
107-
}
10893
compileOptions {
10994
sourceCompatibility = JavaVersion.VERSION_1_8
11095
targetCompatibility = JavaVersion.VERSION_1_8
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
-dontwarn java.awt.*
2+
-keep class com.sun.jna.* { *; }
3+
-keep class com.blockstream.glsdk.** { *; }
4+
-keepclassmembers class * extends com.sun.jna.* { public *; }
5+
-keepclassmembers class * extends com.blockstream.glsdk.** { public *; }
6+
-dontwarn java.lang.invoke.StringConcatFactory

libs/gl-sdk-android/settings.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ dependencyResolutionManagement {
1313
}
1414
}
1515

16-
rootProject.name = "glsdk"
16+
rootProject.name = "glsdk_kmp_bindings"
1717
include(":lib")

0 commit comments

Comments
 (0)