Skip to content

Commit 6108300

Browse files
committed
Force restore for Xunitlogchecker
1 parent d68da30 commit 6108300

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/tests/build.proj

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,12 @@
2828
<RestoreProjects Include="Common\GenerateHWIntrinsicTests\GenerateHWIntrinsicTests_Arm.csproj" />
2929
<RestoreProjects Include="Common\GenerateHWIntrinsicTests\GenerateHWIntrinsicTests_General.csproj" />
3030
<RestoreProjects Include="Common\GenerateHWIntrinsicTests\GenerateHWIntrinsicTests_X86.csproj" />
31-
<RestoreProjects Include="Common\XUnitLogChecker\XUnitLogChecker.csproj" />
31+
<RestoreProjects Include="Common\XUnitLogChecker\XUnitLogChecker.csproj"
32+
Condition="$(IsXUnitLogCheckerSupported)">
33+
<!-- XUnitLogChecker is published as AOT, so it needs the current RID. The RID may change during the build.
34+
This flag will force restore to use the latest RuntimeIdentifier property. -->
35+
<ForceRestore>true</ForceRestore>
36+
</RestoreProjects>
3237
<RestoreProjects Include="Common\XUnitWrapperGenerator\XUnitWrapperGenerator.csproj" />
3338
<RestoreProjects Include="Common\XUnitWrapperLibrary\XUnitWrapperLibrary.csproj" />
3439
<RestoreProjects Include="Common\XHarnessRunnerLibrary\XHarnessRunnerLibrary.csproj" />
@@ -542,17 +547,18 @@
542547

543548
<!-- restore all csproj's with PackageReferences in one pass -->
544549
<MSBuild Projects="build.proj"
545-
Properties="RestoreProj=%(RestoreProjects.Identity)"
550+
Properties="RestoreProj=%(RestoreProjects.Identity);_ForceRestore=%(RestoreProjects.ForceRestore)"
546551
Targets="RestorePackage" />
547552

548553
<Message Importance="High" Text="[$([System.DateTime]::Now.ToString('HH:mm:ss.ff'))] Restoring all packages...Done." />
549554
</Target>
550555

551556
<Target Name="RestorePackage">
552557
<PropertyGroup>
553-
<_ConfigurationProperties>/p:TargetOS=$(TargetOS) /p:TargetArchitecture=$(TargetArchitecture) /p:Configuration=$(Configuration) /p:CrossBuild=$(CrossBuild) -p:RuntimeIdentifier=$(RuntimeIdentifier)</_ConfigurationProperties>
558+
<_ConfigurationProperties>/p:TargetOS=$(TargetOS) /p:TargetArchitecture=$(TargetArchitecture) /p:Configuration=$(Configuration) /p:CrossBuild=$(CrossBuild)</_ConfigurationProperties>
554559
<_ConfigurationProperties Condition="'$(UseLocalAppHostPack)' == 'true'">$(_ConfigurationProperties) -p:EnableAppHostPackDownload=false -p:EnableTargetingPackDownload=false -p:EnableRuntimePackDownload=false</_ConfigurationProperties>
555-
<DotnetRestoreCommand>"$(DotNetTool)" restore $(RestoreProj) $(PackageVersionArg) /p:SetTFMForRestore=true $(_ConfigurationProperties)</DotnetRestoreCommand>
560+
<_ForceRestore Condition="'$(_ForceRestore)' == 'true'">-f</_ForceRestore>
561+
<DotnetRestoreCommand>"$(DotNetTool)" restore $(_ForceRestore) -r $(RuntimeIdentifier) $(RestoreProj) $(PackageVersionArg) /p:SetTFMForRestore=true $(_ConfigurationProperties)</DotnetRestoreCommand>
556562
</PropertyGroup>
557563
<Exec Command="$(DotnetRestoreCommand)"/>
558564
</Target>

0 commit comments

Comments
 (0)