-
Notifications
You must be signed in to change notification settings - Fork 24
/
build.sh
executable file
·36 lines (27 loc) · 885 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
#!/usr/bin/env bash
# Doing this because running this normally in bash on windows returns this:
# `MSBUILD : error MSB1008: Only one project can be specified.
# Switch: t:ConvertMain`
# and I dont feel like figuring out why
if [ "$(expr substr $(uname -s) 1 10)" == "MINGW64_NT" ]; then
# If on windows runs powershell version of build script instead of sh
powershell -ExecutionPolicy ByPass -File ./build.ps1
else
set -eu
CYAN='\033[0;36m'
NC='\033[0m'
__exec() {
local cmd=${1:0}
shift
echo -e "${CYAN} > $cmd $@${NC}"
$cmd $@
}
rm -rf artifacts/
rm -rf Example/obj/
rm -rf Source/MTT/obj/
__exec dotnet test
__exec dotnet restore ./Source/MTT/
__exec dotnet pack -c Release ./Source/MTT/
__exec dotnet restore ./Example/
__exec dotnet msbuild /nologo '/t:ConvertMain' ./Example/
fi