forked from fuse-open/fuse-studio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·74 lines (64 loc) · 1.4 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/bash
trap 'echo BUILD FAILED!; exit 1' ERR
cd "`dirname "$0"`"
if [ "$OSTYPE" = msys ]; then
cmd //c build.bat
exit $?
fi
DO_INIT="0"
NO_BUILD="0"
CONFIGURATION="Debug"
# Automatically init on first run
if [ ! -f .build-inited ]; then
DO_INIT="1"
fi
for arg in "$@"; do
case $arg in
--debug)
CONFIGURATION="Debug"
;;
--release)
CONFIGURATION="Release"
;;
--init)
DO_INIT="1"
;;
--nobuild)
NO_BUILD="1"
;;
-h|--help)
echo "Available options:"
echo ""
echo " --init Initializes git submodules and install nuget packages (auto first build)"
echo " --release Uses release configuration"
echo " --debug Uses debug configuration (default)"
echo ""
exit 0
;;
*)
echo "ERROR: Invalid argument '$arg'" >&2
exit 1
;;
esac
done
if [ "$DO_INIT" = "1" ]; then
if [ "$IS_LINUX" = "1" ]; then
# NuGet fails on Linux without this
mozroots --import --ask-remove
fi
mono .nuget/NuGet.exe restore Fuse-OSX.sln
mono Stuff/stuff.exe install Stuff
touch .build-inited
fi
if [ "$NO_BUILD" == "1" ]; then
exit 0
fi
case $OSTYPE in
darwin*)
msbuild Fuse-OSX.sln /p:Configuration=$CONFIGURATION
;;
*)
echo "ERROR: Unsupported system '$OSTYPE'" >&2
exit 1
;;
esac