forked from aspnet/BuildTools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·57 lines (52 loc) · 1.49 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
#!/usr/bin/env bash
set -euo pipefail
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $DIR/sdk/KoreBuild/KoreBuild.sh
__usage() {
echo "Usage: $0 [-v|--verbose] [-d|--dotnet-home <DIR>] [-s|--tools-source <URL>] [[--] <MSBUILD_ARG>...]"
echo ""
echo "Arguments:"
echo " <MSBUILD_ARG>... Arguments passed to MSBuild. Variable number of arguments allowed."
echo ""
echo "Options:"
echo " -v|--verbose Show verbose output."
echo " -d|--dotnet-home <DIR> The directory where .NET Core tools will be stored. Defaults to '$DOTNET_HOME'."
echo " -s|--tools-source <URL> The base url where build tools can be downloaded. Defaults to '$tools_source'."
exit 2
}
#
# main
#
[ -z "${DOTNET_HOME:-}"] && DOTNET_HOME="$HOME/.dotnet"
tools_source='https://aspnetcore.blob.core.windows.net/buildtools'
verbose=false
while [[ $# > 0 ]]; do
case $1 in
-\?|-h|--help)
__usage
;;
-d|--dotnet-home)
shift
DOTNET_HOME=${1:-}
[ -z "$DOTNET_HOME" ] && __usage
;;
-s|--tools-source)
shift
tools_source=${1:-}
[ -z "$tools_source" ] && __usage
;;
-v|--verbose)
verbose=true
;;
--)
shift
break
;;
*)
break
;;
esac
shift
done
install_tools $tools_source $DOTNET_HOME
invoke_repository_build $DIR $@