From ea1abbfcd3f8065ce0b4133a9d09ed4a59f3c639 Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Thu, 7 Jul 2022 14:59:40 -0700 Subject: [PATCH] add x86 arch, build all and package with one command --- crypter-ffi/build-kotlin.sh | 20 ++++++++++++++------ crypter-ffi/src/uniffi/crypter/crypter.kt | 2 +- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/crypter-ffi/build-kotlin.sh b/crypter-ffi/build-kotlin.sh index 9554d36..17f3a01 100755 --- a/crypter-ffi/build-kotlin.sh +++ b/crypter-ffi/build-kotlin.sh @@ -18,14 +18,22 @@ cross build --target x86_64-linux-android --release echo "=> renaming files" mkdir -p target/out +mkdir -p target/out/x86 +mkdir -p target/out/arm64-v8a +mkdir -p target/out/armeabi +mkdir -p target/out/armeabi-v7a +mkdir -p target/out/x86_64 -mv target/i686-linux-android/release/libcrypter.so target/out/i686-libcrypter.so +mv target/i686-linux-android/release/libcrypter.so target/out/x86/libcrypter.so +mv target/aarch64-linux-android/release/libcrypter.so target/out/arm64-v8a/libcrypter.so +mv target/arm-linux-androideabi/release/libcrypter.so target/out/armeabi/libcrypter.so +mv target/armv7-linux-androideabi/release/libcrypter.so target/out/armeabi-v7a/libcrypter.so +mv target/x86_64-linux-android/release/libcrypter.so target/out/x86_64/libcrypter.so -mv target/aarch64-linux-android/release/libcrypter.so target/out/aarch64-libcrypter.so +zip -r target/kotlin-libraries.zip target/out -mv target/arm-linux-androideabi/release/libcrypter.so target/out/arm-libcrypter.so +echo "=> renaming uniffi_crypter to crypter" -mv target/armv7-linux-androideabi/release/libcrypter.so target/out/armv7-libcrypter.so - -mv target/x86_64-linux-android/release/libcrypter.so target/out/x86_64-libcrypter.so +sed -i '' 's/return "uniffi_crypter"/return "crypter"/' src/uniffi/crypter/crypter.kt +echo "=> done!" diff --git a/crypter-ffi/src/uniffi/crypter/crypter.kt b/crypter-ffi/src/uniffi/crypter/crypter.kt index 10e2a63..5505c17 100644 --- a/crypter-ffi/src/uniffi/crypter/crypter.kt +++ b/crypter-ffi/src/uniffi/crypter/crypter.kt @@ -237,7 +237,7 @@ private fun findLibraryName(componentName: String): String { if (libOverride != null) { return libOverride } - return "uniffi_crypter" + return "crypter" } private inline fun loadIndirect(