-
Notifications
You must be signed in to change notification settings - Fork 20
/
rebuild.sh
executable file
·64 lines (58 loc) · 1.65 KB
/
rebuild.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
#!/bin/bash
set -e
set -x
if [[ -z "$1" ]]; then
echo Usage:
echo
echo "$0 <Platform> [Clean]"
echo
echo "Where <Platform> can be Android|MacOS|Windows|iOS"
echo "When the second argument is Clean, the working tree is cleaned up"
exit -1
fi
#############################
# SETUP
#############################
# On mac we can't call the .exe's straight away
SOLUTION=Decoders
HOST=`uname`
if [[ x$HOST != xMINGW* ]]; then
CMD_PREFIX="mono ./"
else
CMD_PREFIX="./"
fi
###########################
# The general build target
###########################
TARGET=Rebuild
# The solution configurationt to build
CONFIGURATION=Release
# Where the build will reside
if [[ x$1 == xiOS ]]; then
PLATFORM=iPhone
else
PLATFORM=AnyCPU
fi
if [[ x$1 == xWindows ]]; then
echo Cleaning out installer folder
/c/Windows/Microsoft.NET/Framework/v4.0.30319/MSBuild.exe //t:${TARGET} //p:Configuration=${CONFIGURATION} ${SOLUTION}.$1.sln
elif [[ x$1 == xMacOS ]]; then
if [[ ${CLEANUP} ]]; then
/Applications/Xamarin\ Studio.app/Contents/MacOS/mdtool build ${SOLUTION}.$1.sln -c:${CONFIGURATION} -t:Clean
fi
/Applications/Xamarin\ Studio.app/Contents/MacOS/mdtool build ${SOLUTION}.$1.sln -c:${CONFIGURATION} -t:Build
elif [[ x$1 == xLinux ]]; then
if [[ ${CLEANUP} ]]; then
xbuild ${SOLUTION}.$1.sln /t:Clean /p:Configuration=${CONFIGURATION}
fi
xbuild ${SOLUTION}.$1.sln /t:Build /p:Configuration=${CONFIGURATION}
elif [[ x$1 == xAndroid ]]; then
if [[ ${CLEANUP} ]]; then
xbuild ${SOLUTION}.$1.sln /t:Clean
fi
echo Building
xbuild ${SOLUTION}.$1.sln /p:Configuration=${CONFIGURATION} /t:${TARGET}
else
echo Unknown platform $1
exit -1;
fi