Skip to content

Commit

Permalink
Feature Add DotNet 8 support (#1701)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisPulman committed May 24, 2024
1 parent 8ed4b56 commit d09db72
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 23 deletions.
4 changes: 2 additions & 2 deletions Refit.HttpClientFactory/Refit.HttpClientFactory.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Product>Refit HTTP Client Factory Extensions</Product>
<Description>Refit HTTP Client Factory Extensions</Description>
<TargetFrameworks>netstandard2.0;net462;net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net462;netstandard2.0;net6.0;net7.0;net8.0</TargetFrameworks>
<Nullable>enable</Nullable>
</PropertyGroup>

Expand Down
5 changes: 2 additions & 3 deletions Refit.Newtonsoft.Json/Refit.Newtonsoft.Json.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@
<PropertyGroup>
<Product>Refit Serializer for Newtonsoft.Json ($(TargetFramework))</Product>
<Description>Refit Serializers for Newtonsoft.Json</Description>
<TargetFrameworks>netstandard2.0;net462;net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net462;netstandard2.0;netstandard2.1</TargetFrameworks>
<GenerateDocumentationFile Condition=" '$(Configuration)' == 'Release' ">true</GenerateDocumentationFile>
<RootNamespace>Refit</RootNamespace>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />

<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
Expand Down
14 changes: 5 additions & 9 deletions Refit.Tests/Refit.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="..\Refit\targets\refit.props" />

<PropertyGroup>
<TargetFrameworks>net462;net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net462;net6.0;net7.0;net8.0</TargetFrameworks>
<Deterministic>false</Deterministic> <!-- Some tests rely on CallerFilePath -->
<RestoreAdditionalProjectSources>https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json</RestoreAdditionalProjectSources>
</PropertyGroup>

<ItemGroup>
<EmbeddedResource Include="Test Files\Test.pdf" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="6.0.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="xunit" Version="2.8.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.0" />
<PackageReference Include="System.Reactive" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="2.2.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.7.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.SourceGenerators.Testing.XUnit" Version="1.1.2-beta1.23509.1" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.9.2" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.SourceGenerators.Testing" Version="1.1.2-beta1.24169.1" />
<PackageReference Include="RichardSzalay.MockHttp" Version="6.0.0" />
<ProjectReference Include="..\Refit.HttpClientFactory\Refit.HttpClientFactory.csproj" />
<ProjectReference Include="..\Refit.Newtonsoft.Json\Refit.Newtonsoft.Json.csproj" />
Expand All @@ -29,9 +29,5 @@
<ProjectReference Include="..\InterfaceStubGenerator.Roslyn40\InterfaceStubGenerator.Roslyn40.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net461' ">
<Reference Include="System.Net.Http" />
</ItemGroup>

<Import Project="..\Refit\targets\refit.targets" />
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Testing;
using Microsoft.CodeAnalysis.Testing;
using Microsoft.CodeAnalysis.Testing.Verifiers;

namespace Refit.Tests
{
public static partial class CSharpIncrementalSourceGeneratorVerifier<TIncrementalGenerator>
where TIncrementalGenerator : IIncrementalGenerator, new()
{
public class Test : CSharpSourceGeneratorTest<EmptySourceGeneratorProvider, XUnitVerifier>
public class Test : CSharpSourceGeneratorTest<EmptySourceGeneratorProvider, DefaultVerifier>
{
public Test()
{
Expand Down
4 changes: 2 additions & 2 deletions Refit.Tests/Verifiers/CSharpSourceGeneratorVerifier`1+Test.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp.Testing;
using Microsoft.CodeAnalysis.Testing.Verifiers;
using Microsoft.CodeAnalysis.Testing;

namespace Refit.Tests
{
public static partial class CSharpSourceGeneratorVerifier<TSourceGenerator>
where TSourceGenerator : ISourceGenerator, new()
{
public class Test : CSharpSourceGeneratorTest<TSourceGenerator, XUnitVerifier>
public class Test : CSharpSourceGeneratorTest<TSourceGenerator, DefaultVerifier>
{
public Test()
{
Expand Down
2 changes: 1 addition & 1 deletion Refit.Xml/Refit.Xml.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<Product>Refit Xml Serializer ($(TargetFramework))</Product>
<Description>Refit Serializers for Xml</Description>
<TargetFrameworks>netstandard2.0;net462;net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net462;netstandard2.0;netstandard2.1</TargetFrameworks>
<GenerateDocumentationFile Condition=" '$(Configuration)' == 'Release' ">true</GenerateDocumentationFile>
<RootNamespace>Refit</RootNamespace>
<Nullable>enable</Nullable>
Expand Down
11 changes: 7 additions & 4 deletions Refit/Refit.csproj
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Product>Refit ($(TargetFramework))</Product>
<TargetFrameworks>netstandard2.0;netstandard2.1;net462;net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net462;netstandard2.0;netstandard2.1</TargetFrameworks>
<GenerateDocumentationFile Condition=" '$(Configuration)' == 'Release' ">true</GenerateDocumentationFile>

<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net462' or '$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netstandard2.1'">
<PackageReference Include="System.Text.Json" Version="8.0.3" />
<ItemGroup>
<PackageReference Include="System.Net.Http.Json" Version="8.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' != 'netstandard2.1'">
<PackageReference Include="System.Text.Json" Version="8.0.3" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
<Reference Include="System.Web" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
Expand Down

0 comments on commit d09db72

Please sign in to comment.