-
Notifications
You must be signed in to change notification settings - Fork 145
/
build.sh
executable file
·61 lines (57 loc) · 1.42 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
#!/bin/bash
INSIGHT_FOLDER=$(dirname "$0")
OUTPUT_FOLDER=${INSIGHT_FOLDER}/Build/Output
INSIGHT_CONFIGURATION="${INSIGHT_CONFIGURATION:-Release}"
INSIGHT_NOBUILD=
build_insight () {
dotnet build -c $INSIGHT_CONFIGURATION ./Insight.sln
}
while getopts "cdobtp" opt; do
case $opt in
c)
for folder in ./Insight.Database*; do
rm -rf $folder/bin
rm -rf $folder/obj
dotnet clean $folder/*.csproj || break
done
for folder in ./Insight.Tests*; do
rm -rf $folder/bin
rm -rf $folder/obj
dotnet clean $folder/*.csproj || break
done
;;
d)
echo "Building DEBUG Mode" >&2
INSIGHT_CONFIGURATION=Debug
;;
o)
echo "Running only-mode --no-build" >&2
INSIGHT_NOBUILD=--no-build
;;
b)
build_insight
;;
t)
build_insight
for folder in ./Insight.Tests*; do
dotnet test -c $INSIGHT_CONFIGURATION ${INSIGHT_NOBUILD} $folder/*.csproj || break
done
;;
p)
echo "Running Package" >&2
rm -rf ${OUTPUT_FOLDER}
mkdir ${OUTPUT_FOLDER}
for folder in ./Insight.Database*; do
dotnet pack -c $INSIGHT_CONFIGURATION ${INSIGHT_NOBUILD} $folder/*.csproj || break
cp $folder/bin/Release/*.nupkg ${OUTPUT_FOLDER}
done
;;
\?)
echo "Invalid option: -$OPTARG" >&2
exit 1
;;
esac
done
if (( $OPTIND == 1 )); then
build_insight
fi