spine-runtimes/spine-ios/generate-bindings.sh
Mario Zechner 37fef98fd2 feat(spine-ios): Add bindings generation script and remove CocoaPods support
- Add generate-bindings.sh script similar to spine-flutter
- Remove outdated CocoaPods example and podspecs
- Remove setup.sh (no longer needed as we use symlinks)
- CocoaPods users should use Swift Package Manager instead
2025-08-27 11:42:40 +02:00

54 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
set -e
# Get to the script's directory
cd "$(dirname "$0")"
# Source logging utilities
source ../formatters/logging/logging.sh
log_title "spine-swift bindings generation"
# Install dependencies if needed
if [ ! -d "codegen/node_modules" ]; then
log_action "Installing codegen dependencies"
if (cd codegen && npm install > /dev/null 2>&1); then
log_ok
else
log_fail
exit 1
fi
fi
# Generating spine-c bindings
log_action "Generating spine-c bindings"
if LOG=$(cd ../spine-c && ./build.sh codegen 2>&1); then
log_ok
else
log_fail
log_error_output "$LOG"
exit 1
fi
# Run the Swift codegen
log_action "Generating Swift bindings"
if LOG=$(cd codegen && npm run generate 2>&1); then
log_ok
else
log_fail
log_error_output "$LOG"
exit 1
fi
# Build and run tests
log_action "Building and running tests"
if LOG=$(cd test && ./build.sh 2>&1); then
log_ok
else
log_fail
log_error_output "$LOG"
exit 1
fi
log_summary "✓ Swift bindings generated successfully"