servicepoint-binding-csharp/generate-binding.sh
Vinzenz Schroeter 5d69c140ba remove workspace
2025-06-13 11:44:21 +02:00

20 lines
802 B
Bash
Executable file

#!/usr/bin/env bash
set -e
SCRIPT_PATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
UNIFFI_BINDING_PATH="$(realpath "$SCRIPT_PATH"/servicepoint-binding-uniffi)"
UNIFFI_BINDGEN_CS_PATH="$(realpath "$SCRIPT_PATH"/uniffi-bindgen-cs)"
cargo build --release --manifest-path="$UNIFFI_BINDING_PATH"/Cargo.toml
SERVICEPOINT_SO="$(realpath "$UNIFFI_BINDING_PATH"/target/release/libservicepoint_binding_uniffi.so)"
echo "Source: $SERVICEPOINT_SO"
cargo build --manifest-path="$UNIFFI_BINDGEN_CS_PATH"/Cargo.toml
UNIFFI_BINDGEN_CS="$UNIFFI_BINDGEN_CS_PATH"/target/debug/uniffi-bindgen-cs
# cd is needed because in library mode, Cargo.toml is read from the current directory
cd $UNIFFI_BINDING_PATH
$UNIFFI_BINDGEN_CS "$SERVICEPOINT_SO" --library --out-dir "$SCRIPT_PATH/ServicePoint" --no-format