Modern Apps git
git clone https://git.maproj.org/Modern-Apps.git
dependencies ▾

Modern-Apps.git / apple / XCFramework / build_xcframework.sh

build_xcframework.sh29 lines · 1.2 KiBRaw
1#!/bin/sh
2# EverySync XCFramework build (Phase 3, Mac only).
3# Wraps BUILD_NOTES.md steps 1-4. Fails fast; prints the manual fallback.
4# Usage (repo root): sh apple/XCFramework/build_xcframework.sh
5set -eu
6
7RUST_MANIFEST="library/e2ee-p2p/src/main/rust/Cargo.toml"
8INTEROP_DIR="library/everysync-core/src/nativeInterop/cinterop/e2eePqc"
9
10echo "==> 1/4 Rust static libs (device + simulator ARM64)"
11cargo build --target aarch64-apple-ios --release --manifest-path "$RUST_MANIFEST"
12cargo build --target aarch64-apple-ios-sim --release --manifest-path "$RUST_MANIFEST"
13
14echo "==> 2/4 cbindgen header"
15if ! command -v cbindgen >/dev/null 2>&1; then
16 echo "missing cbindgen (cargo install cbindgen)" >&2
17 exit 1
18fi
19cbindgen --crate e2ee-p2p --output "$INTEROP_DIR/e2ee_pqc.h" \
20 --config library/e2ee-p2p/src/main/rust/cbindgen.toml
21
22echo "==> 3/4 cinterop .def already in $INTEROP_DIR/e2eePqc.def (verbatim from IOS_PQC_NOTES.md)"
23test -f "$INTEROP_DIR/e2eePqc.def"
24
25echo "==> 4/4 XCFramework via Gradle"
26./gradlew :library:everysync-core:assembleEverysyncCoreXCFramework
27
28echo "OK: EverysyncCore.xcframework built. Link it into Passwords, Notes,"
29echo "Hub, the Credential Provider extension, and the Share extension."