forked from emgarten/NuGet.CatalogReader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·53 lines (37 loc) · 1.04 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
#!/usr/bin/env bash
RESULTCODE=0
pushd $(pwd)
# Download dotnet cli
DOTNET="$(pwd)/.cli/dotnet"
if [ ! -f $DOTNET ]; then
echo "Installing dotnet"
mkdir -p .cli
curl -o .cli/dotnet-install.sh https://raw.githubusercontent.com/dotnet/cli/c497bf498fd4e964b00e2ee44bd840f2a269ea6c/scripts/obtain/dotnet-install.sh
# Run install.sh
chmod +x .cli/dotnet-install.sh
.cli/dotnet-install.sh -i .cli -c 2.0 -v 2.0.0
fi
# Display info
$DOTNET --info
# clean
rm -r -f $(pwd)/artifacts
# Clean projects and write out git info
$DOTNET msbuild build/build.proj /t:Clean\;WriteGitInfo /p:Configuration=Release /nologo /v:m
if [ $? -ne 0 ]; then
echo "Clean;WriteGitInfo FAILED!"
exit 1
fi
# restore
$DOTNET msbuild build/build.proj /t:Restore /p:Configuration=Release /nologo /v:m
if [ $? -ne 0 ]; then
echo "Restore FAILED!"
exit 1
fi
# build
$DOTNET msbuild build/build.proj /t:Build\;Test\;Pack /p:Configuration=Release /nologo /v:m
if [ $? -ne 0 ]; then
echo "Build FAILED!"
exit 1
fi
popd
exit $RESULTCODE