[Tizen] Fix calculation of method count for modules
[platform/upstream/dotnet/runtime.git] / build.sh
1 #!/usr/bin/env bash
2
3 source="${BASH_SOURCE[0]}"
4
5 function is_cygwin_or_mingw()
6 {
7   case $(uname -s) in
8     CYGWIN*)    return 0;;
9     MINGW*)     return 0;;
10     *)          return 1;;
11   esac
12 }
13
14 # resolve $SOURCE until the file is no longer a symlink
15 while [[ -h $source ]]; do
16   scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
17   source="$(readlink "$source")"
18
19   # if $source was a relative symlink, we need to resolve it relative to the path where the
20   # symlink file was located
21   [[ $source != /* ]] && source="$scriptroot/$source"
22 done
23
24 scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
25
26 if is_cygwin_or_mingw; then
27   # if bash shell running on Windows (not WSL),
28   # pass control to powershell build script.
29   scriptroot=$(cygpath -d "$scriptroot")
30   powershell -c "$scriptroot\\build.cmd" $@
31 else
32   "$scriptroot/eng/build.sh" $@
33 fi