Skip to content

Instantly share code, notes, and snippets.

@lordcodes
Created November 21, 2016 21:48
Show Gist options
  • Save lordcodes/7a1b781f595e964790147c3da3a2c654 to your computer and use it in GitHub Desktop.
Save lordcodes/7a1b781f595e964790147c3da3a2c654 to your computer and use it in GitHub Desktop.
Script to build your Unity project, written for use on Travis.
#! /bin/sh
project_path=$(pwd)/src/NAME_OF_PROJECT
log_file=$(pwd)/build/unity-mac.log
error_code=0
echo "Building project for Mac OS."
/Applications/Unity/Unity.app/Contents/MacOS/Unity \
-batchmode \
-nographics \
-silent-crashes \
-logFile "$log_file" \
-projectPath "$project_path" \
-buildOSXUniversalPlayer "$(pwd)/build/osx/ci-build.app" \
-quit
if [ $? = 0 ] ; then
echo "Building Mac OS completed successfully."
error_code=0
else
echo "Building Mac OS failed. Exited with $?."
error_code=1
fi
echo 'Build logs:'
cat $log_file
echo "Finishing with code $error_code"
exit $error_code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment