-
-
Notifications
You must be signed in to change notification settings - Fork 348
/
build
executable file
·65 lines (54 loc) · 1.31 KB
/
build
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
62
63
64
65
#!/bin/sh
set -e
arg0=""
remainingArgs=""
if [ $# -gt 0 ]; then
arg0="$1"
fi
if [ $# -gt 1 ]; then
skippedFirst=false
for i in "$@"; do
if $skippedFirst; then
remainingArgs="$remainingArgs $i"
else
skippedFirst=true
fi
done
fi
nugetVersion="6.8.0"
useExperimental=false
rootDir=$(dirname $0)
scriptFile="$rootDir/build.cake"
buildDir="$rootDir/_build"
toolsDir="$buildDir/tools"
nugetExe="$toolsDir/NuGet/$nugetVersion/nuget.exe"
nugetDir="$(dirname $nugetExe)"
if [ ! -d "$nugetDir" ]; then
mkdir -p "$nugetDir"
fi
if [ ! -f "$nugetExe" ]; then
curl -L "https://dist.nuget.org/win-x86-commandline/v${nugetVersion}/nuget.exe" --output "$nugetExe"
fi
# dotnet tool install idiotically returns failure if already installed,
# so we have to ignore all errors from it
# https://github.com/dotnet/sdk/issues/9500
set +e
dotnet tool install --global Cake.Tool
set -e
cakeArgs=""
if [ -n "$arg0" ]; then
case $arg0 in
-*)
cakeArgs="$cakeArgs $arg0"
;;
*)
cakeArgs="$cakeArgs --target=$arg0"
;;
esac
fi
if $useExperimental; then
cakeArgs="$cakeArgs --experimental"
fi
export PATH="$PATH:$HOME/.dotnet/tools"
dotnet cake --verbosity Minimal "$scriptFile" $cakeArgs $remainingArgs
exit $?