2021-01-25 20:44:17 +01:00
|
|
|
# osx unity build shell script
|
|
|
|
|
|
|
|
# $1 UNITY_VERSION
|
|
|
|
unityversion=$1
|
|
|
|
|
|
|
|
editorpath="/Applications/Unity/Hub/Editor/$unityversion/Unity.app"
|
|
|
|
|
|
|
|
# remove previous Editor.log
|
|
|
|
editorlogpath="$HOME/Library/Logs/Unity/Editor.log"
|
|
|
|
[ -f $editorlogpath ] && rm $editorlogpath
|
|
|
|
|
|
|
|
echo "starting build using unity v$unityversion..."
|
|
|
|
|
|
|
|
# launch unity in batch mode
|
|
|
|
open -g $editorpath --args \
|
|
|
|
-batchmode \
|
|
|
|
-quit \
|
|
|
|
-nographics \
|
|
|
|
-executeMethod "Ktyl.Util.BuildCommand.Run" \
|
|
|
|
-logFile $editorlogpath \
|
2021-01-25 21:06:58 +01:00
|
|
|
-projectPath "$(pwd)/game"
|
2021-01-25 20:44:17 +01:00
|
|
|
|
|
|
|
# wait for unity to exit
|
|
|
|
while pgrep -x "Unity" > /dev/null
|
|
|
|
do
|
|
|
|
sleep 1
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
if [ -f $editorlogpath ]; then
|
|
|
|
echo "build completed, dumping log"
|
|
|
|
cat $editorlogpath
|
|
|
|
echo "TODO: check result of build by looking at the last few lines"
|
|
|
|
else
|
|
|
|
echo "no editor log to dump?"
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|