-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·57 lines (49 loc) · 1.67 KB
/
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#! /bin/sh
# NOTE the command args below make the assumption that your Unity project folder is
# a subdirectory of the repo root directory, e.g. for this repo "unity-ci-test"
# the project folder is "UnityProject". If this is not true then adjust the
# -projectPath argument to point to the right location.
## Run the editor unit tests
echo "Running editor unit tests for ${UNITYCI_PROJECT_NAME}"
/Applications/Unity/Unity.app/Contents/MacOS/Unity \
-batchmode \
-nographics \
-silent-crashes \
-logFile $(pwd)/unity.log \
-projectPath "$(pwd)/${UNITYCI_PROJECT_NAME}" \
-runEditorTests \
-editorTestsResultFile $(pwd)/test.xml \
-quit
rc0=$?
echo "Unit test logs"
cat $(pwd)/test.xml
# exit if tests failed
if [ $rc0 -ne 0 ]; then { echo "Failed unit tests"; exit $rc0; } fi
## Make the builds
## Recall from install.sh that a separate module was needed for Windows build support
echo "Attempting build of ${UNITYCI_PROJECT_NAME} for Windows"
/Applications/Unity/Unity.app/Contents/MacOS/Unity \
-batchmode \
-nographics \
-silent-crashes \
-logFile $(pwd)/unity.log \
-projectPath "$(pwd)/${UNITYCI_PROJECT_NAME}" \
-buildWindowsPlayer "$(pwd)/Build/windows/${UNITYCI_PROJECT_NAME}.exe" \
-quit
rc1=$?
echo "Build logs (Windows)"
cat $(pwd)/unity.log
##echo "Attempting build of ${UNITYCI_PROJECT_NAME} for OSX"
##/Applications/Unity/Unity.app/Contents/MacOS/Unity \
## -batchmode \
## -nographics \
## -silent-crashes \
## -logFile $(pwd)/unity.log \
## -projectPath "$(pwd)/${UNITYCI_PROJECT_NAME}" \
## -buildOSXUniversalPlayer "$(pwd)/Build/osx/${UNITYCI_PROJECT_NAME}.app" \
## -quit
##rc2=$?
##echo "Build logs (OSX)"
##cat $(pwd)/unity.log
exit $(($rc1)) #$(($rc1|$rc2))
exit 0