tools: add UniFFI codegen script (no-op if uniffi-bindgen missing)

This commit is contained in:
MoCipher 2026-02-20 10:12:13 +01:00
parent be9f34fcc2
commit f76584a50e

17
scripts/uniffi_codegen.sh Executable file
View file

@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -euo pipefail
UDL=core/uniffi/cryptec.udl
OUT_ANDROID=core/uniffi/bindings/android
OUT_IOS=core/uniffi/bindings/ios
echo "[uniffi-codegen] UDL: $UDL"
if command -v uniffi-bindgen >/dev/null 2>&1; then
echo "[uniffi-codegen] running uniffi-bindgen (java, objc)"
uniffi-bindgen generate "$UDL" -l java -o "$OUT_ANDROID"
uniffi-bindgen generate "$UDL" -l objc -o "$OUT_IOS"
echo "[uniffi-codegen] generated bindings in $OUT_ANDROID and $OUT_IOS"
else
echo "[uniffi-codegen] uniffi-bindgen not found; skipping codegen (placeholders must exist)"
fi