Skip to content

Commit a296fe4

Browse files
author
John Luo
committed
Add retries for restores during LZMA generation
1 parent a7d7016 commit a296fe4

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

build/PackageArchive.targets

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,54 @@
4444

4545
<!-- Restore the target project -->
4646
<MSBuild
47+
ContinueOnError="true"
48+
Projects="$(_WorkRoot)Archive.csproj"
49+
Targets="Restore"
50+
Properties="RestorePackagesPath=$(FallbackStagingDir);RuntimeFrameworkVersion=$(LZMAMicrosoftNETCoreApp21PackageVersion);DotNetRestoreSourcePropsPath=$(GeneratedFallbackRestoreSourcesPropsPath);DotNetBuildOffline=true;AspNetUniverseBuildOffline=true" />
51+
52+
<!-- Retry if restore failed -->
53+
<PropertyGroup>
54+
<RestorePassed>$(MSBuildLastTaskResult)</RestorePassed>
55+
</PropertyGroup>
56+
<Warning Text="Restore failed, retry #1." Condition="'$(RestorePassed)' == 'false'"/>
57+
<MSBuild
58+
ContinueOnError="true"
59+
Condition="'$(RestorePassed)' == 'false'"
60+
Projects="$(_WorkRoot)Archive.csproj"
61+
Targets="Restore"
62+
Properties="RestorePackagesPath=$(FallbackStagingDir);RuntimeFrameworkVersion=$(LZMAMicrosoftNETCoreApp21PackageVersion);DotNetRestoreSourcePropsPath=$(GeneratedFallbackRestoreSourcesPropsPath);DotNetBuildOffline=true;AspNetUniverseBuildOffline=true" />
63+
64+
<!-- Retry if restore failed -->
65+
<PropertyGroup>
66+
<RestorePassed>$(MSBuildLastTaskResult)</RestorePassed>
67+
</PropertyGroup>
68+
<Warning Text="Restore failed, retry #2." Condition="'$(RestorePassed)' == 'false'"/>
69+
<MSBuild
70+
ContinueOnError="true"
71+
Condition="'$(RestorePassed)' == 'false'"
72+
Projects="$(_WorkRoot)Archive.csproj"
73+
Targets="Restore"
74+
Properties="RestorePackagesPath=$(FallbackStagingDir);RuntimeFrameworkVersion=$(LZMAMicrosoftNETCoreApp21PackageVersion);DotNetRestoreSourcePropsPath=$(GeneratedFallbackRestoreSourcesPropsPath);DotNetBuildOffline=true;AspNetUniverseBuildOffline=true" />
75+
76+
<!-- Retry if restore failed -->
77+
<PropertyGroup>
78+
<RestorePassed>$(MSBuildLastTaskResult)</RestorePassed>
79+
</PropertyGroup>
80+
<Warning Text="Restore failed, retry #3." Condition="'$(RestorePassed)' == 'false'"/>
81+
<MSBuild
82+
ContinueOnError="true"
83+
Condition="'$(RestorePassed)' == 'false'"
84+
Projects="$(_WorkRoot)Archive.csproj"
85+
Targets="Restore"
86+
Properties="RestorePackagesPath=$(FallbackStagingDir);RuntimeFrameworkVersion=$(LZMAMicrosoftNETCoreApp21PackageVersion);DotNetRestoreSourcePropsPath=$(GeneratedFallbackRestoreSourcesPropsPath);DotNetBuildOffline=true;AspNetUniverseBuildOffline=true" />
87+
88+
<!-- Retry if restore failed -->
89+
<PropertyGroup>
90+
<RestorePassed>$(MSBuildLastTaskResult)</RestorePassed>
91+
</PropertyGroup>
92+
<Warning Text="Restore failed, retry #4." Condition="'$(RestorePassed)' == 'false'"/>
93+
<MSBuild
94+
Condition="'$(RestorePassed)' == 'false'"
4795
Projects="$(_WorkRoot)Archive.csproj"
4896
Targets="Restore"
4997
Properties="RestorePackagesPath=$(FallbackStagingDir);RuntimeFrameworkVersion=$(LZMAMicrosoftNETCoreApp21PackageVersion);DotNetRestoreSourcePropsPath=$(GeneratedFallbackRestoreSourcesPropsPath);DotNetBuildOffline=true;AspNetUniverseBuildOffline=true" />

0 commit comments

Comments
 (0)