-
Notifications
You must be signed in to change notification settings - Fork 33
/
build.sh
executable file
·58 lines (51 loc) · 987 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
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
#!/bin/bash -eu
{ set +x; } 2>/dev/null
SOURCE=$0
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
OS="Mac"
if [[ -e "/c/" ]]; then
OS="Windows"
fi
CONFIGURATION=Release
PUBLIC=""
UNITYBUILD=0
while (( "$#" )); do
case "$1" in
-d|--debug)
CONFIGURATION="Debug"
;;
-r|--release)
CONFIGURATION="Release"
;;
-n|--unity)
UNITYBUILD=1
;;
-p|--public)
PUBLIC="-p:PublicRelease=true"
;;
-c)
shift
CONFIGURATION=$1
;;
--ispublic)
shift
if [[ x"$1" == x"1" ]]; then
PUBLIC="-p:PublicRelease=true"
fi
;;
-*|--*=) # unsupported flags
echo "Error: Unsupported flag $1" >&2
exit 1
;;
esac
shift
done
if [[ x"$UNITYBUILD" == x"1" ]]; then
CONFIGURATION="${CONFIGURATION}Unity"
fi
pushd $DIR >/dev/null 2>&1
if [[ x"${APPVEYOR:-}" == x"" ]]; then
dotnet restore
fi
dotnet build --no-restore -c $CONFIGURATION $PUBLIC
popd >/dev/null 2>&1