mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 22:34:53 +08:00
28 lines
725 B
Bash
Executable File
28 lines
725 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
# Get to the script's directory
|
|
cd "$(dirname "$0")"
|
|
|
|
# Build Docker image if it doesn't exist or if Dockerfile changed
|
|
IMAGE_NAME="spine-c-build"
|
|
if ! docker images | grep -q "$IMAGE_NAME" || [ Dockerfile -nt .docker-built ]; then
|
|
echo "Building Docker image for spine-c..."
|
|
docker build -t "$IMAGE_NAME" .
|
|
touch .docker-built
|
|
fi
|
|
|
|
# Clean build directory to avoid platform conflicts
|
|
if [ -d "build" ]; then
|
|
echo "Cleaning build directory to avoid platform conflicts..."
|
|
rm -rf build
|
|
fi
|
|
|
|
# Run the build in Docker
|
|
echo "Building spine-c in Docker container..."
|
|
docker run --rm \
|
|
-v "$(cd .. && pwd)":/workspace \
|
|
-w /workspace/spine-c \
|
|
"$IMAGE_NAME" \
|
|
./build.sh "$@" |