forked from ubisoft/Sharpmake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap.sh
executable file
·52 lines (40 loc) · 1.17 KB
/
bootstrap.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
#!/usr/bin/env bash
function success {
echo Bootstrap succeeded \!
exit 0
}
function error {
echo Bootstrap failed \!
exit 1
}
# fail immediately if anything goes wrong
set -e
CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
which msbuild > /dev/null
MSBUILD_FOUND=$?
if [ $MSBUILD_FOUND -ne 0 ]; then
echo "MSBuild not found"
error
fi
# workaround for https://github.com/mono/mono/issues/6752
TERM=xterm
SHARPMAKE_EXECUTABLE=$CURRENT_DIR/bin/debug/Sharpmake.Application.exe
$CURRENT_DIR/CompileSharpmake.sh $CURRENT_DIR/Sharpmake.Application/Sharpmake.Application.csproj Debug AnyCPU
if [ $? -ne 0 ]; then
echo "The build has failed."
if [ -f $SHARPMAKE_EXECUTABLE ]; then
echo "A previously built sharpmake exe was found at '${SHARPMAKE_EXECUTABLE}', it will be reused."
fi
fi
which mono > /dev/null
MONO_FOUND=$?
if [ $MONO_FOUND -ne 0 ]; then
echo "Mono not found"
error
fi
SHARPMAKE_MAIN=${1:-"$CURRENT_DIR/Sharpmake.Main.sharpmake.cs"}
echo "Generating Sharpmake solution..."
SM_CMD="mono --debug \"${SHARPMAKE_EXECUTABLE}\" \"/sources(\\\"${SHARPMAKE_MAIN}\\\")\" /verbose"
echo $SM_CMD
eval $SM_CMD || error
success