church-core/build.sh
RTSDA 4d6b23beb3
Some checks are pending
iOS UniFFI Build / build-ios (push) Waiting to run
Initial commit: Church Core Rust library
Add church management API library with cross-platform support for iOS, Android, and WASM.
Features include event management, bulletin handling, contact forms, and authentication.
2025-08-16 19:25:01 -04:00

32 lines
1.1 KiB
Bash
Executable file

#!/bin/bash
set -e
echo "Building iOS framework with UniFFI..."
# Add iOS targets
rustup target add aarch64-apple-ios
rustup target add aarch64-apple-ios-sim
rustup target add x86_64-apple-ios
# Build for iOS targets
cargo build --release --target aarch64-apple-ios --features uniffi
cargo build --release --target aarch64-apple-ios-sim --features uniffi
cargo build --release --target x86_64-apple-ios --features uniffi
# Create universal library
mkdir -p target/universal
lipo -create \
target/aarch64-apple-ios/release/libchurch_core.a \
target/aarch64-apple-ios-sim/release/libchurch_core.a \
target/x86_64-apple-ios/release/libchurch_core.a \
-output target/universal/libchurch_core.a
# Generate Swift bindings using cargo (this should work!)
cargo run --features uniffi --bin uniffi-bindgen generate --language swift --out-dir target/universal src/church_core.udl
# Copy to iOS project
cp target/universal/church_core.swift ../RTSDA-iOS/RTSDA/
cp target/universal/church_coreFFI.h ../RTSDA-iOS/RTSDA/
cp target/universal/libchurch_core.a ../RTSDA-iOS/RTSDA/
echo "Done! Generated files copied to iOS project."