-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace Specflow.Internal.Json with System.Text.Json (#373)
* Replace Specflow.Internal.Json with System.Text.Json * ParserDriver: normalize line ending * MsBuild: Improve Logging when GeneratorContainerBuilder throws a exception * MsBuild: Ensure needed System.Text.Json dependencies are copied * Hide System.Runtime.Loader compile-time dependency * ParserDriver: correct line endings normalisation * Fix loading dependency when compiling from VS 17.8.3 * small fix in changelog * small cosmetic fixes --------- Co-authored-by: Gáspár Nagy <[email protected]>
- Loading branch information
1 parent
b58ffa2
commit dc1c3e4
Showing
55 changed files
with
14,382 additions
and
203 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
Reqnroll/Analytics/AppInsights/AppInsightsEventTelemetryJsonSourceGenerator.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Reqnroll.Analytics.AppInsights | ||
{ | ||
[JsonSourceGenerationOptions( | ||
PropertyNamingPolicy = JsonKnownNamingPolicy.Unspecified, // We specifiy the names explicitly | ||
UseStringEnumConverter = true)] // use strings instead of numbers for enums | ||
[JsonSerializable(typeof(AppInsightsEventTelemetry))] | ||
internal partial class AppInsightsEventTelemetryJsonSourceGenerator : JsonSerializerContext | ||
{ | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using Reqnroll.Bindings.Provider.Data; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Reqnroll.Bindings.Provider; | ||
|
||
[JsonSourceGenerationOptions( | ||
PropertyNamingPolicy = JsonKnownNamingPolicy.Unspecified, // We specifiy the names explicitly | ||
UseStringEnumConverter = true)] // use strings instead of numbers for enums | ||
[JsonSerializable(typeof(BindingData))] | ||
internal partial class BindingJsonSourceGenerator : JsonSerializerContext | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,12 @@ | ||
using System.Runtime.Serialization; | ||
|
||
//using Newtonsoft.Json; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Reqnroll.Configuration.JsonConfig | ||
{ | ||
// legacy config | ||
public class BindingCultureElement | ||
{ | ||
// legacy config | ||
//[JsonProperty("name", DefaultValueHandling = DefaultValueHandling.Populate, NullValueHandling = NullValueHandling.Ignore)] | ||
[DataMember(Name="name")] | ||
[JsonPropertyName("name")] | ||
public string Name { get; set; } | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
Reqnroll/Configuration/JsonConfig/CustomTimeSpanConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
using System.Globalization; | ||
using System.Text.Json; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Reqnroll.Configuration.JsonConfig | ||
{ | ||
/// <summary> | ||
/// Custom <see cref="TimeSpan"/> converter to stay compatible with old json format/parser | ||
/// </summary> | ||
sealed class CustomTimeSpanConverter : JsonConverter<TimeSpan> | ||
{ | ||
public override TimeSpan Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) | ||
{ | ||
var content = reader.GetString(); | ||
return TimeSpan.Parse(content, CultureInfo.InvariantCulture); | ||
} | ||
public override void Write(Utf8JsonWriter writer, TimeSpan value, JsonSerializerOptions options) | ||
{ | ||
var content = value.ToString(null, CultureInfo.InvariantCulture); | ||
writer.WriteStringValue(content); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
using System.Runtime.Serialization; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Reqnroll.Configuration.JsonConfig | ||
{ | ||
public class Dependency | ||
{ | ||
[DataMember(Name = "type")] | ||
[JsonPropertyName("type")] | ||
public string ImplementationType { get; set; } | ||
[DataMember(Name = "as")] | ||
[JsonPropertyName("as")] | ||
public string InterfaceType { get; set; } | ||
[DataMember(Name = "name")] | ||
[JsonPropertyName("name")] | ||
public string Name { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,17 @@ | ||
using System.Collections.Generic; | ||
using System.ComponentModel; | ||
using System.Runtime.Serialization; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Reqnroll.Configuration.JsonConfig | ||
{ | ||
public class GeneratorElement | ||
{ | ||
//[JsonProperty("allowDebugGeneratedFiles", DefaultValueHandling = DefaultValueHandling.Populate, NullValueHandling = NullValueHandling.Ignore)] | ||
[DataMember(Name = "allowDebugGeneratedFiles")] | ||
[DefaultValue(ConfigDefaults.AllowDebugGeneratedFiles)] | ||
public bool AllowDebugGeneratedFiles { get; set; } | ||
[JsonPropertyName("allowDebugGeneratedFiles")] | ||
public bool AllowDebugGeneratedFiles { get; set; } = ConfigDefaults.AllowDebugGeneratedFiles; | ||
|
||
//[JsonProperty("allowRowTests", DefaultValueHandling = DefaultValueHandling.Populate, NullValueHandling = NullValueHandling.Ignore)] | ||
[DefaultValue(ConfigDefaults.AllowRowTests)] | ||
[DataMember(Name = "allowRowTests")] | ||
public bool AllowRowTests { get; set; } | ||
[JsonPropertyName("allowRowTests")] | ||
public bool AllowRowTests { get; set; } = ConfigDefaults.AllowRowTests; | ||
|
||
//[JsonProperty("addNonParallelizableMarkerForTags", NullValueHandling = NullValueHandling.Ignore)] | ||
[DataMember(Name = "addNonParallelizableMarkerForTags")] | ||
[JsonPropertyName("addNonParallelizableMarkerForTags")] | ||
public List<string> AddNonParallelizableMarkerForTags { get; set; } | ||
} | ||
} |
Oops, something went wrong.