-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.sh
executable file
·30 lines (25 loc) · 967 Bytes
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash -e
sudo_gem='gem'
sudo_u3d='u3d'
if type sudo > /dev/null 2>&1; then
sudo_gem="sudo $sudo_gem"
sudo_u3d="sudo $sudo_u3d"
fi
if ! type u3d > /dev/null 2>&1; then
$sudo_gem install u3d
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
if [ "$(uname -s | cut -c -5)" = 'Linux' ]; then
sudo apt-get install -y libglu1-mesa
$sudo_u3d dependencies
fi
fi
[ ! "$(u3d list | grep $UNITY_VERSION)" ] && $sudo_u3d install $UNITY_VERSION -p Unity,${BUILD_TARGET}
script_path=$(cd $(dirname $0); pwd)
project_path=$(cd "$PROJECT_PATH"; pwd)
cp -r "${script_path}/Assets/." "${project_path}/Assets"
set +e
u3d -u $UNITY_VERSION -- -projectPath "$project_path" -batchmode -nographics -quit -silent-crashes -logFile editor.log -username $UNITY_USERNAME -password $UNITY_PASSWORD -serial $UNITY_SERIAL -buildTarget $BUILD_TARGET -executeMethod $EXECUTE_METHOD -outputPath "$OUTPUT_PATH" $COMMAND_ARGS
exit_code=$?
cat editor.log
exit $exit_code