-
Notifications
You must be signed in to change notification settings - Fork 783
/
build
executable file
·46 lines (35 loc) · 1.09 KB
/
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
#!/usr/bin/env bash
set -euo pipefail
function write_error {
echo "error(1): $1" 2>&1
exit 1
}
function guard_bin {
builtin type -P "$1" &>/dev/null || write_error "Could not find '$1'; $2"
}
guard_bin git "please install the Git CLI from https://git-scm.com/"
guard_bin dotnet "please install the .NET SDK from https://dot.net/"
if [ `uname -o` = Msys ]; then
guard_bin msbuild.exe "please run this from a Visual Studio developer shell"
else
guard_bin mono "please install Mono from https://www.mono-project.com/"
fi
[ $(dotnet --version | cut -d. -f1) -ge 8 ] || write_error ".NET SDK version $(dotnet --version) is too low; please install version 8.0 or later from https://dot.net/"
git submodule status | while read line; do
if [ "$(echo $line | cut -b1)" == "-" ]; then
pieces=( $line )
git submodule update --init ${pieces[1]}
echo ""
fi
done
PUSHED=0
cleanup () {
if [[ $PUSHED == 1 ]]; then
popd >/dev/null
PUSHED=0
fi
}
trap cleanup EXIT ERR INT TERM
pushd $( cd "$(dirname "$0")" ; pwd -P ) >/dev/null
PUSHED=1
dotnet run --project tools/builder --no-launch-profile -- "$@"