mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 17:26:01 +08:00
- 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
54 lines
1.0 KiB
Bash
Executable File
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" |