From b075700d8d2cbddd78f9406c075b00ca2c584847 Mon Sep 17 00:00:00 2001
From: Martin Costello <martin@martincostello.com>
Date: Thu, 14 Mar 2024 17:28:06 +0000
Subject: [PATCH 1/2] Ignore System.Text.Json

Ignore package updates for System.Text.Json.
---
 .github/dependabot.yml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index 984531ca..394e6558 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -25,3 +25,4 @@ updates:
   - dependency-name: Microsoft.AspNetCore.WebUtilities
   - dependency-name: Newtonsoft.Json
   - dependency-name: System.Net.Http
+  - dependency-name: System.Text.Json

From 125307ca9d17892387714c232b05da5e4d23d3a3 Mon Sep 17 00:00:00 2001
From: Martin Costello <martin@martincostello.com>
Date: Thu, 14 Mar 2024 10:36:07 -0700
Subject: [PATCH 2/2] Fix package references - Use VersionOverride and
 IsTargetFrameworkCompatible for System.Text.Json versions. - Fix net7.0
 target not using the right version of System.Text.Json. - Simplify AoT
 properties.

---
 Directory.Packages.props                               |  6 ------
 .../JustEat.HttpClientInterception.csproj              | 10 ++++++----
 2 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/Directory.Packages.props b/Directory.Packages.props
index a7191a8f..4e60e990 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -22,12 +22,6 @@
     <PackageVersion Include="xunit" Version="2.7.0" />
     <PackageVersion Include="xunit.runner.visualstudio" Version="2.5.7" />
   </ItemGroup>
-  <ItemGroup Condition=" '$(AssemblyName)' == 'JustEat.HttpClientInterception' and '$(TargetFramework)' == 'net6.0' ">
-    <PackageVersion Update="System.Text.Json" Version="6.0.0" />
-  </ItemGroup>
-  <ItemGroup Condition=" '$(AssemblyName)' != 'JustEat.HttpClientInterception' ">
-    <PackageVersion Update="System.Text.Json" Version="8.0.0" />
-  </ItemGroup>
   <ItemGroup>
     <PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" PrivateAssets="All" />
     <PackageReference Include="StyleCop.Analyzers" PrivateAssets="All" />
diff --git a/src/HttpClientInterception/JustEat.HttpClientInterception.csproj b/src/HttpClientInterception/JustEat.HttpClientInterception.csproj
index a3a5a5a7..091e04b0 100644
--- a/src/HttpClientInterception/JustEat.HttpClientInterception.csproj
+++ b/src/HttpClientInterception/JustEat.HttpClientInterception.csproj
@@ -19,6 +19,12 @@
     <PackageReference Include="Microsoft.AspNetCore.WebUtilities" />
     <PackageReference Include="System.Text.Json" />
   </ItemGroup>
+  <ItemGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">
+    <PackageVersion Update="System.Text.Json" VersionOverride="6.0.0" />
+  </ItemGroup>
+  <ItemGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">
+    <PackageVersion Update="System.Text.Json" VersionOverride="7.0.0" />
+  </ItemGroup>
   <ItemGroup Condition=" '$(TargetFramework)' == 'net472' ">
     <PackageReference Include="System.Net.Http" />
   </ItemGroup>
@@ -27,10 +33,6 @@
     <AdditionalFiles Include="PublicAPI/$(TargetFramework)/PublicAPI.Unshipped.txt" />
   </ItemGroup>
   <PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">
-    <EnableAotAnalyzer>true</EnableAotAnalyzer>
-    <EnableSingleFileAnalyzer>true</EnableSingleFileAnalyzer>
-    <EnableTrimAnalyzer>true</EnableTrimAnalyzer>
     <IsAotCompatible>true</IsAotCompatible>
-    <IsTrimmable>true</IsTrimmable>
   </PropertyGroup>
 </Project>