Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

Commit

Permalink
Revert ffi crate rename as it breaks Android build
Browse files Browse the repository at this point in the history
  • Loading branch information
aringenbach committed Jul 21, 2023
1 parent 9e80a21 commit e67a988
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 25 deletions.
22 changes: 11 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bindings/wysiwyg-ffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ repository = "https://gitlab.com/andybalaam/wysiwyg-rust"
description = "Swift and Kotlin bindings for wysiwyg-rust"
keywords = ["matrix", "chat", "messaging", "composer", "wysiwyg"]
license = "Apache-2.0"
name = "wysiwyg-ffi"
name = "uniffi-wysiwyg-composer"
version = "2.3.1"
rust-version = { workspace = true }

Expand Down
10 changes: 5 additions & 5 deletions bindings/wysiwyg-ffi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,16 +107,16 @@ cargo build --release --target x86_64-apple-ios

mkdir -p ../../target/ios-simulator
lipo -create \
../../target/x86_64-apple-ios/release/libwysiwyg_ffi.a \
../../target/aarch64-apple-ios-sim/release/libwysiwyg_ffi.a \
-output ../../target/ios-simulator/libwysiwyg_ffi.a
../../target/x86_64-apple-ios/release/libuniffi_wysiwyg_composer.a \
../../target/aarch64-apple-ios-sim/release/libuniffi_wysiwyg_composer.a \
-output ../../target/ios-simulator/libuniffi_wysiwyg_composer.a
```

* This will create static libraries for both iOS devices and simulators:

```
../../target/x86_64-apple-ios/debug/libwysiwyg_ffi.a
../../target/ios-simulator/libwysiwyg_ffi.a
../../target/x86_64-apple-ios/debug/libuniffi_wysiwyg_composer.a
../../target/ios-simulator/libuniffi_wysiwyg_composer.a
```

* Generate the bindings inside given output dir:
Expand Down
14 changes: 7 additions & 7 deletions build_xcframework.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ GENERATION_PATH=.generated/ios
UDL_FILE_PATH=bindings/wysiwyg-ffi/src/wysiwyg_composer.udl
UNIFFI_CONFIG_FILE_PATH=bindings/wysiwyg-ffi/uniffi.toml

ARM64_LIB_PATH=target/aarch64-apple-ios/release/libwysiwyg_ffi.a
ARM64_SIM_LIB_PATH=target/aarch64-apple-ios-sim/release/libwysiwyg_ffi.a
X86_LIB_PATH=target/x86_64-apple-ios/release/libwysiwyg_ffi.a
SIM_LIB_PATH=target/ios-simulator/libwysiwyg_ffi.a
ARM64_LIB_PATH=target/aarch64-apple-ios/release/libuniffi_wysiwyg_composer.a
ARM64_SIM_LIB_PATH=target/aarch64-apple-ios-sim/release/libuniffi_wysiwyg_composer.a
X86_LIB_PATH=target/x86_64-apple-ios/release/libuniffi_wysiwyg_composer.a
SIM_LIB_PATH=target/ios-simulator/libuniffi_wysiwyg_composer.a

IOS_PATH=platforms/ios
TOOLS_PATH="${IOS_PATH}/tools"
Expand All @@ -27,9 +27,9 @@ XCFRAMEWORK_ARM64_MODULES_PATH="${XCFRAMEWORK_ARM64_PATH}/Modules"
XCFRAMEWORK_ARM64_LIBRARY_PATH="${XCFRAMEWORK_ARM64_PATH}/WysiwygComposerFFI"

# Build libraries for each platform
cargo build -p wysiwyg-ffi --release --target aarch64-apple-ios
cargo build -p wysiwyg-ffi --release --target aarch64-apple-ios-sim
cargo build -p wysiwyg-ffi --release --target x86_64-apple-ios
cargo build -p uniffi-wysiwyg-composer --release --target aarch64-apple-ios
cargo build -p uniffi-wysiwyg-composer --release --target aarch64-apple-ios-sim
cargo build -p uniffi-wysiwyg-composer --release --target x86_64-apple-ios

# Merge x86 and simulator arm libraries with lipo
mkdir -p target/ios-simulator
Expand Down
2 changes: 1 addition & 1 deletion platforms/android/library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ apply plugin: "com.vanniktech.maven.publish"

cargo {
module = "../../../crates" // Or whatever directory contains your Cargo.toml
libname = "wysiwyg-ffi" // Or whatever matches Cargo.toml's [package] name.
libname = "uniffi-wysiwyg-composer" // Or whatever matches Cargo.toml's [package] name.
targets = ["arm", "x86", "x86_64", "arm64"]
targetIncludes = ["libuniffi_wysiwyg_composer.so"]
targetDirectory = '../../../target'
Expand Down

0 comments on commit e67a988

Please sign in to comment.