@@ -171,6 +171,12 @@ This package is an internal implementation of the .NET Core SDK and is not meant
171
171
Condition =" '$(IsPackable)' == 'true'" >
172
172
<PropertyGroup >
173
173
<TarCommand Condition =" '$(TarCommand)' == ''" >tar</TarCommand >
174
+ <_RetryCommand >PowerShell -NoProfile -NoLogo -ExecutionPolicy Bypass -Command</_RetryCommand >
175
+ <_RetryCommand >$(_RetryCommand) " [System.Threading.Thread]::CurrentThread.CurrentCulture = '';</_RetryCommand >
176
+ <_RetryCommand >$(_RetryCommand) [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';</_RetryCommand >
177
+ <_RetryCommand >$(_RetryCommand) try { & '$(RepoRoot)\eng\scripts\InstallTar.ps1' -Verbose;</_RetryCommand >
178
+ <_RetryCommand >$(_RetryCommand) & $env:TarCommand -czf $(_TarArchiveOutputPath) .;</_RetryCommand >
179
+ <_RetryCommand >$(_RetryCommand) exit $LASTEXITCODE } catch { write-host $_; exit 1 }" <_RetryCommand >
174
180
175
181
<!-- For the tar packed with git, transform e.g. "C:\root\AspNetCore\File.tar.gz" to "/C/root/AspNetCore/File.tar.gz". -->
176
182
<_TarArchiveOutputPath >$(TarArchiveOutputPath)</_TarArchiveOutputPath >
@@ -184,9 +190,20 @@ This package is an internal implementation of the .NET Core SDK and is not meant
184
190
Overwrite =" true" />
185
191
186
192
<!-- Requires Windows 10 version 1803 or newer -->
187
- <Exec
188
- Command =" $(TarCommand) -czf $(_TarArchiveOutputPath) ."
189
- WorkingDirectory =" $(TargetingPackLayoutRoot)" />
193
+ <Exec Command =" $(TarCommand) -czf $(_TarArchiveOutputPath) ."
194
+ WorkingDirectory =" $(TargetingPackLayoutRoot)"
195
+ IgnoreExitCode =" true"
196
+ Condition =" '$(OS)' == 'Windows_NT'" >
197
+ <Output TaskParameter =" ExitCode" PropertyName =" _TarExitCode" />
198
+ </Exec >
199
+ <Exec Command =" $(_RetryCommand)"
200
+ WorkingDirectory =" $(TargetingPackLayoutRoot)"
201
+ Condition =" '$(OS)' == 'Windows_NT' AND '$(_TarExitCode)' != '0'" />
202
+
203
+ <Exec Command =" tar -czf $(_TarArchiveOutputPath) ."
204
+ WorkingDirectory =" $(TargetingPackLayoutRoot)"
205
+ Condition =" '$(OS)' != 'Windows_NT'" />
206
+
190
207
<Message Importance =" High" Text =" $(MSBuildProjectName) -> $(TarArchiveOutputPath)" />
191
208
</Target >
192
209
0 commit comments