Skip to content

Commit

Permalink
Merge pull request #675 from SteveDunn/remove-unsupported-frameworks-…
Browse files Browse the repository at this point in the history
…from-snapshot-tests

Remove unsupported frameworks from the tests
  • Loading branch information
SteveDunn authored Sep 26, 2024
2 parents d9653d0 + 1e80155 commit 3decd94
Show file tree
Hide file tree
Showing 17,326 changed files with 850 additions and 9,015,743 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
21 changes: 1 addition & 20 deletions src/Vogen/Templates/DateOnly/DateOnly_SystemTextJsonConverter.cs
Original file line number Diff line number Diff line change
@@ -1,23 +1,4 @@
#if NET7_0_OR_GREATER_DO_NOT_USE
/// <summary>
/// Converts a VOTYPE to or from JSON.
/// </summary>
public class VOTYPESystemTextJsonConverter : global::System.Text.Json.Serialization.JsonConverter<VOTYPE>
{
__HANDLE_NULL__ #if NET5_0_OR_GREATER
__HANDLE_NULL__ public override bool HandleNull => true;
__HANDLE_NULL__ #endif
public override VOTYPE Read(ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options)
{
return VOTYPE.__Deserialize(reader.GetDateOnly());
}

public override void Write(System.Text.Json.Utf8JsonWriter writer, VOTYPE value, global::System.Text.Json.JsonSerializerOptions options)
{
writer.WriteStringValue(value.Value);
}
}
#elif NET6_0_OR_GREATER
#if NET6_0_OR_GREATER
/// <summary>
/// Converts a VOTYPE to or from JSON.
/// </summary>
Expand Down
21 changes: 1 addition & 20 deletions src/Vogen/Templates/TimeOnly/TimeOnly_SystemTextJsonConverter.cs
Original file line number Diff line number Diff line change
@@ -1,23 +1,4 @@
#if NET7_0_OR_GREATER_DO_NOT_USE // as of .NET 7, STJ doesn't seem to have a `GetTimeOnly` method
/// <summary>
/// Converts a VOTYPE to or from JSON.
/// </summary>
public class VOTYPESystemTextJsonConverter : global::System.Text.Json.Serialization.JsonConverter<VOTYPE>
{
__HANDLE_NULL__ #if NET5_0_OR_GREATER
__HANDLE_NULL__ public override bool HandleNull => true;
__HANDLE_NULL__ #endif
public override VOTYPE Read(ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options)
{
return VOTYPE.__Deserialize(reader.GetTimeOnly());
}

public override void Write(System.Text.Json.Utf8JsonWriter writer, VOTYPE value, global::System.Text.Json.JsonSerializerOptions options)
{
writer.WriteStringValue(value.Value);
}
}
#elif NET6_0_OR_GREATER
#if NET6_0_OR_GREATER
/// <summary>
/// Converts a VOTYPE to or from JSON.
/// </summary>
Expand Down
37 changes: 1 addition & 36 deletions tests/Shared/ProjectBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,25 +126,6 @@ private void AddNuGetReferences()

switch (_targetFramework)
{
case TargetFramework.NetCoreApp3_1:
AddNuGetReference("Microsoft.NETCore.App.Ref", "3.1.0", "ref/netcoreapp3.1/");
AddNuGetReference("linq2db", "3.7.0", "lib/netcoreapp3.1/");
AddNuGetReference("Microsoft.EntityFrameworkCore", "5.0.17", "lib/netstandard2.1/");
AddNuGetReference("Dapper", "1.60.6", "lib/netstandard2.0/");
AddNuGetReference("ServiceStack.Text", "5.14.0", "lib/netstandard2.0");
break;

case TargetFramework.Net4_6_1:
AddNuGetReference("Microsoft.NETFramework.ReferenceAssemblies.net461", "1.0.0", "build/.NETFramework/v4.6.1/");
AddNuGetReference("NETStandard.Library", "2.0.3", "build/netstandard2.0/ref/");
AddNuGetReference("linq2db", "3.0.0", "lib/net46/");
AddNuGetReference("Microsoft.EntityFrameworkCore", "3.1.31", "lib/netstandard2.0/");
AddNuGetReference("Dapper", "2.0.123", "lib/net461/");
AddStjIfNeeded("8.0.0", "lib/net462/");
AddNuGetReference("System.Memory", "4.5.5", "lib/net461/");
AddNuGetReference("ServiceStack.Text", "4.0.62", "lib/net40");
break;

case TargetFramework.Net4_8:
AddNuGetReference("Microsoft.NETFramework.ReferenceAssemblies.net48", "1.0.0", "build/.NETFramework/v4.8/");
AddNuGetReference("linq2db", "3.7.0", "lib/netstandard2.1/");
Expand All @@ -155,14 +136,6 @@ private void AddNuGetReferences()
AddNuGetReference("ServiceStack.Text", "6.11.0", "lib/netstandard2.0");
break;

case TargetFramework.Net5_0:
AddNuGetReference("Microsoft.NETCore.App.Ref", "5.0.0", "ref/net5.0/");
AddNuGetReference("linq2db", "3.7.0", "lib/netstandard2.1/");
AddNuGetReference("Microsoft.EntityFrameworkCore", "5.0.17", "lib/netstandard2.1/");
AddNuGetReference("Dapper", "2.0.123", "lib/net5.0/");
AddNuGetReference("ServiceStack.Text", "5.5.0", "lib/netstandard2.0");
break;

case TargetFramework.Net6_0:
AddNuGetReference("Microsoft.NETCore.App.Ref", "6.0.0", "ref/net6.0/");
AddNuGetReference("linq2db", "3.7.0", "lib/netstandard2.1/");
Expand All @@ -171,14 +144,6 @@ private void AddNuGetReferences()
AddNuGetReference("ServiceStack.Text", "6.11.0", "lib/net6.0");
break;

case TargetFramework.Net7_0:
AddNuGetReference("Microsoft.NETCore.App.Ref", "7.0.0", "ref/net7.0/");
AddNuGetReference("linq2db", "4.3.0", "lib/net6.0/");
AddNuGetReference("Microsoft.EntityFrameworkCore", "7.0.0", "lib/net6.0/");
AddNuGetReference("Dapper", "2.0.123", "lib/net5.0/");
AddNuGetReference("ServiceStack.Text", "6.11.0", "lib/net6.0");
break;

case TargetFramework.Net8_0:
AddNuGetReference("Microsoft.NETCore.App.Ref", "8.0.0", "ref/net8.0/");
AddNuGetReference("linq2db", "4.3.0", "lib/net6.0/");
Expand All @@ -199,7 +164,7 @@ private void AddNuGetReferences()

AddNuGetReference("System.Collections.Immutable", "1.5.0", "lib/netstandard2.0/");

if (_targetFramework is not TargetFramework.Net7_0 and not TargetFramework.Net8_0)
if (_targetFramework is not TargetFramework.Net8_0)
{
AddNuGetReference("System.Numerics.Vectors", "4.5.0", "ref/netstandard2.0/");
}
Expand Down
10 changes: 1 addition & 9 deletions tests/Shared/TargetFramework.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,10 @@
{
public enum TargetFramework
{
// NetStandard2_0,
// NetStandard2_1,
NetCoreApp3_1,
Net4_6_1,
Net4_8,
Net5_0,
Net6_0,
Net7_0,
Net8_0,
AspNetCore5_0,
AspNetCore6_0,
AspNetCore8_0,
WindowsDesktop5_0,
Latest = Net8_0,
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ public partial struct Vo
.WithSource(source)
.ExcludeSystemTextJsonNugetPackage()
.IgnoreInitialCompilationErrors()
.RunOn(TargetFramework.Net4_6_1);
.RunOn(TargetFramework.Net4_8);
}
}
Loading

0 comments on commit 3decd94

Please sign in to comment.