forked from NuGet/NuGet.Client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
47 lines (38 loc) · 1.12 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
#!/usr/bin/env bash
while true ; do
case "$1" in
-c|--clear-cache) CLEAR_CACHE=1 ; shift ;;
--) shift ; break ;;
*) shift ; break ;;
esac
done
# Run configure which installs the .NET SDK
. ./configure.sh
if [ $? -ne 0 ]; then
echo "configure.sh failed !!"
exit 1
fi
# init the repo
git submodule init
git submodule update
# clear caches
if [ "$CLEAR_CACHE" == "1" ]; then
# echo "Clearing the nuget web cache folder"
# rm -r -f ~/.local/share/NuGet/*
echo "Clearing the nuget packages folder"
rm -r -f ~/.nuget/packages/*
fi
# restore packages
echo "dotnet msbuild build/build.proj /t:Restore /p:Configuration=Release /p:BuildNumber=1 /p:ReleaseLabel=beta"
dotnet msbuild build/build.proj /t:Restore /p:Configuration=Release /p:BuildNumber=1 /p:ReleaseLabel=beta
if [ $? -ne 0 ]; then
echo "Restore failed!!"
exit 1
fi
# run tests
echo "dotnet msbuild build/build.proj /t:CoreUnitTests /p:Configuration=Release /p:BuildNumber=1 /p:ReleaseLabel=beta"
dotnet msbuild build/build.proj /t:CoreUnitTests /p:Configuration=Release /p:BuildNumber=1 /p:ReleaseLabel=beta
if [ $? -ne 0 ]; then
echo "Tests failed!!"
exit 1
fi