3 source="${BASH_SOURCE[0]}"
4 # resolve $source until the file is no longer a symlink
5 while [[ -h "$source" ]]; do
6 scriptroot
="$( cd -P "$
( dirname "$source" )" && pwd )"
7 source="$(readlink "$source")"
8 # if $source was a relative symlink, we need to resolve it relative to the path where the
9 # symlink file was located
10 [[ $source != /* ]] && source="$scriptroot/$source"
12 scriptroot
="$( cd -P "$
( dirname "$source" )" && pwd )"
14 .
"$scriptroot/tools.sh"
20 runtimeSourceFeedKey
=''
21 while [[ $# > 0 ]]; do
22 opt
="$(echo "$1" | awk '{print tolower($0)}')"
38 runtimeSourceFeed
="$1"
40 -runtimesourcefeedkey)
42 runtimeSourceFeedKey
="$1"
45 Write-PipelineTelemetryError
-Category 'Build' -Message "Invalid argument: $1"
52 # Use uname to determine what the CPU is.
54 # Some Linux platforms report unknown for platform, but the arch for machine.
55 if [[ "$cpuname" == "unknown" ]]; then
73 echo "Unknown CPU $cpuname detected, treating it as x64"
78 dotnetRoot
="$repo_root/.dotnet"
79 if [[ $architecture != "" ]] && [[ $architecture != $buildarch ]]; then
80 dotnetRoot
="$dotnetRoot/$architecture"
83 InstallDotNet
$dotnetRoot $version "$architecture" $runtime true
$runtimeSourceFeed $runtimeSourceFeedKey ||
{
85 Write-PipelineTelemetryError
-Category 'InitializeToolset' -Message "dotnet-install.sh failed (exit code '$exit_code')." >&2
86 ExitWithExitCode
$exit_code