-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sh
executable file
·51 lines (45 loc) · 1.14 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
#!/bin/bash
for i in "$@"
do
case $i in
-v=*|--version=*)
BUILDVERSION="${i#*=}"
shift # past argument=value
;;
-c=*|--configuration=*)
CONFIGURATION="${i#*=}"
shift # past argument=value
;;
--pack)
PACK="YES"
shift # past argument with no value
;;
*)
;;
--publish)
PUBLISH="YES"
shift # past argument with no value
;;
*)
# unknown option
;;
esac
done
echo "BUILD VERSION = ${BUILDVERSION}"
echo "CONFIGURATION = ${CONFIGURATION}"
echo "PACK = ${PACK}"
echo "PUBLISH = ${PUBLISH}"
if [ -z ${CONFIGURATION+x} ]
then
echo "No configuration is specified, defaulting to DEBUG"
CONFIGURATION=DEBUG
fi
if [ -z ${BUILDVERSION+x} ]
then
echo "No build version is specified, defaulting to 0.0.0"
BUILDVERSION=0.0.0
fi
scriptsDir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
dotnet restore $scriptsDir || exit 1
dotnet clean $scriptsDir --configuration $CONFIGURATION --verbosity normal || exit 1
dotnet build $scriptsDir --configuration $CONFIGURATION --verbosity normal --version-suffix '' /property:VersionPrefix=$BUILDVERSION || exit 1