forked from KSP-CKAN/CKAN
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build
executable file
·63 lines (52 loc) · 1.34 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
#!/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="5.6.0"
useExperimental=false
rootDir=$(dirname $0)
scriptFile="$rootDir/build.cake"
buildDir="$rootDir/_build"
toolsDir="$buildDir/tools"
packagesDir="$buildDir/lib/nuget"
nugetExe="$toolsDir/NuGet/$nugetVersion/nuget.exe"
packagesConfigFile="$rootDir/packages.config"
cakeVersion="$(sed -nE "/id=\"Cake\"/s/.*version=\"(.+)\".*/\1/p" $packagesConfigFile)"
cakeExe="$packagesDir/Cake.$cakeVersion/Cake.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
mono "$nugetExe" restore "$packagesConfigFile" -OutputDirectory "$packagesDir"
cakeArgs=""
if [ -n "$arg0" ]; then
case $arg0 in
-*)
cakeArgs="$cakeArgs $arg0"
;;
*)
cakeArgs="$cakeArgs --target=$arg0"
;;
esac
fi
if $useExperimental; then
cakeArgs="$cakeArgs --experimental"
fi
mono "$cakeExe" "$scriptFile" $cakeArgs $remainingArgs
exit $?