oficina / docs Public

Clone
git clone https://amadan.net/oficina/docs

Plain git — no account needed to clone.

Download

Download this file

1#!/bin/sh
2set -eu
3cd "$(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.
6CARGO=${CARGO:-cargo}
7if [ -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
9for 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
11done
12mkdir -p build/crdt/mac build/crdt/simulator
13lipo -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
14lipo -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
15rm -rf apple/Artifacts/DocsCRDT.xcframework
16xcodebuild -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