-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·60 lines (47 loc) · 1.63 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
#!/usr/bin/env bash
RESET="\033[0m"
RED="\033[0;31m"
print_install_instruction() {
echo -e "${RED} Please refer to https://github.com/dotnet/cli#add-debian-feed to install the latest dotnet \n\n ${RESET}"
}
restore() {
echo -e "==========================================================="
echo -e "Restore ...... "
echo -e "===========================================================\n"
dotnet restore WilsonUnix.sln
echo -e "\n"
}
build() {
echo -e "==========================================================="
echo -e "Build ...... "
echo -e "===========================================================\n"
dotnet build WilsonUnix.sln
echo -e "\n"
}
pack() {
echo -e "==========================================================="
echo -e "Pack ...... "
echo -e "===========================================================\n"
dotnet pack WilsonUnix.sln
echo -e "\n"
echo -e "==========================================================="
echo -e "Moving nuget packages to 'artifacts' folder ...... "
echo -e "===========================================================\n"
rm -rf artifacts
mkdir artifacts
mv src/*/bin/Debug/*.nupkg artifacts
}
echo -e "==========================================================="
echo -e "Check the installation and the version of dotnet ...... "
echo -e "===========================================================\n"
if ! type "dotnet" > /dev/null 2>&1; then
echo -e "${RED}Error: dotnet is not installed\n ${RESET}"
print_install_instruction
else
VERSION="$(dotnet --version)"
echo -e " dotnet version ${VERSION} is found.\n"
restore
build
pack
fi
echo -e "done."