Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite testhost.json #19320

Merged
merged 2 commits into from
Apr 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions src/redist/targets/GenerateLayout.targets
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,29 @@
Overwrite="true" />
</Target>

<Target Name="FixNewtonsoftInTesthostDepsJson" >

<!-- Patch version of Newtonsoft.Json in testhost.deps.json, because it is picked up by
compliance checking scripts as a false-positive vulnerability. -->

<ItemGroup>
<NewtonSoftJsonVersionReplacement Include="%22Newtonsoft.Json%22: %2213.0.0.0%22">
<ReplacementString>"Newtonsoft.Json": "13.0.1.0"</ReplacementString>
</NewtonSoftJsonVersionReplacement>
<NewtonSoftJsonVersionReplacement Include="Newtonsoft.Json/13.0.0.0">
<ReplacementString>Newtonsoft.Json/13.0.1.0</ReplacementString>
</NewtonSoftJsonVersionReplacement>
</ItemGroup>

<ItemGroup>
<TestHostDepsJsonPath Include="$(OutputPath)/**/testhost.deps.json" />
</ItemGroup>
<ReplaceFileContents
InputFiles="@(TestHostDepsJsonPath)"
DestinationFiles="@(TestHostDepsJsonPath)"
ReplacementItems="@(NewtonSoftJsonVersionReplacement)" />
</Target>

<Target Name="CopyIncludedWorkloadManifestFile" >

<ItemGroup>
Expand Down Expand Up @@ -573,6 +596,7 @@
LayoutWorkloadUserLocalMarker;
LayoutBundledTools;
RetargetTools;
FixNewtonsoftInTesthostDepsJson;
CrossgenLayout;
LayoutAppHostTemplate;
GeneratePrecomputedRarCache;
Expand Down