Skip to content
Merged
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
10 changes: 8 additions & 2 deletions android/convexmobile/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ cargo {
libname = "convexmobile"
targets = ["arm64", "arm"]
profile = "release"

exec { spec, toolchain ->
// Support 16KB page sizes
// https://developer.android.com/guide/practices/page-sizes#other-build-systems
spec.environment("RUST_ANDROID_GRADLE_CC_LINK_ARG", "-Wl,-z,max-page-size=16384,-soname,lib${libname}.so")
}
}

tasks.whenTaskAdded { task ->
Expand All @@ -75,7 +81,7 @@ tasks.register("generateUniFFIBinary", Exec) {
android.libraryVariants.all { variant ->
def t = tasks.register("generate${variant.name.capitalize()}UniFFIBindings", Exec) {
workingDir "${project.projectDir}/../../rust"
commandLine './target/debug/uniffi-bindgen', 'generate', '--library', "${project.layout.buildDirectory.asFile.get().path}/rustJniLibs/android/arm64-v8a/libconvexmobile.so", '--language', 'kotlin', '--out-dir', "${project.layout.buildDirectory.asFile.get().path}/generated/source/uniffi/${variant.name}/java"
commandLine 'cargo', 'run', '--bin', 'uniffi-bindgen', '--', 'generate', '--library', "${project.layout.buildDirectory.asFile.get().path}/rustJniLibs/android/arm64-v8a/libconvexmobile.so", '--language', 'kotlin', '--out-dir', "${project.layout.buildDirectory.asFile.get().path}/generated/source/uniffi/${variant.name}/java"
dependsOn 'generateUniFFIBinary'
}
def sourceSet = variant.sourceSets.find { it.name == variant.name }
Expand Down Expand Up @@ -174,4 +180,4 @@ task stopConvexLocalBackend {
tasks.convexLocalBackend.process.destroy()
}
}
}
}