From 948ef187fd0130ae01576ebc5b78bc244a3110e9 Mon Sep 17 00:00:00 2001 From: Pearl Null Date: Sun, 5 May 2024 20:10:27 -0400 Subject: [PATCH 1/4] Add target for netstandard2.0 to C# projects --- src/Testura.Code.Tests/Testura.Code.Tests.csproj | 2 +- src/Testura.Code/Testura.Code.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Testura.Code.Tests/Testura.Code.Tests.csproj b/src/Testura.Code.Tests/Testura.Code.Tests.csproj index e64efb7..46cff04 100644 --- a/src/Testura.Code.Tests/Testura.Code.Tests.csproj +++ b/src/Testura.Code.Tests/Testura.Code.Tests.csproj @@ -1,7 +1,7 @@ - net6.0;net7 + netstandard2.0;net6.0;net7 enable false diff --git a/src/Testura.Code/Testura.Code.csproj b/src/Testura.Code/Testura.Code.csproj index 12cf0f1..abbf7ad 100644 --- a/src/Testura.Code/Testura.Code.csproj +++ b/src/Testura.Code/Testura.Code.csproj @@ -1,7 +1,7 @@ - net6.0;net7 + netstandard2.0;net6.0;net7 enable enable true From 6f9a07b32431f43af6425226b44ce39bbdc2460a Mon Sep 17 00:00:00 2001 From: Pearl Null Date: Sun, 5 May 2024 20:33:18 -0400 Subject: [PATCH 2/4] Add reference to PolySharp to polyfill classes not available in netstandard2.0 --- src/Testura.Code/Testura.Code.csproj | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Testura.Code/Testura.Code.csproj b/src/Testura.Code/Testura.Code.csproj index abbf7ad..e3ead22 100644 --- a/src/Testura.Code/Testura.Code.csproj +++ b/src/Testura.Code/Testura.Code.csproj @@ -42,6 +42,10 @@ + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + From d4f53f5f9d75c8861211956c6003ee0bbbc21b18 Mon Sep 17 00:00:00 2001 From: Pearl Null Date: Sun, 5 May 2024 20:34:02 -0400 Subject: [PATCH 3/4] Fix for netstandard2.0 requiring KeyValuePair<,>.Deconstruct, which is not available in netstandard2.0 --- .../Arguments/ArgumentTypes/ObjectInitializationArgument.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Testura.Code/Generators/Common/Arguments/ArgumentTypes/ObjectInitializationArgument.cs b/src/Testura.Code/Generators/Common/Arguments/ArgumentTypes/ObjectInitializationArgument.cs index 2789dd8..9035488 100644 --- a/src/Testura.Code/Generators/Common/Arguments/ArgumentTypes/ObjectInitializationArgument.cs +++ b/src/Testura.Code/Generators/Common/Arguments/ArgumentTypes/ObjectInitializationArgument.cs @@ -30,8 +30,11 @@ public ObjectInitializationArgument(Type type, IDictionary di protected override ArgumentSyntax CreateArgumentSyntax() { var syntaxNodeOrTokens = new List(); - foreach (var (key, value) in _dictionary) + foreach (var pair in _dictionary) { + var key = pair.Key; + var value = pair.Value; + syntaxNodeOrTokens.Add( AssignmentExpression( SyntaxKind.SimpleAssignmentExpression, From 9da545d112114fb5d8c69e2e1e631d1a810cc232 Mon Sep 17 00:00:00 2001 From: Pearl Null Date: Sun, 5 May 2024 21:03:10 -0400 Subject: [PATCH 4/4] Change target of test project from `netstandard2.0` to `netcoreapp3.1` to build test project against new `Testura.Code` target framework --- src/Testura.Code.Tests/Testura.Code.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Testura.Code.Tests/Testura.Code.Tests.csproj b/src/Testura.Code.Tests/Testura.Code.Tests.csproj index 46cff04..13e88b4 100644 --- a/src/Testura.Code.Tests/Testura.Code.Tests.csproj +++ b/src/Testura.Code.Tests/Testura.Code.Tests.csproj @@ -1,7 +1,7 @@ - netstandard2.0;net6.0;net7 + netcoreapp3.1;net6.0;net7 enable false