Download this file
| 1 | #!/bin/sh |
| 2 | set -eu |
| 3 | cd "$(dirname "$0")/.." |
| 4 | # A single preparation pass creates all slices before simultaneous app builds. |
| 5 | # Set RUSTC/CARGO explicitly when Rust is installed outside the normal PATH. |
| 6 | CARGO=${CARGO:-cargo} |
| 7 | if [ -n "${DOCS_LLVM_LIBRARY_PATH:-}" ]; then export DYLD_LIBRARY_PATH="$DOCS_LLVM_LIBRARY_PATH"; fi |
| 8 | "$CARGO" build --manifest-path crdt/Cargo.toml --release --target wasm32-unknown-unknown --lib --locked |
| 9 | for target in aarch64-apple-darwin x86_64-apple-darwin aarch64-apple-ios aarch64-apple-ios-sim x86_64-apple-ios; do |
| 10 | "$CARGO" build --manifest-path host/Cargo.toml --release --target "$target" --lib --locked |
| 11 | done |
| 12 | mkdir -p build/crdt/mac build/crdt/simulator |
| 13 | lipo -create host/target/aarch64-apple-darwin/release/libdocs_native_host.a host/target/x86_64-apple-darwin/release/libdocs_native_host.a -output build/crdt/mac/libdocs_native_host.a |
| 14 | lipo -create host/target/aarch64-apple-ios-sim/release/libdocs_native_host.a host/target/x86_64-apple-ios/release/libdocs_native_host.a -output build/crdt/simulator/libdocs_native_host.a |
| 15 | rm -rf apple/Artifacts/DocsCRDT.xcframework |
| 16 | xcodebuild -create-xcframework \ |
| 17 | -library "$PWD/build/crdt/mac/libdocs_native_host.a" -headers "$PWD/host/include" \ |
| 18 | -library "$PWD/host/target/aarch64-apple-ios/release/libdocs_native_host.a" -headers "$PWD/host/include" \ |
| 19 | -library "$PWD/build/crdt/simulator/libdocs_native_host.a" -headers "$PWD/host/include" \ |
| 20 | -output "$PWD/apple/Artifacts/DocsCRDT.xcframework" |
| 21 | |