@@ -12,6 +12,7 @@ export __BUILDTOOLS_USE_CSPROJ=true
12
12
__BUILD_TOOLS_PACKAGE_VERSION=$( cat " $__scriptpath /BuildToolsVersion.txt" | sed ' s/\r$//' ) # remove CR if mounted repo on Windows drive
13
13
14
14
DotNetCliFileName=" DotnetCLIVersion.txt"
15
+ DotNetExtraRuntimeFileName=" DotnetExtraRuntimeVersion.txt"
15
16
16
17
for i do
17
18
if [[ " $i " == * " netcoreapp3_0" * ]]; then
@@ -20,6 +21,7 @@ for i do
20
21
done
21
22
22
23
__DOTNET_TOOLS_VERSION=$( cat " $__scriptpath /$DotNetCliFileName " | sed ' s/\r$//' ) # remove CR if mounted repo on Windows drive
24
+ __DOTNET_RUNTIME_VERSION=$( cat " $__scriptpath /$DotNetExtraRuntimeFileName " | sed ' s/\r$//' ) # remove CR if mounted repo on Windows drive
23
25
__BUILD_TOOLS_PATH=" $__PACKAGES_DIR /microsoft.dotnet.buildtools/$__BUILD_TOOLS_PACKAGE_VERSION /lib"
24
26
__INIT_TOOLS_RESTORE_PROJECT=" $__scriptpath /init-tools.msbuild"
25
27
__BUILD_TOOLS_SEMAPHORE=" $__TOOLRUNTIME_DIR /$__BUILD_TOOLS_PACKAGE_VERSION /init-tools.complete"
@@ -128,10 +130,11 @@ if [ ! -e "$__DOTNET_PATH" ]; then
128
130
esac
129
131
__PKG_RID=$__PKG_RID -$__PKG_ARCH
130
132
__DOTNET_PKG=dotnet-sdk-${__DOTNET_TOOLS_VERSION} -$__PKG_RID
133
+ __DOTNET_EXTRA_RUNTIME_PKG=dotnet-runtime-${__DOTNET_RUNTIME_VERSION} -$__PKG_RID
131
134
fi
132
135
mkdir -p " $__DOTNET_PATH "
133
136
134
- echo " Installing dotnet cli..."
137
+ echo " Installing dotnet cli ${__DOTNET_TOOLS_VERSION} ..."
135
138
__DOTNET_LOCATION=" https://dotnetcli.azureedge.net/dotnet/Sdk/${__DOTNET_TOOLS_VERSION} /${__DOTNET_PKG} .tar.gz"
136
139
137
140
install_dotnet_cli () {
@@ -153,6 +156,28 @@ if [ ! -e "$__DOTNET_PATH" ]; then
153
156
}
154
157
execute_with_retry install_dotnet_cli >> " $__init_tools_log " 2>&1
155
158
159
+ echo " Installing dotnet runtime ${__DOTNET_RUNTIME_VERSION} ..."
160
+ __DOTNET_EXTRA_RUNTIME_LOCATION=" https://dotnetcli.azureedge.net/dotnet/Runtime/${__DOTNET_RUNTIME_VERSION} /${__DOTNET_EXTRA_RUNTIME_PKG} .tar.gz"
161
+
162
+ install_dotnet_extra_runtime () {
163
+ if [[ -z " ${DotNetExtraRuntimeTarPath-} " ]]; then
164
+ echo " Installing '${__DOTNET_EXTRA_RUNTIME_LOCATION} ' to '$__DOTNET_PATH /dotnet.extra.runtime.tar'"
165
+ rm -rf -- " $__DOTNET_PATH /*"
166
+ # curl has HTTPS CA trust-issues less often than wget, so lets try that first.
167
+ if command -v curl > /dev/null; then
168
+ curl --retry 10 -sSL --create-dirs -o $__DOTNET_PATH /dotnet.extra.runtime.tar ${__DOTNET_EXTRA_RUNTIME_LOCATION}
169
+ else
170
+ wget -q -O $__DOTNET_PATH /dotnet.extra.runtime.tar ${__DOTNET_EXTRA_RUNTIME_LOCATION}
171
+ fi
172
+ else
173
+ echo " Copying '$DotNetExtraRuntimeTarPath ' to '$__DOTNET_PATH /dotnet.extra.runtime.tar'"
174
+ cp $DotNetExtraRuntimeTarPath $__DOTNET_PATH /dotnet.extra.runtime.tar
175
+ fi
176
+ cd " $__DOTNET_PATH "
177
+ tar -xf " $__DOTNET_PATH /dotnet.extra.runtime.tar"
178
+ }
179
+ execute_with_retry install_dotnet_extra_runtime >> " $__init_tools_log " 2>&1
180
+
156
181
cd " $__scriptpath "
157
182
fi
158
183
0 commit comments