From a501c17facd012c46efca4e069222f38a1e9c52b Mon Sep 17 00:00:00 2001 From: Phodal Huang Date: Mon, 13 Nov 2023 21:18:40 +0800 Subject: [PATCH] chore: init for build script --- Makefile | 3 +-- examples/android/app/build.gradle.kts | 10 ++++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 20a3f05..116df1e 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,7 @@ TARGET_DIR := target android: - @make bindgen-kotlin - cd examples/android && ./gradlew cargoBuild --info + cd examples/android && ./gradlew cargoBuild # refs to https://mozilla.github.io/uniffi-rs/tutorial/foreign_language_bindings.html bindgen-kotlin: diff --git a/examples/android/app/build.gradle.kts b/examples/android/app/build.gradle.kts index 926efc7..175b3c4 100644 --- a/examples/android/app/build.gradle.kts +++ b/examples/android/app/build.gradle.kts @@ -1,6 +1,16 @@ plugins { id("com.android.application") id("org.jetbrains.kotlin.android") + id("org.mozilla.rust-android-gradle.rust-android") version "0.9.3" apply true +} + +cargo { + prebuiltToolchains = true + targetDirectory = "$projectDir/../../../../target" // because of workspace + module = "$projectDir/../../../inference_core" // Or whatever directory contains your Cargo.toml + libname = "inference_core" // Or whatever matches Cargo.toml's [package] name. + profile = "release" + targets = listOf("arm", "arm64", "x86", "x86_64") } android {