Skip to content

Commit

Permalink
netcoreapp2.2 and netcoreapp2.1 support
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Nov 26, 2021
1 parent 5859111 commit 5dc6df8
Show file tree
Hide file tree
Showing 14 changed files with 47 additions and 22 deletions.
8 changes: 5 additions & 3 deletions src/Verify.Expecto/Verify.Expecto.csproj
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;netcoreapp3.1;netcoreapp3.0;net5;net6</TargetFrameworks>
<TargetFrameworks>netstandard2.0;netstandard2.1;netcoreapp3.1;netcoreapp3.0;netcoreapp2.2;netcoreapp2.1;net5;net6</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT' ">
<TargetFrameworks>netstandard2.0;netstandard2.1;netcoreapp3.1;netcoreapp3.0;net461;net472;net5;net6</TargetFrameworks>
<TargetFrameworks>netstandard2.0;netstandard2.1;netcoreapp3.1;netcoreapp3.0;netcoreapp2.2;netcoreapp2.1;net461;net472;net5;net6</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Expecto" Version="9.0.4" />
<PackageReference Include="ProjectDefaults" Version="1.0.61" PrivateAssets="All" />
<PackageReference Include="EmptyFiles" Version="2.8.0" PrivateAssets="None" />
<PackageReference Include="IndexRange" Version="1.0.0" Condition="$(TargetFramework) == 'netstandard2.0' OR $(TargetFramework) == 'net461' OR $(TargetFramework) == 'net472'" PrivateAssets="all" />
<PackageReference Include="IndexRange"
Version="1.0.0"
Condition="$(TargetFramework) == 'netstandard2.0' OR $(TargetFramework) == 'net461' OR $(TargetFramework) == 'net472' OR $(TargetFramework) == 'netcoreapp2.2' OR $(TargetFramework) == 'netcoreapp2.1'" PrivateAssets="all" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" Condition="$(Configuration) == 'Release'" />
<ProjectReference Include="..\Verify\Verify.csproj" PrivateAssets="None" />
</ItemGroup>
Expand Down
8 changes: 5 additions & 3 deletions src/Verify.MSTest/Verify.MSTest.csproj
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;netcoreapp3.1;netcoreapp3.0;net5;net6</TargetFrameworks>
<TargetFrameworks>netstandard2.0;netstandard2.1;netcoreapp3.1;netcoreapp3.0;netcoreapp2.2;netcoreapp2.1;net5;net6</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT' ">
<TargetFrameworks>netstandard2.0;netstandard2.1;netcoreapp3.1;netcoreapp3.0;net461;net472;net5;net6</TargetFrameworks>
<TargetFrameworks>netstandard2.0;netstandard2.1;netcoreapp3.1;netcoreapp3.0;netcoreapp2.2;netcoreapp2.1;net461;net472;net5;net6</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ProjectDefaults" Version="1.0.61" PrivateAssets="All" />
<PackageReference Include="EmptyFiles" Version="2.8.0" PrivateAssets="None" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.8" />
<PackageReference Include="IndexRange" Version="1.0.0" Condition="$(TargetFramework) == 'netstandard2.0' OR $(TargetFramework) == 'net461' OR $(TargetFramework) == 'net472'" PrivateAssets="all" />
<PackageReference Include="IndexRange"
Version="1.0.0"
Condition="$(TargetFramework) == 'netstandard2.0' OR $(TargetFramework) == 'net461' OR $(TargetFramework) == 'net472' OR $(TargetFramework) == 'netcoreapp2.2' OR $(TargetFramework) == 'netcoreapp2.1'" PrivateAssets="all" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" Condition="$(Configuration) == 'Release'" />
<ProjectReference Include="..\Verify\Verify.csproj" PrivateAssets="None" />
</ItemGroup>
Expand Down
8 changes: 5 additions & 3 deletions src/Verify.NUnit/Verify.NUnit.csproj
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;netcoreapp3.1;netcoreapp3.0;net5;net6</TargetFrameworks>
<TargetFrameworks>netstandard2.0;netstandard2.1;netcoreapp3.1;netcoreapp3.0;netcoreapp2.2;netcoreapp2.1;net5;net6</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT' ">
<TargetFrameworks>netstandard2.0;netstandard2.1;netcoreapp3.1;netcoreapp3.0;net461;net472;net5;net6</TargetFrameworks>
<TargetFrameworks>netstandard2.0;netstandard2.1;netcoreapp3.1;netcoreapp3.0;netcoreapp2.2;netcoreapp2.1;net461;net472;net5;net6</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="NUnit" Version="3.13.2" />
<PackageReference Include="ProjectDefaults" Version="1.0.61" PrivateAssets="All" />
<PackageReference Include="EmptyFiles" Version="2.8.0" PrivateAssets="None" />
<PackageReference Include="IndexRange" Version="1.0.0" Condition="$(TargetFramework) == 'netstandard2.0' OR $(TargetFramework) == 'net461' OR $(TargetFramework) == 'net472'" PrivateAssets="all" />
<PackageReference Include="IndexRange"
Version="1.0.0"
Condition="$(TargetFramework) == 'netstandard2.0' OR $(TargetFramework) == 'net461' OR $(TargetFramework) == 'net472' OR $(TargetFramework) == 'netcoreapp2.2' OR $(TargetFramework) == 'netcoreapp2.1'" PrivateAssets="all" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" Condition="$(Configuration) == 'Release'" />
<ProjectReference Include="..\Verify\Verify.csproj" PrivateAssets="None" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Core2_1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Core2_1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Foo
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Foo
4 changes: 2 additions & 2 deletions src/Verify.Tests/Verify.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6;netcoreapp3.1;netcoreapp3.0</TargetFrameworks>
<TargetFrameworks>net6;netcoreapp3.1;netcoreapp3.0;netcoreapp2.1</TargetFrameworks>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<PlatformTarget>x64</PlatformTarget>
<NoWarn>$(NoWarn);CS8002</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT' ">
<TargetFrameworks>net461;net48;net6;netcoreapp3.1;netcoreapp3.0</TargetFrameworks>
<TargetFrameworks>net461;net48;net6;netcoreapp3.1;netcoreapp3.0;netcoreapp2.1</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="InfoOf.Fody" Version="2.1.0" />
Expand Down
8 changes: 5 additions & 3 deletions src/Verify.Xunit/Verify.Xunit.csproj
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;netcoreapp3.1;netcoreapp3.0;net5;net6</TargetFrameworks>
<TargetFrameworks>netstandard2.0;netstandard2.1;netcoreapp3.1;netcoreapp3.0;netcoreapp2.2;netcoreapp2.1;net5;net6</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT' ">
<TargetFrameworks>netstandard2.0;netstandard2.1;netcoreapp3.1;netcoreapp3.0;net461;net472;net5;net6</TargetFrameworks>
<TargetFrameworks>netstandard2.0;netstandard2.1;netcoreapp3.1;netcoreapp3.0;netcoreapp2.2;netcoreapp2.1;net461;net472;net5;net6</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="xunit.assert" Version="2.4.1" />
<PackageReference Include="xunit.abstractions" Version="2.0.3" />
<PackageReference Include="xunit.extensibility.execution" Version="2.4.1" />
<PackageReference Include="ProjectDefaults" Version="1.0.61" PrivateAssets="All" />
<PackageReference Include="EmptyFiles" Version="2.8.0" PrivateAssets="None" />
<PackageReference Include="IndexRange" Version="1.0.0" Condition="$(TargetFramework) == 'netstandard2.0' OR $(TargetFramework) == 'net461' OR $(TargetFramework) == 'net472'" PrivateAssets="all" />
<PackageReference Include="IndexRange"
Version="1.0.0"
Condition="$(TargetFramework) == 'netstandard2.0' OR $(TargetFramework) == 'net461' OR $(TargetFramework) == 'net472' OR $(TargetFramework) == 'netcoreapp2.2' OR $(TargetFramework) == 'netcoreapp2.1'" PrivateAssets="all" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" Condition="$(Configuration) == 'Release'" />
<ProjectReference Include="..\Verify\Verify.csproj" PrivateAssets="None" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Verify/Compare/FileComparer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ static bool FilesAreSameSize(in FilePair file)

static async Task<CompareResult> DoCompare(VerifySettings settings, StreamCompare compare, FilePair filePair)
{
#if NETSTANDARD2_0 || NETFRAMEWORK
#if NETSTANDARD2_0 || NETFRAMEWORK || NETCOREAPP2_2 || NETCOREAPP2_1
using var fs1 = FileHelpers.OpenRead(filePair.Received);
using var fs2 = FileHelpers.OpenRead(filePair.Verified);
#else
Expand Down
6 changes: 6 additions & 0 deletions src/Verify/Naming/Namer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,11 @@ internal Namer(Namer namer)

static (string runtime, Version Version) GetRuntimeAndVersion()
{
#if NETCOREAPP2_1
return ("Core", new Version(2, 1));
#elif NETCOREAPP2_2
return ("Core", new Version(2, 2));
#else
var description = RuntimeInformation.FrameworkDescription;

if (description.StartsWith(".NET Framework", StringComparison.OrdinalIgnoreCase))
Expand All @@ -182,5 +187,6 @@ internal Namer(Namer namer)
}

throw new($"Could not resolve runtime for '{description}'.");
#endif
}
}
2 changes: 1 addition & 1 deletion src/Verify/Verifier/InnerVerifier_Stream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public Task Verify(byte[] target)
async Task VerifyStream(Stream stream)
{
var extension = settings.extension;
#if NETSTANDARD2_0 || NETFRAMEWORK
#if NETSTANDARD2_0 || NETFRAMEWORK || NETCOREAPP2_2 || NETCOREAPP2_1
using (stream)
#else
await using (stream)
Expand Down
2 changes: 1 addition & 1 deletion src/Verify/Verifier/VerifyEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ static async Task<EqualityResult> GetResult(VerifySettings settings, FilePair fi
}

var stream = target.StreamData;
#if NETSTANDARD2_0 || NETFRAMEWORK
#if NETSTANDARD2_0 || NETFRAMEWORK || NETCOREAPP2_2 || NETCOREAPP2_1
using (stream)
#else
await using (stream)
Expand Down
17 changes: 12 additions & 5 deletions src/Verify/Verify.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;netcoreapp3.1;netcoreapp3.0;net5;net6</TargetFrameworks>
<TargetFrameworks>netstandard2.0;netstandard2.1;netcoreapp3.1;netcoreapp3.0;netcoreapp2.2;netcoreapp2.1;net5;net6</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT' ">
<TargetFrameworks>netstandard2.0;netstandard2.1;netcoreapp3.1;netcoreapp3.0;net461;net472;net5;net6</TargetFrameworks>
<TargetFrameworks>netstandard2.0;netstandard2.1;netcoreapp3.1;netcoreapp3.0;netcoreapp2.2;netcoreapp2.1;net461;net472;net5;net6</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DiffEngine" Version="8.4.4" />
Expand All @@ -13,9 +13,16 @@
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" Condition="$(Configuration) == 'Release'" />
<PackageReference Include="ProjectDefaults" Version="1.0.61" PrivateAssets="All" />
<PackageReference Include="IndexRange" Version="1.0.0" Condition="$(TargetFramework) == 'netstandard2.0' OR $(TargetFramework) == 'net461' OR $(TargetFramework) == 'net472'" PrivateAssets="all" />
<PackageReference Include="Nullable" Version="1.3.0" Condition="$(TargetFramework) == 'netstandard2.0' OR $(TargetFramework) == 'net461' OR $(TargetFramework) == 'net472'" PrivateAssets="all" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="6.0.0" Condition="$(TargetFramework) == 'netstandard2.0' OR $(TargetFramework) == 'net461' OR $(TargetFramework) == 'net472'" />
<Content Include="buildTransitive\Verify.props" PackagePath="buildTransitive\Verify.props" />
<Content Include="buildTransitive\Verify.targets" PackagePath="buildTransitive\Verify.targets" />
<Content Include="buildTransitive\Verify.props" PackagePath="build\Verify.props" />
<Content Include="buildTransitive\Verify.targets" PackagePath="build\Verify.targets" />
</ItemGroup>

<ItemGroup Condition="$(TargetFramework) == 'netstandard2.0' OR $(TargetFramework) == 'net461' OR $(TargetFramework) == 'net472' OR $(TargetFramework) == 'netcoreapp2.2' OR $(TargetFramework) == 'netcoreapp2.1'">
<PackageReference Include="IndexRange" Version="1.0.0" PrivateAssets="all" />
<PackageReference Include="Nullable" Version="1.3.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="6.0.0" />
<Content Include="buildTransitive\Verify.props" PackagePath="buildTransitive\Verify.props" />
<Content Include="buildTransitive\Verify.targets" PackagePath="buildTransitive\Verify.targets" />
<Content Include="buildTransitive\Verify.props" PackagePath="build\Verify.props" />
Expand Down

0 comments on commit 5dc6df8

Please sign in to comment.