feat: Integrated Stream asset and Kai animation system
This commit is contained in:
44
scripts/run_defold.sh
Normal file
44
scripts/run_defold.sh
Normal file
@@ -0,0 +1,44 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# Build + run Defold project from terminal (Cursor-friendly)
|
||||
# Downloads bob.jar into tools/ on first run.
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
BOB_DIR="$ROOT_DIR/tools/bob"
|
||||
BOB_JAR="$BOB_DIR/bob.jar"
|
||||
BUILD_DIR="$ROOT_DIR/build"
|
||||
|
||||
mkdir -p "$BOB_DIR" "$BUILD_DIR"
|
||||
|
||||
if [[ ! -f "$BOB_JAR" ]]; then
|
||||
echo "bob.jar not found -> downloading..."
|
||||
curl -L --fail -o "$BOB_JAR" "https://d.defold.com/bob/bob.jar"
|
||||
fi
|
||||
|
||||
echo "Building (macOS bundle)..."
|
||||
java -jar "$BOB_JAR" --root "$ROOT_DIR" resolve
|
||||
java -jar "$BOB_JAR" --root "$ROOT_DIR" build
|
||||
|
||||
PLATFORM="x86_64-darwin"
|
||||
if [[ "$(uname -m)" == "arm64" ]]; then
|
||||
PLATFORM="arm64-darwin"
|
||||
fi
|
||||
|
||||
java -jar "$BOB_JAR" --root "$ROOT_DIR" bundle --platform "$PLATFORM" --bundle-output "$BUILD_DIR"
|
||||
|
||||
APP_PATH="$(find "$BUILD_DIR" -maxdepth 2 -name "*.app" -print -quit)"
|
||||
if [[ -z "${APP_PATH:-}" ]]; then
|
||||
echo "No .app found in $BUILD_DIR (bundle step may have failed)."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
BIN_PATH="$APP_PATH/Contents/MacOS/$(basename "$APP_PATH" .app)"
|
||||
if [[ ! -x "$BIN_PATH" ]]; then
|
||||
# Fallback: run the first executable in Contents/MacOS
|
||||
BIN_PATH="$(find "$APP_PATH/Contents/MacOS" -maxdepth 1 -type f -perm -111 -print -quit || true)"
|
||||
fi
|
||||
|
||||
echo "Running: $BIN_PATH"
|
||||
"$BIN_PATH"
|
||||
|
||||
Reference in New Issue
Block a user