Skip to content

Commit

Permalink
Fix package references
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
martincostello committed Mar 14, 2024
1 parent 66d7992 commit 6188e3f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
6 changes: 0 additions & 6 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -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" />
Expand Down
10 changes: 6 additions & 4 deletions src/HttpClientInterception/JustEat.HttpClientInterception.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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>

0 comments on commit 6188e3f

Please sign in to comment.