From 1805d5c6002fd4cbd8536f3fc8925eeed09e2e69 Mon Sep 17 00:00:00 2001 From: Marko Lahma Date: Mon, 30 Oct 2023 17:27:30 +0200 Subject: [PATCH] Convert to use Central Package Management (#1639) --- src/Directory.Build.props | 2 +- src/Directory.Packages.props | 26 +++++++++++++++++++ .../NJsonSchema.Benchmark.csproj | 14 +++++----- .../InheritanceTests.cs | 2 +- ...nSchema.CodeGeneration.CSharp.Tests.csproj | 12 ++++----- .../InheritanceSerializationTests.cs | 4 +-- .../NJsonSchema.CodeGeneration.Tests.csproj | 12 ++++----- .../Samples/SampleTests.cs | 4 +-- .../InheritanceTests.cs | 2 +- ...ema.CodeGeneration.TypeScript.Tests.csproj | 14 +++++----- .../NJsonSchema.CodeGeneration.csproj | 4 +-- .../NJsonSchema.NewtonsoftJson.Tests.csproj | 10 +++---- .../NJsonSchema.NewtonsoftJson.csproj | 4 +-- .../NJsonSchema.Tests.csproj | 10 +++---- .../NJsonSchema.Yaml.Tests.csproj | 12 ++++----- src/NJsonSchema.Yaml/NJsonSchema.Yaml.csproj | 4 +-- src/NJsonSchema.sln | 1 + src/NJsonSchema/NJsonSchema.csproj | 8 +++--- 18 files changed, 86 insertions(+), 59 deletions(-) create mode 100644 src/Directory.Packages.props diff --git a/src/Directory.Build.props b/src/Directory.Build.props index c715be50b..df00f906a 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -26,7 +26,7 @@ - + diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props new file mode 100644 index 000000000..efaed81be --- /dev/null +++ b/src/Directory.Packages.props @@ -0,0 +1,26 @@ + + + true + false + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/NJsonSchema.Benchmark/NJsonSchema.Benchmark.csproj b/src/NJsonSchema.Benchmark/NJsonSchema.Benchmark.csproj index dcd071859..03c3ba1c7 100644 --- a/src/NJsonSchema.Benchmark/NJsonSchema.Benchmark.csproj +++ b/src/NJsonSchema.Benchmark/NJsonSchema.Benchmark.csproj @@ -1,4 +1,4 @@ - + net6.0 @@ -13,12 +13,12 @@ - - - - - - + + + + + + diff --git a/src/NJsonSchema.CodeGeneration.CSharp.Tests/InheritanceTests.cs b/src/NJsonSchema.CodeGeneration.CSharp.Tests/InheritanceTests.cs index 6d3118ca1..ac9c4e67e 100644 --- a/src/NJsonSchema.CodeGeneration.CSharp.Tests/InheritanceTests.cs +++ b/src/NJsonSchema.CodeGeneration.CSharp.Tests/InheritanceTests.cs @@ -41,7 +41,7 @@ public async Task When_empty_class_inherits_from_dictionary_then_allOf_inheritan //// Assert var dictionarySchema = schema.Definitions["EmptyClassInheritingDictionary"]; - Assert.Equal(0, dictionarySchema.AllOf.Count); + Assert.Empty(dictionarySchema.AllOf); Assert.True(dictionarySchema.IsDictionary); Assert.Contains("Foobar.", data); Assert.Contains("Foobar.", code); diff --git a/src/NJsonSchema.CodeGeneration.CSharp.Tests/NJsonSchema.CodeGeneration.CSharp.Tests.csproj b/src/NJsonSchema.CodeGeneration.CSharp.Tests/NJsonSchema.CodeGeneration.CSharp.Tests.csproj index 91e7723c3..a346f6fac 100644 --- a/src/NJsonSchema.CodeGeneration.CSharp.Tests/NJsonSchema.CodeGeneration.CSharp.Tests.csproj +++ b/src/NJsonSchema.CodeGeneration.CSharp.Tests/NJsonSchema.CodeGeneration.CSharp.Tests.csproj @@ -1,4 +1,4 @@ - + net6.0 @@ -13,11 +13,11 @@ - - - - - + + + + + diff --git a/src/NJsonSchema.CodeGeneration.Tests/InheritanceSerializationTests.cs b/src/NJsonSchema.CodeGeneration.Tests/InheritanceSerializationTests.cs index 13e7e0c32..f93750e43 100644 --- a/src/NJsonSchema.CodeGeneration.Tests/InheritanceSerializationTests.cs +++ b/src/NJsonSchema.CodeGeneration.Tests/InheritanceSerializationTests.cs @@ -183,7 +183,7 @@ public async Task When_dates_are_converted_then_JsonInheritanceConverter_should_ } [Fact] - public void JsonInheritanceConverter_is_thread_safe() + public async Task JsonInheritanceConverter_is_thread_safe() { //// Arrange var tasks = new List(); @@ -196,7 +196,7 @@ public void JsonInheritanceConverter_is_thread_safe() } //// Act - Task.WaitAll(tasks.ToArray()); + await Task.WhenAll(tasks.ToArray()); //// Assert // No exceptions diff --git a/src/NJsonSchema.CodeGeneration.Tests/NJsonSchema.CodeGeneration.Tests.csproj b/src/NJsonSchema.CodeGeneration.Tests/NJsonSchema.CodeGeneration.Tests.csproj index a688110fd..d14f06a1d 100644 --- a/src/NJsonSchema.CodeGeneration.Tests/NJsonSchema.CodeGeneration.Tests.csproj +++ b/src/NJsonSchema.CodeGeneration.Tests/NJsonSchema.CodeGeneration.Tests.csproj @@ -1,4 +1,4 @@ - + net6.0;net462 @@ -8,11 +8,11 @@ - - - - - + + + + + diff --git a/src/NJsonSchema.CodeGeneration.Tests/Samples/SampleTests.cs b/src/NJsonSchema.CodeGeneration.Tests/Samples/SampleTests.cs index 24cb2810e..bca904162 100644 --- a/src/NJsonSchema.CodeGeneration.Tests/Samples/SampleTests.cs +++ b/src/NJsonSchema.CodeGeneration.Tests/Samples/SampleTests.cs @@ -101,7 +101,7 @@ public async Task When_JSON_contains_DateTime_is_available_then_string_validator var errors = schema.Validate(dataJson); //// Assert - Assert.Equal(0, errors.Count); + Assert.Empty(errors); } [Fact] @@ -135,7 +135,7 @@ public async Task When_JSON_contains_DateTime_is_available_then_JObject_validato var errors = schema.Validate(data); //// Assert - Assert.Equal(0, errors.Count); + Assert.Empty(errors); } } } diff --git a/src/NJsonSchema.CodeGeneration.TypeScript.Tests/InheritanceTests.cs b/src/NJsonSchema.CodeGeneration.TypeScript.Tests/InheritanceTests.cs index 531ffde21..63cc0ef12 100644 --- a/src/NJsonSchema.CodeGeneration.TypeScript.Tests/InheritanceTests.cs +++ b/src/NJsonSchema.CodeGeneration.TypeScript.Tests/InheritanceTests.cs @@ -51,7 +51,7 @@ public async Task When_empty_class_inherits_from_dictionary_then_allOf_inheritan //// Assert var dschema = schema.Definitions["EmptyClassInheritingDictionary"]; - Assert.Equal(0, dschema.AllOf.Count); + Assert.Empty(dschema.AllOf); Assert.True(dschema.IsDictionary); if (inlineNamedDictionaries) diff --git a/src/NJsonSchema.CodeGeneration.TypeScript.Tests/NJsonSchema.CodeGeneration.TypeScript.Tests.csproj b/src/NJsonSchema.CodeGeneration.TypeScript.Tests/NJsonSchema.CodeGeneration.TypeScript.Tests.csproj index 7deab23d1..34a29162b 100644 --- a/src/NJsonSchema.CodeGeneration.TypeScript.Tests/NJsonSchema.CodeGeneration.TypeScript.Tests.csproj +++ b/src/NJsonSchema.CodeGeneration.TypeScript.Tests/NJsonSchema.CodeGeneration.TypeScript.Tests.csproj @@ -1,4 +1,4 @@ - + net6.0;net462 @@ -9,12 +9,12 @@ - - - - - - + + + + + + diff --git a/src/NJsonSchema.CodeGeneration/NJsonSchema.CodeGeneration.csproj b/src/NJsonSchema.CodeGeneration/NJsonSchema.CodeGeneration.csproj index 2dc68ee87..b653ffa10 100644 --- a/src/NJsonSchema.CodeGeneration/NJsonSchema.CodeGeneration.csproj +++ b/src/NJsonSchema.CodeGeneration/NJsonSchema.CodeGeneration.csproj @@ -1,4 +1,4 @@ - + netstandard2.0;net462 @@ -9,7 +9,7 @@ - + diff --git a/src/NJsonSchema.NewtonsoftJson.Tests/NJsonSchema.NewtonsoftJson.Tests.csproj b/src/NJsonSchema.NewtonsoftJson.Tests/NJsonSchema.NewtonsoftJson.Tests.csproj index 822b53a07..a16e59d21 100644 --- a/src/NJsonSchema.NewtonsoftJson.Tests/NJsonSchema.NewtonsoftJson.Tests.csproj +++ b/src/NJsonSchema.NewtonsoftJson.Tests/NJsonSchema.NewtonsoftJson.Tests.csproj @@ -1,4 +1,4 @@ - + net6.0;net462 @@ -17,10 +17,10 @@ - - - - + + + + diff --git a/src/NJsonSchema.NewtonsoftJson/NJsonSchema.NewtonsoftJson.csproj b/src/NJsonSchema.NewtonsoftJson/NJsonSchema.NewtonsoftJson.csproj index 5d78c326f..551c9f534 100644 --- a/src/NJsonSchema.NewtonsoftJson/NJsonSchema.NewtonsoftJson.csproj +++ b/src/NJsonSchema.NewtonsoftJson/NJsonSchema.NewtonsoftJson.csproj @@ -1,4 +1,4 @@ - + netstandard2.0;net462 @@ -6,7 +6,7 @@ - + diff --git a/src/NJsonSchema.Tests/NJsonSchema.Tests.csproj b/src/NJsonSchema.Tests/NJsonSchema.Tests.csproj index 68985ba59..3c743105d 100644 --- a/src/NJsonSchema.Tests/NJsonSchema.Tests.csproj +++ b/src/NJsonSchema.Tests/NJsonSchema.Tests.csproj @@ -1,4 +1,4 @@ - + net7.0;net462 @@ -17,10 +17,10 @@ - - - - + + + + diff --git a/src/NJsonSchema.Yaml.Tests/NJsonSchema.Yaml.Tests.csproj b/src/NJsonSchema.Yaml.Tests/NJsonSchema.Yaml.Tests.csproj index 24f1b54ff..c7dbe8cef 100644 --- a/src/NJsonSchema.Yaml.Tests/NJsonSchema.Yaml.Tests.csproj +++ b/src/NJsonSchema.Yaml.Tests/NJsonSchema.Yaml.Tests.csproj @@ -1,4 +1,4 @@ - + net6.0;net462 @@ -8,12 +8,12 @@ - - - - + + + + - + diff --git a/src/NJsonSchema.Yaml/NJsonSchema.Yaml.csproj b/src/NJsonSchema.Yaml/NJsonSchema.Yaml.csproj index 48e29b609..d50b3ca29 100644 --- a/src/NJsonSchema.Yaml/NJsonSchema.Yaml.csproj +++ b/src/NJsonSchema.Yaml/NJsonSchema.Yaml.csproj @@ -1,4 +1,4 @@ - + netstandard2.0;net462 @@ -9,7 +9,7 @@ - + diff --git a/src/NJsonSchema.sln b/src/NJsonSchema.sln index d1c616ac1..da8a1cf59 100644 --- a/src/NJsonSchema.sln +++ b/src/NJsonSchema.sln @@ -33,6 +33,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "00 Build", "00 Build", "{86 ProjectSection(SolutionItems) = preProject Directory.Build.props = Directory.Build.props ..\README.md = ..\README.md + Directory.Packages.props = Directory.Packages.props EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "_build", "..\build\_build.csproj", "{8E4E5A64-B5B7-4718-A92F-CB6B08512264}" diff --git a/src/NJsonSchema/NJsonSchema.csproj b/src/NJsonSchema/NJsonSchema.csproj index 420528355..e71dacd3c 100644 --- a/src/NJsonSchema/NJsonSchema.csproj +++ b/src/NJsonSchema/NJsonSchema.csproj @@ -1,4 +1,4 @@ - + net6.0;netstandard2.0;net462 @@ -9,12 +9,12 @@ - - + + - +