church-core/simple_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

40 lines
1.2 KiB
Bash
Executable file

#!/bin/bash
set -e
echo "🔨 Simple UniFFI iOS build..."
# Add targets if needed
rustup target add aarch64-apple-ios aarch64-apple-ios-sim x86_64-apple-ios
# Build for all iOS targets
echo "Building for iOS..."
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 fat binary (iOS device + Intel simulator, skip ARM sim for now)
echo "Creating universal library..."
lipo -create \
target/aarch64-apple-ios/release/libchurch_core.a \
target/x86_64-apple-ios/release/libchurch_core.a \
-output libchurch_core_universal.a
# Generate bindings directly with uniffi_bindgen
echo "Generating Swift bindings..."
uniffi-bindgen generate src/church_core.udl --language swift --out-dir .
# Copy everything to iOS project
echo "Copying to iOS project..."
cp church_core.swift ../RTSDA-iOS/RTSDA/
cp church_coreFFI.h ../RTSDA-iOS/RTSDA/
cp libchurch_core_universal.a ../RTSDA-iOS/RTSDA/libchurch_core.a
# Create modulemap
cat > ../RTSDA-iOS/RTSDA/church_coreFFI.modulemap << EOF
module church_coreFFI {
header "church_coreFFI.h"
export *
}
EOF
echo "✅ Done! Build your iOS app in Xcode."