45 lines
728 B
Bash
45 lines
728 B
Bash
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
TARGET=$1
|
|
|
|
if [[ -z "$TARGET" ]]; then
|
|
echo "Missing TARGET (Mac or iOS)"
|
|
exit 1
|
|
fi
|
|
|
|
echo "=== Mac Build Starting ==="
|
|
echo "Target: $TARGET"
|
|
|
|
UNITY_VERSION="2022.3.62f1"
|
|
UNITY_ROOT="/Applications/Unity/Hub/Editor"
|
|
UNITY_EXE="$UNITY_ROOT/$UNITY_VERSION/Unity.app/Contents/MacOS/Unity"
|
|
|
|
if [[ ! -f "$UNITY_EXE" ]]; then
|
|
echo "Unity not installed at $UNITY_EXE"
|
|
exit 1
|
|
fi
|
|
|
|
case "$TARGET" in
|
|
Mac)
|
|
METHOD="BuildScript.Mac"
|
|
;;
|
|
iOS)
|
|
METHOD="BuildScript.iOS"
|
|
;;
|
|
*)
|
|
echo "Unknown target: $TARGET"
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
"$UNITY_EXE" \
|
|
-batchmode \
|
|
-nographics \
|
|
-quit \
|
|
-projectPath "$(pwd)" \
|
|
-executeMethod $METHOD \
|
|
-logFile -
|
|
|
|
echo "=== Build SUCCESS: $TARGET ===" |