-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathuab-build
executable file
·81 lines (67 loc) · 2.27 KB
/
uab-build
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/bin/bash
source "$(dirname "$0")/_uab-internal.sh"
uab_validate_conf && uab_load_init_conf
uab_dropif_failed 1
rm -rf "$UAB_WD" "$UAB_BUILDS" && mkdir "$UAB_WD" "$UAB_BUILDS"
uab_dropif_failed 1
cd "$UAB_WD"
git "--git-dir=../$UAB_GIT_DIR" "--work-tree=." fetch -p origin "$UAB_FETCH_SPEC" &&\
git "--git-dir=../$UAB_GIT_DIR" "--work-tree=." reset --hard FETCH_HEAD
uab_dropif_failed 1
cd ..
UAB_CNT_OK=0
UAB_CNT_FAIL=0
declare UAB_BUILD_OK
declare -A UAB_BUILD_MAP
for i in "${UAB_CONFIG_ARR[@]}"; do
uab_load_conf "$i"
uab_dropif_failed 1
echo "Building '$UAB_T_ID' ..."
"$UAB_EXEC_UNITY" -batchmode -nographics -logFile "$UAB_PATH/$UAB_BUILDS/$UAB_T_ID.log"\
-projectPath "$UAB_PATH/$UAB_WD/$UAB_PROJECT_PATH" -executeMethod FIX.UnityAutoBuild.BuildEntry.Run\
"--fix.uab.base=$UAB_T_BASE" "--fix.uab.path=$UAB_PATH/$UAB_BUILDS/$UAB_T_OUT"\
$UAB_T_PROP
if [ $? -eq 0 ]; then
UAB_BUILD_OK="1"
if [ ! -z "$UAB_T_BUNDLER" ]; then
outdir="$(dirname "$UAB_BUILDS/$UAB_T_OUT")"
if [ "$outdir" == "$UAB_BUILDS" ]; then
uab_error "FIXME: Bunder specified on single file output target!"
UAB_BUILD_OK="0"
elif [ -d "$outdir" ]; then
basedir="$(basename "$outdir")"
cd "$(dirname "$outdir")"
"uab_bundler_$UAB_T_BUNDLER" "$basedir" && rm -rf "$basedir"
if [ $? -ne 0 ]; then
UAB_BUILD_OK="0"
fi
cd "$UAB_PATH"
else
uab_error "Bunder specified, but no output directory created."
UAB_BUILD_OK="0"
fi
fi
else
UAB_BUILD_OK="0"
fi
if [ "$UAB_BUILD_OK" -ne 0 ]; then
UAB_BUILD_MAP[$UAB_T_ID]="OK"
let UAB_CNT_OK++
else
UAB_BUILD_MAP[$UAB_T_ID]="FAIL"
let UAB_CNT_FAIL++
fi
done
echo "==================== DONE ===================="
for i in "${!UAB_BUILD_MAP[@]}"; do
echo "* $i: ${UAB_BUILD_MAP[$i]}"
done
echo "OK: $UAB_CNT_OK"
echo "FAIL: $UAB_CNT_FAIL"
echo "=============================================="
if [ "$UAB_CNT_FAIL" -eq 0 ] && [ "$UAB_CNT_OK" -eq 0 ]; then
exit 2
elif [ "$UAB_CNT_FAIL" -ne 0 ]; then
exit 1
fi
exit 0