diff --git a/.editorconfig b/.editorconfig index e63069d8..8e2da5d3 100644 --- a/.editorconfig +++ b/.editorconfig @@ -523,3 +523,5 @@ dotnet_naming_rule.parameters_rule.severity = warning # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR # OTHER DEALINGS IN THE SOFTWARE. ########################################## + +dotnet_style_require_accessibility_modifiers = for_non_interface_members \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5d91e28e..92c4a397 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,10 +33,12 @@ jobs: with: lfs: true fetch-depth: 0 - - name: "Install .NET 8.0 SDK" + - name: "Setup dotnet" uses: actions/setup-dotnet@v5.0.0 with: - dotnet-version: 8.0.x + dotnet-version: | + 8.0.x + 10.0.x - name: "Dotnet Tool Restore" run: dotnet tool restore shell: pwsh @@ -84,6 +86,7 @@ jobs: url: https://github.com/TimmyMC/Schema.NET/packages permissions: packages: write + id-token: write runs-on: windows-latest steps: - name: "Download Artefact" @@ -110,9 +113,14 @@ jobs: uses: actions/download-artifact@v6.0.0 with: name: "windows-latest" + - name: NuGet login (OIDC → temp API key) + uses: NuGet/login@v1 + id: login + with: + user: "TimmyMC" - name: "Dotnet NuGet Push" run: | Get-ChildItem .\ -Filter *.nupkg | Where-Object { !$_.Name.Contains('preview') } | - ForEach-Object { dotnet nuget push $_ --source https://api.nuget.org/v3/index.json --skip-duplicate --api-key ${{secrets.NUGET_API_KEY}} } + ForEach-Object { dotnet nuget push $_ --source https://api.nuget.org/v3/index.json --skip-duplicate --api-key ${{ steps.login.outputs.NUGET_API_KEY }} } shell: pwsh diff --git a/Benchmarks/Schema.NET.Benchmarks/Schema.NET.Benchmarks.csproj b/Benchmarks/Schema.NET.Benchmarks/Schema.NET.Benchmarks.csproj index deff4ff7..852f3394 100644 --- a/Benchmarks/Schema.NET.Benchmarks/Schema.NET.Benchmarks.csproj +++ b/Benchmarks/Schema.NET.Benchmarks/Schema.NET.Benchmarks.csproj @@ -2,9 +2,8 @@ Exe - net8.0;net48 + net10.0;net8.0 false - true diff --git a/Benchmarks/Schema.NET.Benchmarks/SchemaBenchmarkBase.cs b/Benchmarks/Schema.NET.Benchmarks/SchemaBenchmarkBase.cs index 78887f0c..cd2ccc7a 100644 --- a/Benchmarks/Schema.NET.Benchmarks/SchemaBenchmarkBase.cs +++ b/Benchmarks/Schema.NET.Benchmarks/SchemaBenchmarkBase.cs @@ -13,7 +13,7 @@ namespace Schema.NET.Benchmarks; [CsvMeasurementsExporter] [RPlotExporter] [SimpleJob(RuntimeMoniker.Net80)] -[SimpleJob(RuntimeMoniker.Net48)] +[SimpleJob(RuntimeMoniker.Net10_0)] public abstract class SchemaBenchmarkBase { public Thing Thing { get; set; } = default!; diff --git a/Benchmarks/Schema.NET.Benchmarks/packages.lock.json b/Benchmarks/Schema.NET.Benchmarks/packages.lock.json index 5ca9753d..3d71a0ae 100644 --- a/Benchmarks/Schema.NET.Benchmarks/packages.lock.json +++ b/Benchmarks/Schema.NET.Benchmarks/packages.lock.json @@ -1,7 +1,7 @@ { "version": 1, "dependencies": { - ".NETFramework,Version=v4.8": { + "net10.0": { "BenchmarkDotNet": { "type": "Direct", "requested": "[0.15.6, )", @@ -16,32 +16,15 @@ "Microsoft.Diagnostics.Runtime": "3.1.512801", "Microsoft.Diagnostics.Tracing.TraceEvent": "3.1.21", "Microsoft.DotNet.PlatformAbstractions": "3.1.6", - "Microsoft.Win32.Registry": "5.0.0", "Perfolizer": "[0.6.0]", - "System.Management": "9.0.5", - "System.Numerics.Vectors": "4.5.0", - "System.Reflection.Emit": "4.7.0", - "System.Reflection.Emit.Lightweight": "4.7.0", - "System.Threading.Tasks.Extensions": "4.6.3" + "System.Management": "9.0.5" } }, - "Microsoft.CodeAnalysis.NetAnalyzers": { - "type": "Direct", - "requested": "[8.0.0, )", - "resolved": "8.0.0", - "contentHash": "DxiTgkCl3CGq1rYmBX2wjY7XGbxiBdL4J+/AJIAFLKy5z70NxhnVRnPghnicXZ8oF6JKVXlW3xwznRbI3ioEKg==" - }, - "Microsoft.VisualStudio.Threading.Analyzers": { - "type": "Direct", - "requested": "[17.12.19, )", - "resolved": "17.12.19", - "contentHash": "v3IYeedjoktvZ+GqYmLudxZJngmf/YWIxNT2Uy6QMMN19cvw+nkWoip1Gr1RtnFkUo1MPUVMis4C8Kj8d8DpSQ==" - }, "MinVer": { "type": "Direct", - "requested": "[4.3.0, )", - "resolved": "4.3.0", - "contentHash": "YNVAW3loCFW4kTwensApaZUl+7xREK75QQNOFSbsbXx2sCSm9/IHBjUHsJGn3u0UA5r/sAqrdYBNUlOFfLhUrA==" + "requested": "[6.0.0, )", + "resolved": "6.0.0", + "contentHash": "+/SsmiySsXJlvQLCGBqaZKNVt3s/Y/HbAdwtop7Km2CnuZbaScoqkWJEBQ5Cy9ebkn6kCYKrHsXgwrFdTgcb3g==" }, "BenchmarkDotNet.Annotations": { "type": "Transitive", @@ -53,6 +36,11 @@ "resolved": "2.9.1", "contentHash": "OE0sl1/sQ37bjVsPKKtwQlWDgqaxWgtme3xZz7JssWUzg5JpMIyHgCTY9MVMxOg48fJ1AgGT3tgdH5m/kQ5xhA==" }, + "DotNet.ReproducibleBuilds": { + "type": "Transitive", + "resolved": "1.2.39", + "contentHash": "fcFN01tDTIQqDuTwr1jUQK/geofiwjG5DycJQOnC72i1SsLAk1ELe+apBOuZ11UMQG8YKFZG1FgvjZPbqHyatg==" + }, "Gee.External.Capstone": { "type": "Transitive", "resolved": "2.3.0", @@ -63,14 +51,6 @@ "resolved": "1.21.0", "contentHash": "dv5+81Q1TBQvVMSOOOmRcjJmvWcX3BZPZsIq31+RLc5cNft0IHAyNlkdb7ZarOWG913PyBoFDsDXoCIlKmLclg==" }, - "Microsoft.Bcl.AsyncInterfaces": { - "type": "Transitive", - "resolved": "10.0.0", - "contentHash": "vFuwSLj9QJBbNR0NeNO4YVASUbokxs+i/xbuu8B+Fs4FAZg5QaFa6eGrMaRqTzzNI5tAb97T7BhSxtLckFyiRA==", - "dependencies": { - "System.Threading.Tasks.Extensions": "4.6.3" - } - }, "Microsoft.CodeAnalysis.Analyzers": { "type": "Transitive", "resolved": "3.11.0", @@ -82,14 +62,8 @@ "contentHash": "PC3tuwZYnC+idaPuoC/AZpEdwrtX7qFpmnrfQkgobGIWiYmGi5MCRtl5mx6QrfMGQpK78X2lfIEoZDLg/qnuHg==", "dependencies": { "Microsoft.CodeAnalysis.Analyzers": "3.11.0", - "System.Buffers": "4.5.1", "System.Collections.Immutable": "9.0.0", - "System.Memory": "4.5.5", - "System.Numerics.Vectors": "4.5.0", - "System.Reflection.Metadata": "9.0.0", - "System.Runtime.CompilerServices.Unsafe": "6.0.0", - "System.Text.Encoding.CodePages": "7.0.0", - "System.Threading.Tasks.Extensions": "4.5.4" + "System.Reflection.Metadata": "9.0.0" } }, "Microsoft.CodeAnalysis.CSharp": { @@ -99,14 +73,8 @@ "dependencies": { "Microsoft.CodeAnalysis.Analyzers": "3.11.0", "Microsoft.CodeAnalysis.Common": "[4.14.0]", - "System.Buffers": "4.5.1", "System.Collections.Immutable": "9.0.0", - "System.Memory": "4.5.5", - "System.Numerics.Vectors": "4.5.0", - "System.Reflection.Metadata": "9.0.0", - "System.Runtime.CompilerServices.Unsafe": "6.0.0", - "System.Text.Encoding.CodePages": "7.0.0", - "System.Threading.Tasks.Extensions": "4.5.4" + "System.Reflection.Metadata": "9.0.0" } }, "Microsoft.Diagnostics.NETCore.Client": { @@ -114,9 +82,7 @@ "resolved": "0.2.510501", "contentHash": "juoqJYMDs+lRrrZyOkXXMImJHneCF23cuvO4waFRd2Ds7j+ZuGIPbJm0Y/zz34BdeaGiiwGWraMUlln05W1PCQ==", "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "6.0.0", - "Microsoft.Extensions.Logging": "6.0.0", - "System.Buffers": "4.5.1" + "Microsoft.Extensions.Logging": "6.0.0" } }, "Microsoft.Diagnostics.Runtime": { @@ -124,9 +90,7 @@ "resolved": "3.1.512801", "contentHash": "0lMUDr2oxNZa28D6NH5BuSQEe5T9tZziIkvkD44YkkCGQXPJqvFjLq5ZQq1hYLl3RjQJrY+hR0jFgap+EWPDTw==", "dependencies": { - "Microsoft.Diagnostics.NETCore.Client": "0.2.410101", - "System.Collections.Immutable": "6.0.0", - "System.Runtime.CompilerServices.Unsafe": "6.0.0" + "Microsoft.Diagnostics.NETCore.Client": "0.2.410101" } }, "Microsoft.Diagnostics.Tracing.TraceEvent": { @@ -146,53 +110,38 @@ "Microsoft.DotNet.PlatformAbstractions": { "type": "Transitive", "resolved": "3.1.6", - "contentHash": "jek4XYaQ/PGUwDKKhwR8K47Uh1189PFzMeLqO83mXrXQVIpARZCcfuDedH50YDTepBkfijCZN5U/vZi++erxtg==", - "dependencies": { - "System.Runtime.InteropServices.RuntimeInformation": "4.0.0" - } + "contentHash": "jek4XYaQ/PGUwDKKhwR8K47Uh1189PFzMeLqO83mXrXQVIpARZCcfuDedH50YDTepBkfijCZN5U/vZi++erxtg==" }, "Microsoft.Extensions.DependencyInjection": { "type": "Transitive", "resolved": "6.0.0", "contentHash": "k6PWQMuoBDGGHOQTtyois2u4AwyVcIwL2LaSLlTZQm2CYcJ1pxbt6jfAnpWmzENA/wfrYRI/X9DTLoUkE4AsLw==", "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "6.0.0", "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", - "System.Runtime.CompilerServices.Unsafe": "6.0.0", - "System.Threading.Tasks.Extensions": "4.5.4" + "System.Runtime.CompilerServices.Unsafe": "6.0.0" } }, "Microsoft.Extensions.DependencyInjection.Abstractions": { "type": "Transitive", "resolved": "6.0.0", - "contentHash": "xlzi2IYREJH3/m6+lUrQlujzX8wDitm4QGnUu6kUXTQAWPuZY8i+ticFJbzfqaetLA6KR/rO6Ew/HuYD+bxifg==", - "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "6.0.0", - "System.Threading.Tasks.Extensions": "4.5.4" - } + "contentHash": "xlzi2IYREJH3/m6+lUrQlujzX8wDitm4QGnUu6kUXTQAWPuZY8i+ticFJbzfqaetLA6KR/rO6Ew/HuYD+bxifg==" }, "Microsoft.Extensions.Logging": { "type": "Transitive", "resolved": "6.0.0", "contentHash": "eIbyj40QDg1NDz0HBW0S5f3wrLVnKWnDJ/JtZ+yJDFnDj90VoPuoPmFkeaXrtu+0cKm5GRAwoDf+dBWXK0TUdg==", "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "6.0.0", "Microsoft.Extensions.DependencyInjection": "6.0.0", "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", "Microsoft.Extensions.Logging.Abstractions": "6.0.0", "Microsoft.Extensions.Options": "6.0.0", - "System.Diagnostics.DiagnosticSource": "6.0.0", - "System.ValueTuple": "4.5.0" + "System.Diagnostics.DiagnosticSource": "6.0.0" } }, "Microsoft.Extensions.Logging.Abstractions": { "type": "Transitive", "resolved": "6.0.0", - "contentHash": "/HggWBbTwy8TgebGSX5DBZ24ndhzi93sHUBDvP1IxbZD7FDokYzdAr6+vbWGjw2XAfR2EJ1sfKUotpjHnFWPxA==", - "dependencies": { - "System.Buffers": "4.5.1", - "System.Memory": "4.5.4" - } + "contentHash": "/HggWBbTwy8TgebGSX5DBZ24ndhzi93sHUBDvP1IxbZD7FDokYzdAr6+vbWGjw2XAfR2EJ1sfKUotpjHnFWPxA==" }, "Microsoft.Extensions.Options": { "type": "Transitive", @@ -208,10 +157,19 @@ "resolved": "6.0.0", "contentHash": "9+PnzmQFfEFNR9J2aDTfJGGupShHjOuGw4VUv+JB044biSHrnmCIMD+mJHmb2H7YryrfBEXDurxQ47gJZdCKNQ==", "dependencies": { - "System.Memory": "4.5.4", "System.Runtime.CompilerServices.Unsafe": "6.0.0" } }, + "Microsoft.NETCore.Platforms": { + "type": "Transitive", + "resolved": "5.0.0", + "contentHash": "VyPlqzH2wavqquTcYpkIIAQ6WdenuKoFN0BdYBbCWsclXacSOHNQn66Gt4z5NBqEYW0FAPm5rlvki9ZiCij5xQ==" + }, + "Microsoft.VisualStudio.Threading.Analyzers": { + "type": "Transitive", + "resolved": "17.14.15", + "contentHash": "mXQPJsbuUD2ydq4/ffd8h8tSOFCXec+2xJOVNCvXjuMOq/+5EKHq3D2m2MC2+nUaXeFMSt66VS/J4HdKBixgcw==" + }, "Microsoft.Win32.Registry": { "type": "Transitive", "resolved": "5.0.0", @@ -226,22 +184,13 @@ "resolved": "0.6.0", "contentHash": "mIhFTO23WVG66d2sqr0B0YlIOuTbyZjpaDMFoWPD1FQUwLOrWeMEpZEf8BqN24IDzfplgaSjl67wy+yUmtYaZA==", "dependencies": { - "Pragmastat": "3.1.33", - "System.Memory": "4.5.5" + "Pragmastat": "3.1.33" } }, "Pragmastat": { "type": "Transitive", "resolved": "3.1.33", - "contentHash": "qADZRnkNg1Emeu2xCnJAOl3ISrH5zfm/TMbk4qPgcvT9sydB+ceK27tdJM89Lycc0MleB/JMWpE9gPUooq7wgA==", - "dependencies": { - "System.Memory": "4.5.5" - } - }, - "System.Buffers": { - "type": "Transitive", - "resolved": "4.6.1", - "contentHash": "N8GXpmiLMtljq7gwvyS+1QvKT/W2J8sNAvx+HVg4NGmsG/H+2k/y9QI23auLJRterrzCiDH+IWAw4V/GPwsMlw==" + "contentHash": "qADZRnkNg1Emeu2xCnJAOl3ISrH5zfm/TMbk4qPgcvT9sydB+ceK27tdJM89Lycc0MleB/JMWpE9gPUooq7wgA==" }, "System.CodeDom": { "type": "Transitive", @@ -251,31 +200,16 @@ "System.Collections.Immutable": { "type": "Transitive", "resolved": "9.0.0", - "contentHash": "QhkXUl2gNrQtvPmtBTQHb0YsUrDiDQ2QS09YbtTTiSjGcf7NBqtYbrG/BE06zcBPCKEwQGzIv13IVdXNOSub2w==", - "dependencies": { - "System.Memory": "4.5.5", - "System.Runtime.CompilerServices.Unsafe": "6.0.0" - } + "contentHash": "QhkXUl2gNrQtvPmtBTQHb0YsUrDiDQ2QS09YbtTTiSjGcf7NBqtYbrG/BE06zcBPCKEwQGzIv13IVdXNOSub2w==" }, "System.Diagnostics.DiagnosticSource": { "type": "Transitive", "resolved": "6.0.0", "contentHash": "frQDfv0rl209cKm1lnwTgFPzNigy2EKk1BS3uAvHvlBVKe5cymGyHO+Sj+NLv5VF/AhHsqPIUUwya5oV4CHMUw==", "dependencies": { - "System.Memory": "4.5.4", "System.Runtime.CompilerServices.Unsafe": "6.0.0" } }, - "System.IO.Pipelines": { - "type": "Transitive", - "resolved": "10.0.0", - "contentHash": "M1eb3nfXntaRJPrrMVM9EFS8I1bDTnt0uvUS6QP/SicZf/ZZjydMD5NiXxfmwW/uQwaMDP/yX2P+zQN1NBHChg==", - "dependencies": { - "System.Buffers": "4.6.1", - "System.Memory": "4.6.3", - "System.Threading.Tasks.Extensions": "4.6.3" - } - }, "System.Management": { "type": "Transitive", "resolved": "9.0.5", @@ -284,39 +218,10 @@ "System.CodeDom": "9.0.5" } }, - "System.Memory": { - "type": "Transitive", - "resolved": "4.6.3", - "contentHash": "qdcDOgnFZY40+Q9876JUHnlHu7bosOHX8XISRoH94fwk6hgaeQGSgfZd8srWRZNt5bV9ZW2TljcegDNxsf+96A==", - "dependencies": { - "System.Buffers": "4.6.1", - "System.Numerics.Vectors": "4.6.1", - "System.Runtime.CompilerServices.Unsafe": "6.1.2" - } - }, - "System.Numerics.Vectors": { - "type": "Transitive", - "resolved": "4.6.1", - "contentHash": "sQxefTnhagrhoq2ReR0D/6K0zJcr9Hrd6kikeXsA1I8kOCboTavcUC4r7TSfpKFeE163uMuxZcyfO1mGO3EN8Q==" - }, - "System.Reflection.Emit": { - "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "VR4kk8XLKebQ4MZuKuIni/7oh+QGFmZW3qORd1GvBq/8026OpW501SzT/oypwiQl4TvT8ErnReh/NzY9u+C6wQ==" - }, - "System.Reflection.Emit.Lightweight": { - "type": "Transitive", - "resolved": "4.7.0", - "contentHash": "a4OLB4IITxAXJeV74MDx49Oq2+PsF6Sml54XAFv+2RyWwtDBcabzoxiiJRhdhx+gaohLh4hEGCLQyBozXoQPqA==" - }, "System.Reflection.Metadata": { "type": "Transitive", "resolved": "9.0.0", - "contentHash": "ANiqLu3DxW9kol/hMmTWbt3414t9ftdIuiIU7j80okq2YzAueo120M442xk1kDJWtmZTqWQn7wHDvMRipVOEOQ==", - "dependencies": { - "System.Collections.Immutable": "9.0.0", - "System.Memory": "4.5.5" - } + "contentHash": "ANiqLu3DxW9kol/hMmTWbt3414t9ftdIuiIU7j80okq2YzAueo120M442xk1kDJWtmZTqWQn7wHDvMRipVOEOQ==" }, "System.Reflection.TypeExtensions": { "type": "Transitive", @@ -325,19 +230,15 @@ }, "System.Runtime.CompilerServices.Unsafe": { "type": "Transitive", - "resolved": "6.1.2", - "contentHash": "2hBr6zdbIBTDE3EhK7NSVNdX58uTK6iHW/P/Axmm9sl1xoGSLqDvMtpecn226TNwHByFokYwJmt/aQQNlO5CRw==" - }, - "System.Runtime.InteropServices.RuntimeInformation": { - "type": "Transitive", - "resolved": "4.0.0", - "contentHash": "hWPhJxc453RCa8Z29O91EmfGeZIHX1ZH2A8L6lYQVSaKzku2DfArSfMEb1/MYYzPQRJZeu0c9dmYeJKxW5Fgng==" + "resolved": "6.0.0", + "contentHash": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg==" }, "System.Security.AccessControl": { "type": "Transitive", "resolved": "5.0.0", "contentHash": "dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==", "dependencies": { + "Microsoft.NETCore.Platforms": "5.0.0", "System.Security.Principal.Windows": "5.0.0" } }, @@ -346,93 +247,30 @@ "resolved": "5.0.0", "contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==" }, - "System.Text.Encoding.CodePages": { - "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "LSyCblMpvOe0N3E+8e0skHcrIhgV2huaNcjUUEa8hRtgEAm36aGkRoC8Jxlb6Ra6GSfF29ftduPNywin8XolzQ==", - "dependencies": { - "System.Memory": "4.5.5", - "System.Runtime.CompilerServices.Unsafe": "6.0.0" - } - }, - "System.Text.Encodings.Web": { - "type": "Transitive", - "resolved": "10.0.0", - "contentHash": "257hh1ep1Gqm1Lm0ulxf7vVBVMJuGN6EL4xSWjpi46DffXzm1058IiWsfSC06zSm7SniN+Tb5160UnXsSa8rRg==", - "dependencies": { - "System.Buffers": "4.6.1", - "System.Memory": "4.6.3", - "System.Runtime.CompilerServices.Unsafe": "6.1.2" - } - }, "System.Text.Json": { "type": "Transitive", "resolved": "10.0.0", - "contentHash": "1Dpjwq9peG/Wt5BNbrzIhTpclfOSqBWZsUO28vVr59yQlkvL5jLBWfpfzRmJ1OY+6DciaY0DUcltyzs4fuZHjw==", - "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "10.0.0", - "System.Buffers": "4.6.1", - "System.IO.Pipelines": "10.0.0", - "System.Memory": "4.6.3", - "System.Runtime.CompilerServices.Unsafe": "6.1.2", - "System.Text.Encodings.Web": "10.0.0", - "System.Threading.Tasks.Extensions": "4.6.3", - "System.ValueTuple": "4.6.1" - } - }, - "System.Threading.Tasks.Extensions": { - "type": "Transitive", - "resolved": "4.6.3", - "contentHash": "7sCiwilJLYbTZELaKnc7RecBBXWXA+xMLQWZKWawBxYjp6DBlSE3v9/UcvKBvr1vv2tTOhipiogM8rRmxlhrVA==", - "dependencies": { - "System.Runtime.CompilerServices.Unsafe": "6.1.2" - } - }, - "System.ValueTuple": { - "type": "Transitive", - "resolved": "4.6.1", - "contentHash": "+RJT4qaekpZ7DDLhf+LTjq+E48jieKiY9ulJ+BoxKmZblIJfIJT8Ufcaa/clQqnYvWs8jugfGSMu8ylS0caG0w==" + "contentHash": "1Dpjwq9peG/Wt5BNbrzIhTpclfOSqBWZsUO28vVr59yQlkvL5jLBWfpfzRmJ1OY+6DciaY0DUcltyzs4fuZHjw==" }, "schema.net": { "type": "Project", "dependencies": { + "DotNet.ReproducibleBuilds": "[1.2.39, )", "Microsoft.CodeAnalysis.CSharp": "[4.14.0, )", + "Microsoft.VisualStudio.Threading.Analyzers": "[17.14.15, )", + "MinVer": "[6.0.0, )", + "Schema.NET.Common": "[1.0.0, )", "System.Text.Json": "[10.0.0, )" } - } - }, - ".NETFramework,Version=v4.8/win7-x86": { - "Gee.External.Capstone": { - "type": "Transitive", - "resolved": "2.3.0", - "contentHash": "2ap/rYmjtzCOT8hxrnEW/QeiOt+paD8iRrIcdKX0cxVwWLFa1e+JDBNeECakmccXrSFeBQuu5AV8SNkipFMMMw==" - }, - "Microsoft.Win32.Registry": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==", - "dependencies": { - "System.Security.AccessControl": "5.0.0", - "System.Security.Principal.Windows": "5.0.0" - } }, - "System.Runtime.InteropServices.RuntimeInformation": { - "type": "Transitive", - "resolved": "4.0.0", - "contentHash": "hWPhJxc453RCa8Z29O91EmfGeZIHX1ZH2A8L6lYQVSaKzku2DfArSfMEb1/MYYzPQRJZeu0c9dmYeJKxW5Fgng==" - }, - "System.Security.AccessControl": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==", + "schema.net.common": { + "type": "Project", "dependencies": { - "System.Security.Principal.Windows": "5.0.0" + "DotNet.ReproducibleBuilds": "[1.2.39, )", + "Microsoft.CodeAnalysis.CSharp": "[4.14.0, )", + "MinVer": "[6.0.0, )", + "System.Text.Json": "[10.0.0, )" } - }, - "System.Security.Principal.Windows": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==" } }, "net8.0": { @@ -454,23 +292,11 @@ "System.Management": "9.0.5" } }, - "Microsoft.CodeAnalysis.NetAnalyzers": { - "type": "Direct", - "requested": "[8.0.0, )", - "resolved": "8.0.0", - "contentHash": "DxiTgkCl3CGq1rYmBX2wjY7XGbxiBdL4J+/AJIAFLKy5z70NxhnVRnPghnicXZ8oF6JKVXlW3xwznRbI3ioEKg==" - }, - "Microsoft.VisualStudio.Threading.Analyzers": { - "type": "Direct", - "requested": "[17.12.19, )", - "resolved": "17.12.19", - "contentHash": "v3IYeedjoktvZ+GqYmLudxZJngmf/YWIxNT2Uy6QMMN19cvw+nkWoip1Gr1RtnFkUo1MPUVMis4C8Kj8d8DpSQ==" - }, "MinVer": { "type": "Direct", - "requested": "[4.3.0, )", - "resolved": "4.3.0", - "contentHash": "YNVAW3loCFW4kTwensApaZUl+7xREK75QQNOFSbsbXx2sCSm9/IHBjUHsJGn3u0UA5r/sAqrdYBNUlOFfLhUrA==" + "requested": "[6.0.0, )", + "resolved": "6.0.0", + "contentHash": "+/SsmiySsXJlvQLCGBqaZKNVt3s/Y/HbAdwtop7Km2CnuZbaScoqkWJEBQ5Cy9ebkn6kCYKrHsXgwrFdTgcb3g==" }, "BenchmarkDotNet.Annotations": { "type": "Transitive", @@ -482,6 +308,11 @@ "resolved": "2.9.1", "contentHash": "OE0sl1/sQ37bjVsPKKtwQlWDgqaxWgtme3xZz7JssWUzg5JpMIyHgCTY9MVMxOg48fJ1AgGT3tgdH5m/kQ5xhA==" }, + "DotNet.ReproducibleBuilds": { + "type": "Transitive", + "resolved": "1.2.39", + "contentHash": "fcFN01tDTIQqDuTwr1jUQK/geofiwjG5DycJQOnC72i1SsLAk1ELe+apBOuZ11UMQG8YKFZG1FgvjZPbqHyatg==" + }, "Gee.External.Capstone": { "type": "Transitive", "resolved": "2.3.0", @@ -606,6 +437,11 @@ "resolved": "5.0.0", "contentHash": "VyPlqzH2wavqquTcYpkIIAQ6WdenuKoFN0BdYBbCWsclXacSOHNQn66Gt4z5NBqEYW0FAPm5rlvki9ZiCij5xQ==" }, + "Microsoft.VisualStudio.Threading.Analyzers": { + "type": "Transitive", + "resolved": "17.14.15", + "contentHash": "mXQPJsbuUD2ydq4/ffd8h8tSOFCXec+2xJOVNCvXjuMOq/+5EKHq3D2m2MC2+nUaXeFMSt66VS/J4HdKBixgcw==" + }, "Microsoft.Win32.Registry": { "type": "Transitive", "resolved": "5.0.0", @@ -708,52 +544,22 @@ "schema.net": { "type": "Project", "dependencies": { + "DotNet.ReproducibleBuilds": "[1.2.39, )", "Microsoft.CodeAnalysis.CSharp": "[4.14.0, )", + "Microsoft.VisualStudio.Threading.Analyzers": "[17.14.15, )", + "MinVer": "[6.0.0, )", + "Schema.NET.Common": "[1.0.0, )", "System.Text.Json": "[10.0.0, )" } - } - }, - "net8.0/win7-x86": { - "Gee.External.Capstone": { - "type": "Transitive", - "resolved": "2.3.0", - "contentHash": "2ap/rYmjtzCOT8hxrnEW/QeiOt+paD8iRrIcdKX0cxVwWLFa1e+JDBNeECakmccXrSFeBQuu5AV8SNkipFMMMw==" }, - "Microsoft.Win32.Registry": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==", - "dependencies": { - "System.Security.AccessControl": "5.0.0", - "System.Security.Principal.Windows": "5.0.0" - } - }, - "System.Management": { - "type": "Transitive", - "resolved": "9.0.5", - "contentHash": "n6o9PZm9p25+zAzC3/48K0oHnaPKTInRrxqFq1fi/5TPbMLjuoCm/h//mS3cUmSy+9AO1Z+qsC/Ilt/ZFatv5Q==", - "dependencies": { - "System.CodeDom": "9.0.5" - } - }, - "System.Security.AccessControl": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==", + "schema.net.common": { + "type": "Project", "dependencies": { - "Microsoft.NETCore.Platforms": "5.0.0", - "System.Security.Principal.Windows": "5.0.0" + "DotNet.ReproducibleBuilds": "[1.2.39, )", + "Microsoft.CodeAnalysis.CSharp": "[4.14.0, )", + "MinVer": "[6.0.0, )", + "System.Text.Json": "[10.0.0, )" } - }, - "System.Security.Principal.Windows": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==" - }, - "System.Text.Encodings.Web": { - "type": "Transitive", - "resolved": "10.0.0", - "contentHash": "257hh1ep1Gqm1Lm0ulxf7vVBVMJuGN6EL4xSWjpi46DffXzm1058IiWsfSC06zSm7SniN+Tb5160UnXsSa8rRg==" } } } diff --git a/Directory.Build.props b/Directory.Build.props index d3fa5e69..119313df 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -9,7 +9,6 @@ enable true true - true @@ -26,9 +25,7 @@ - - - + diff --git a/Key.snk b/Key.snk deleted file mode 100644 index 2ff0c617..00000000 Binary files a/Key.snk and /dev/null differ diff --git a/Schema.NET.sln b/Schema.NET.sln index ed0abc7a..9ad38198 100644 --- a/Schema.NET.sln +++ b/Schema.NET.sln @@ -14,14 +14,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution .editorconfig = .editorconfig .gitattributes = .gitattributes .gitignore = .gitignore - appveyor.yml = appveyor.yml - azure-pipelines.yml = azure-pipelines.yml build.cake = build.cake Directory.Build.props = Directory.Build.props Directory.Build.targets = Directory.Build.targets dotnet-tools.json = dotnet-tools.json global.json = global.json - Key.snk = Key.snk EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Schema.NET", "Source\Schema.NET\Schema.NET.csproj", "{266BBA60-25FD-4C1B-BD99-9DCFA1B57130}" @@ -83,35 +80,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Schema.NET.Pending", "Source\Schema.NET.Pending\Schema.NET.Pending.csproj", "{4EDF33FF-4532-4328-A158-D026C66537BA}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Common", "Common", "{AF228B8A-7290-4E26-8506-934C290C6AE3}" - ProjectSection(SolutionItems) = preProject - Source\Common\Constants.cs = Source\Common\Constants.cs - Source\Common\ContactType.cs = Source\Common\ContactType.cs - Source\Common\ContextJsonConverter.cs = Source\Common\ContextJsonConverter.cs - Source\Common\DateTimeHelper.cs = Source\Common\DateTimeHelper.cs - Source\Common\DateTimeToIso8601DateValuesJsonConverter.cs = Source\Common\DateTimeToIso8601DateValuesJsonConverter.cs - Source\Common\EnumHelper.cs = Source\Common\EnumHelper.cs - Source\Common\FastActivator.cs = Source\Common\FastActivator.cs - Source\Common\HashCode.cs = Source\Common\HashCode.cs - Source\Common\IValues.cs = Source\Common\IValues.cs - Source\Common\JsonLdContext.cs = Source\Common\JsonLdContext.cs - Source\Common\JsonLdObject.cs = Source\Common\JsonLdObject.cs - Source\Common\OneOrMany{T}.cs = Source\Common\OneOrMany{T}.cs - Source\Common\PropertyValueSpecification.Partial.cs = Source\Common\PropertyValueSpecification.Partial.cs - Source\Common\SchemaEnumJsonConverter{T}.cs = Source\Common\SchemaEnumJsonConverter{T}.cs - Source\Common\SchemaSerializer.cs = Source\Common\SchemaSerializer.cs - Source\Common\Thing.Partial.cs = Source\Common\Thing.Partial.cs - Source\Common\TimeSpanToISO8601DurationValuesJsonConverter.cs = Source\Common\TimeSpanToISO8601DurationValuesJsonConverter.cs - Source\Common\TypeExtensions.cs = Source\Common\TypeExtensions.cs - Source\Common\ValuesJsonConverter.cs = Source\Common\ValuesJsonConverter.cs - Source\Common\Values{T1,T2,T3,T4,T5,T6,T7}.cs = Source\Common\Values{T1,T2,T3,T4,T5,T6,T7}.cs - Source\Common\Values{T1,T2,T3,T4,T5,T6}.cs = Source\Common\Values{T1,T2,T3,T4,T5,T6}.cs - Source\Common\Values{T1,T2,T3,T4,T5}.cs = Source\Common\Values{T1,T2,T3,T4,T5}.cs - Source\Common\Values{T1,T2,T3,T4}.cs = Source\Common\Values{T1,T2,T3,T4}.cs - Source\Common\Values{T1,T2,T3}.cs = Source\Common\Values{T1,T2,T3}.cs - Source\Common\Values{T1,T2}.cs = Source\Common\Values{T1,T2}.cs - EndProjectSection -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Schema.NET.Updater", "Tools\Schema.NET.Updater\Schema.NET.Updater.csproj", "{8923F9E2-4BB8-45F9-9A85-863F381B46EE}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Data", "Data", "{A208CE34-D2DF-4BD2-B6CF-3047883BC820}" @@ -119,6 +87,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Data", "Data", "{A208CE34-D Data\schemaorg-all-https.jsonld = Data\schemaorg-all-https.jsonld EndProjectSection EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Schema.NET.Common", "Source\Schema.NET.Common\Schema.NET.Common.csproj", "{E1CB91D3-896B-4E25-882F-5596C4435555}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -149,6 +119,10 @@ Global {8923F9E2-4BB8-45F9-9A85-863F381B46EE}.Debug|Any CPU.Build.0 = Debug|Any CPU {8923F9E2-4BB8-45F9-9A85-863F381B46EE}.Release|Any CPU.ActiveCfg = Release|Any CPU {8923F9E2-4BB8-45F9-9A85-863F381B46EE}.Release|Any CPU.Build.0 = Release|Any CPU + {E1CB91D3-896B-4E25-882F-5596C4435555}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E1CB91D3-896B-4E25-882F-5596C4435555}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E1CB91D3-896B-4E25-882F-5596C4435555}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E1CB91D3-896B-4E25-882F-5596C4435555}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -163,8 +137,8 @@ Global {040F8F6D-9144-42FD-9B0D-7F88EF0C26C5} = {F20E2797-D1E3-4321-91BB-FAE54954D2A0} {9444439E-8476-4BAB-AE1E-DBC24B58865F} = {040F8F6D-9144-42FD-9B0D-7F88EF0C26C5} {4EDF33FF-4532-4328-A158-D026C66537BA} = {719809C2-A551-4C4A-9EFD-B10FB5E35BC0} - {AF228B8A-7290-4E26-8506-934C290C6AE3} = {719809C2-A551-4C4A-9EFD-B10FB5E35BC0} {8923F9E2-4BB8-45F9-9A85-863F381B46EE} = {1D81D082-9C25-4D4E-890E-9CD173532307} + {E1CB91D3-896B-4E25-882F-5596C4435555} = {719809C2-A551-4C4A-9EFD-B10FB5E35BC0} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {73F36209-F8D6-4066-8951-D97729F773CF} diff --git a/Schema.NET.sln.DotSettings b/Schema.NET.sln.DotSettings new file mode 100644 index 00000000..f7fba3f9 --- /dev/null +++ b/Schema.NET.sln.DotSettings @@ -0,0 +1,2 @@ + + MS \ No newline at end of file diff --git a/Source/Directory.Build.props b/Source/Directory.Build.props index 49fe6e1a..5b3d240f 100644 --- a/Source/Directory.Build.props +++ b/Source/Directory.Build.props @@ -10,13 +10,8 @@ - - true - ../../Key.snk - - - + diff --git a/Source/Common/Constants.cs b/Source/Schema.NET.Common/Constants.cs similarity index 100% rename from Source/Common/Constants.cs rename to Source/Schema.NET.Common/Constants.cs diff --git a/Source/Common/ContactType.cs b/Source/Schema.NET.Common/ContactType.cs similarity index 100% rename from Source/Common/ContactType.cs rename to Source/Schema.NET.Common/ContactType.cs diff --git a/Source/Common/ContextJsonConverter.cs b/Source/Schema.NET.Common/ContextJsonConverter.cs similarity index 83% rename from Source/Common/ContextJsonConverter.cs rename to Source/Schema.NET.Common/ContextJsonConverter.cs index b81d5929..d23ce421 100644 --- a/Source/Common/ContextJsonConverter.cs +++ b/Source/Schema.NET.Common/ContextJsonConverter.cs @@ -13,20 +13,9 @@ public class ContextJsonConverter : JsonConverter /// public override JsonLdContext Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { -#if NET ArgumentNullException.ThrowIfNull(typeToConvert); ArgumentNullException.ThrowIfNull(options); -#else - if (typeToConvert is null) - { - throw new ArgumentNullException(nameof(typeToConvert)); - } - if (options is null) - { - throw new ArgumentNullException(nameof(options)); - } -#endif var context = new JsonLdContext(); string? name = null; @@ -82,26 +71,9 @@ public override JsonLdContext Read(ref Utf8JsonReader reader, Type typeToConvert /// public override void Write(Utf8JsonWriter writer, JsonLdContext value, JsonSerializerOptions options) { -#if NET ArgumentNullException.ThrowIfNull(writer); ArgumentNullException.ThrowIfNull(value); ArgumentNullException.ThrowIfNull(options); -#else - if (writer is null) - { - throw new ArgumentNullException(nameof(writer)); - } - - if (value is null) - { - throw new ArgumentNullException(nameof(value)); - } - - if (options is null) - { - throw new ArgumentNullException(nameof(options)); - } -#endif if (string.IsNullOrWhiteSpace(value.Language)) { diff --git a/Source/Common/DateTimeHelper.cs b/Source/Schema.NET.Common/DateTimeHelper.cs similarity index 81% rename from Source/Common/DateTimeHelper.cs rename to Source/Schema.NET.Common/DateTimeHelper.cs index 254914d4..c47776f7 100644 --- a/Source/Common/DateTimeHelper.cs +++ b/Source/Schema.NET.Common/DateTimeHelper.cs @@ -26,12 +26,12 @@ public static bool ContainsTimeOffset(string? input) return false; } - if (input.IndexOf("+", StringComparison.Ordinal) != -1 || input.IndexOf("Z", StringComparison.Ordinal) != -1) + if (input.Contains('+', StringComparison.Ordinal) || input.Contains('Z', StringComparison.Ordinal)) { return true; } - var timeSeparatorIndex = input.IndexOf("T", StringComparison.Ordinal); + var timeSeparatorIndex = input.IndexOf('T', StringComparison.Ordinal); if (timeSeparatorIndex != -1) { return input.IndexOf(NegativeOffset, timeSeparatorIndex, StringComparison.Ordinal) != -1; @@ -46,12 +46,7 @@ public static bool ContainsTimeOffset(string? input) /// The input string /// The result date and time /// True if the input string was able to be parsed into a - public static bool TryParseMSDateTime( -#if NETCOREAPP3_1_OR_GREATER - [NotNullWhen(true)] -#endif - string? input, - out DateTime result) + public static bool TryParseMSDateTime([NotNullWhen(true)] string? input, out DateTime result) { if (input is not null && input.StartsWith(MSDateStringStart, StringComparison.Ordinal) && @@ -60,11 +55,7 @@ public static bool TryParseMSDateTime( var dateTimeStartIndex = MSDateStringStart.Length; var dateTimeLength = input.IndexOf(MSDateStringEnd, StringComparison.Ordinal) - dateTimeStartIndex; -#if NETCOREAPP3_1_OR_GREATER var timeValue = input.AsSpan().Slice(dateTimeStartIndex, dateTimeLength); -#else - var timeValue = input.Substring(dateTimeStartIndex, dateTimeLength); -#endif if (double.TryParse(timeValue, out var milliseconds)) { @@ -83,12 +74,7 @@ public static bool TryParseMSDateTime( /// The input string /// The result date and time with offset /// True if the input string was able to be parsed into a - public static bool TryParseMSDateTimeOffset( -#if NETCOREAPP3_1_OR_GREATER - [NotNullWhen(true)] -#endif - string? input, - out DateTimeOffset result) + public static bool TryParseMSDateTimeOffset([NotNullWhen(true)] string? input, out DateTimeOffset result) { if (input is not null && input.StartsWith(MSDateStringStart, StringComparison.Ordinal) && @@ -98,16 +84,9 @@ public static bool TryParseMSDateTimeOffset( var offsetIndex = input.IndexOfAny(OffsetChars); var dateTimeLength = offsetIndex - dateTimeStartIndex; var offsetLength = input.IndexOf(MSDateStringEnd, offsetIndex, StringComparison.Ordinal) - offsetIndex; - -#if NETCOREAPP3_1_OR_GREATER var timeValue = input.AsSpan().Slice(dateTimeStartIndex, dateTimeLength); var offsetType = input.AsSpan().Slice(offsetIndex, 1); var offsetValue = input.AsSpan().Slice(offsetIndex + 1, offsetLength - 1); -#else - var timeValue = input.Substring(dateTimeStartIndex, dateTimeLength); - var offsetType = input.Substring(offsetIndex, 1); - var offsetValue = input.Substring(offsetIndex + 1, offsetLength - 1); -#endif if (double.TryParse(timeValue, out var milliseconds)) { diff --git a/Source/Common/DateTimeToIso8601DateValuesJsonConverter.cs b/Source/Schema.NET.Common/DateTimeToIso8601DateValuesJsonConverter.cs similarity index 84% rename from Source/Common/DateTimeToIso8601DateValuesJsonConverter.cs rename to Source/Schema.NET.Common/DateTimeToIso8601DateValuesJsonConverter.cs index 5dcb4eab..9ba6acb7 100644 --- a/Source/Common/DateTimeToIso8601DateValuesJsonConverter.cs +++ b/Source/Schema.NET.Common/DateTimeToIso8601DateValuesJsonConverter.cs @@ -23,20 +23,8 @@ public class DateTimeToIso8601DateValuesJsonConverter : ValuesJsonConverter /// The JSON serializer options. public override void WriteObject(Utf8JsonWriter writer, object? value, JsonSerializerOptions options) { -#if NET ArgumentNullException.ThrowIfNull(writer); ArgumentNullException.ThrowIfNull(options); -#else - if (writer is null) - { - throw new ArgumentNullException(nameof(writer)); - } - - if (options is null) - { - throw new ArgumentNullException(nameof(options)); - } -#endif if (value is DateTime dateTimeType) { diff --git a/Source/Common/EnumHelper.cs b/Source/Schema.NET.Common/EnumHelper.cs similarity index 71% rename from Source/Common/EnumHelper.cs rename to Source/Schema.NET.Common/EnumHelper.cs index efefb231..0df2eeb8 100644 --- a/Source/Common/EnumHelper.cs +++ b/Source/Schema.NET.Common/EnumHelper.cs @@ -19,30 +19,8 @@ public static class EnumHelper /// if the conversion succeeded; otherwise. public static bool TryParse( Type enumType, -#if NETCOREAPP3_1_OR_GREATER - [NotNullWhen(true)] -#endif - string? value, -#if NET - out object? result) => - Enum.TryParse(enumType, value, out result); -#else - out object? result) - { - try - { - result = Enum.Parse(enumType, value); - return true; - } -#pragma warning disable CA1031 // Do not catch general exception types - catch -#pragma warning restore CA1031 // Do not catch general exception types - { - result = null; - return false; - } - } -#endif + [NotNullWhen(true)] string? value, + out object? result) => Enum.TryParse(enumType, value, out result); /// /// Converts the Schema URI representation of the enum type to an equivalent enumerated object. @@ -53,36 +31,19 @@ public static bool TryParse( /// if the conversion succeeded; otherwise. public static bool TryParseEnumFromSchemaUri( Type enumType, -#if NETCOREAPP3_1_OR_GREATER - [NotNullWhen(true)] -#endif - string? value, + [NotNullWhen(true)] string? value, out object? result) { -#if NET ArgumentNullException.ThrowIfNull(enumType); -#else - if (enumType is null) - { - throw new ArgumentNullException(nameof(enumType)); - } -#endif + string? enumString; if (value is not null && value.Length > Constants.HttpSchemaOrgUrl.Length && value.StartsWith(Constants.HttpSchemaOrgUrl, StringComparison.OrdinalIgnoreCase)) { -#if NETCOREAPP3_0_OR_GREATER enumString = value[(Constants.HttpSchemaOrgUrl.Length + 1)..]; -#else - enumString = value.Substring(Constants.HttpSchemaOrgUrl.Length + 1); -#endif } else if (value is not null && value.Length > Constants.HttpsSchemaOrgUrl.Length && value.StartsWith(Constants.HttpsSchemaOrgUrl, StringComparison.OrdinalIgnoreCase)) { -#if NETCOREAPP3_0_OR_GREATER enumString = value[(Constants.HttpsSchemaOrgUrl.Length + 1)..]; -#else - enumString = value.Substring(Constants.HttpsSchemaOrgUrl.Length + 1); -#endif } else { diff --git a/Source/Common/FastActivator.cs b/Source/Schema.NET.Common/FastActivator.cs similarity index 97% rename from Source/Common/FastActivator.cs rename to Source/Schema.NET.Common/FastActivator.cs index 86323569..f3099ab8 100644 --- a/Source/Common/FastActivator.cs +++ b/Source/Schema.NET.Common/FastActivator.cs @@ -56,6 +56,6 @@ private static Func CreateConstructorDelegate(ConstructorInfo co private static class ConstructorParameter { - public static readonly ParameterExpression[] SingleParameter = new[] { Expression.Parameter(typeof(T1)) }; + public static readonly ParameterExpression[] SingleParameter = [Expression.Parameter(typeof(T1))]; } } diff --git a/Source/Common/HashCode.cs b/Source/Schema.NET.Common/HashCode.cs similarity index 100% rename from Source/Common/HashCode.cs rename to Source/Schema.NET.Common/HashCode.cs diff --git a/Source/Common/IValues.cs b/Source/Schema.NET.Common/IValues.cs similarity index 100% rename from Source/Common/IValues.cs rename to Source/Schema.NET.Common/IValues.cs diff --git a/Source/Common/JsonLdContext.cs b/Source/Schema.NET.Common/JsonLdContext.cs similarity index 100% rename from Source/Common/JsonLdContext.cs rename to Source/Schema.NET.Common/JsonLdContext.cs diff --git a/Source/Common/JsonLdObject.cs b/Source/Schema.NET.Common/JsonLdObject.cs similarity index 100% rename from Source/Common/JsonLdObject.cs rename to Source/Schema.NET.Common/JsonLdObject.cs diff --git a/Source/Common/OneOrMany{T}.cs b/Source/Schema.NET.Common/OneOrMany{T}.cs similarity index 90% rename from Source/Common/OneOrMany{T}.cs rename to Source/Schema.NET.Common/OneOrMany{T}.cs index 1b37ae2d..7aaa6daf 100644 --- a/Source/Common/OneOrMany{T}.cs +++ b/Source/Schema.NET.Common/OneOrMany{T}.cs @@ -3,7 +3,11 @@ namespace Schema.NET; using System; using System.Collections; using System.Collections.Generic; +using System.Collections.Immutable; +using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Linq; +using System.Runtime.CompilerServices; /// /// A single or list of values. @@ -25,7 +29,7 @@ public OneOrMany(T? item) { if (item is null || (item is string itemAsString && string.IsNullOrWhiteSpace(itemAsString))) { - this.collection = null; + this.collection = []; this.HasOne = false; } else @@ -53,7 +57,7 @@ public OneOrMany(ReadOnlySpan span) var item = span[i]; if (!string.IsNullOrWhiteSpace(item as string)) { - items[index] = item!; + items[index] = item; index++; } } @@ -88,7 +92,7 @@ public OneOrMany(ReadOnlySpan span) } } - this.collection = null; + this.collection = []; this.HasOne = false; } @@ -96,28 +100,19 @@ public OneOrMany(ReadOnlySpan span) /// Initializes a new instance of the struct. /// /// The array of values. - public OneOrMany(params T?[] array) - : this(array.AsSpan()) - { - } + public OneOrMany(params T?[] array) : this(array.AsSpan()) { } /// /// Initializes a new instance of the struct. /// /// The collection of values. - public OneOrMany(IEnumerable collection) - : this(collection.ToArray().AsSpan()) - { - } + public OneOrMany(IEnumerable collection) : this(collection.ToArray().AsSpan()) { } /// /// Initializes a new instance of the struct. /// /// The list of values. - public OneOrMany(IEnumerable collection) - : this(collection.Cast().ToArray().AsSpan()) - { - } + public OneOrMany(IEnumerable collection) : this(collection.Cast().ToArray().AsSpan()) { } /// /// Gets the number of elements contained in the . @@ -241,16 +236,15 @@ public T[] ToArray() { return [this.collection![0]]; } - else if (this.HasMany) + + if (this.HasMany) { var result = new T[this.collection!.Length]; Array.Copy(this.collection, 0, result, 0, this.collection.Length); return result; } - else - { - return []; - } + + return []; } /// @@ -272,20 +266,7 @@ public bool Equals(OneOrMany other) } else if (this.HasMany && other.HasMany) { - if (this.collection!.Length != other.collection!.Length) - { - return false; - } - - for (var i = 0; i < this.collection.Length; i++) - { - if (!EqualityComparer.Default.Equals(this.collection[i], other.collection[i])) - { - return false; - } - } - - return true; + return this.AsSpan().SequenceEqual(other.AsSpan()); } return false; @@ -298,7 +279,7 @@ public bool Equals(OneOrMany other) /// /// true if the specified is equal to this instance; otherwise, false. /// - public override bool Equals(object? obj) => obj is OneOrMany oneOrMany && this.Equals(oneOrMany); + public override bool Equals([NotNullWhen(true)] object? obj) => obj is OneOrMany oneOrMany && this.Equals(oneOrMany); /// /// Returns a hash code for this instance. @@ -307,4 +288,10 @@ public bool Equals(OneOrMany other) /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. /// public override int GetHashCode() => HashCode.OfEach(this.collection); + + /// + /// Returns a wrapping the current items. + /// + /// A wrapping the current items. + public ReadOnlySpan AsSpan() => this.collection.AsSpan(); } diff --git a/Source/Schema.NET.Common/Properties/AssemblyInfo.cs b/Source/Schema.NET.Common/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..0270020d --- /dev/null +++ b/Source/Schema.NET.Common/Properties/AssemblyInfo.cs @@ -0,0 +1,3 @@ +using System; + +[assembly: CLSCompliant(true)] diff --git a/Source/Common/PropertyValueSpecification.Partial.cs b/Source/Schema.NET.Common/PropertyValueSpecification.Partial.cs similarity index 77% rename from Source/Common/PropertyValueSpecification.Partial.cs rename to Source/Schema.NET.Common/PropertyValueSpecification.Partial.cs index 359c6eba..31d9cbe9 100644 --- a/Source/Common/PropertyValueSpecification.Partial.cs +++ b/Source/Schema.NET.Common/PropertyValueSpecification.Partial.cs @@ -13,14 +13,14 @@ public partial class PropertyValueSpecification private const string NamePropertyName = "name="; private const string PatternPropertyName = "pattern="; private const string RequiredPropertyName = "required"; - private const char SpaceDelimeter = ' '; + private const char SpaceDelimiter = ' '; /// - /// Returns a that represents the short hand representation of this instance. + /// Returns a that represents the shorthand representation of this instance. /// See https://schema.org/docs/actions.html#part-3. /// /// - /// A that represents the short hand representation of this instance. + /// A that represents the shorthand representation of this instance. /// public override string ToString() { @@ -34,39 +34,39 @@ public override string ToString() if (this.ValueMinLength.First() is double minLength) { - AppendSpaceDelimeter(stringBuilder); + AppendSpaceDelimiter(stringBuilder); stringBuilder.Append(MinLengthPropertyName); stringBuilder.Append(minLength); } if (this.ValueName.First() is string name) { - AppendSpaceDelimeter(stringBuilder); + AppendSpaceDelimiter(stringBuilder); stringBuilder.Append(NamePropertyName); stringBuilder.Append(name); } if (this.ValuePattern.First() is string pattern) { - AppendSpaceDelimeter(stringBuilder); + AppendSpaceDelimiter(stringBuilder); stringBuilder.Append(PatternPropertyName); stringBuilder.Append(pattern); } if (this.ValueRequired.First() is true) { - AppendSpaceDelimeter(stringBuilder); + AppendSpaceDelimiter(stringBuilder); stringBuilder.Append(RequiredPropertyName); } return stringBuilder.ToString(); } - private static void AppendSpaceDelimeter(StringBuilder stringBuilder) + private static void AppendSpaceDelimiter(StringBuilder stringBuilder) { if (stringBuilder.Length > 0) { - stringBuilder.Append(SpaceDelimeter); + stringBuilder.Append(SpaceDelimiter); } } } diff --git a/Source/Schema.NET.Common/Schema.NET.Common.csproj b/Source/Schema.NET.Common/Schema.NET.Common.csproj new file mode 100644 index 00000000..c055c5e9 --- /dev/null +++ b/Source/Schema.NET.Common/Schema.NET.Common.csproj @@ -0,0 +1,23 @@ + + + + net10.0;net8.0 + Schema.NET + True + $(BaseIntermediateOutputPath)\GeneratedFiles + + + + + + + + + + + + + + + + diff --git a/Source/Common/SchemaEnumJsonConverter{T}.cs b/Source/Schema.NET.Common/SchemaEnumJsonConverter{T}.cs similarity index 85% rename from Source/Common/SchemaEnumJsonConverter{T}.cs rename to Source/Schema.NET.Common/SchemaEnumJsonConverter{T}.cs index e6b7fadc..4f53206b 100644 --- a/Source/Common/SchemaEnumJsonConverter{T}.cs +++ b/Source/Schema.NET.Common/SchemaEnumJsonConverter{T}.cs @@ -41,14 +41,7 @@ public SchemaEnumJsonConverter() /// The enumeration value. public override T Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { -#if NET ArgumentNullException.ThrowIfNull(typeToConvert); -#else - if (typeToConvert is null) - { - throw new ArgumentNullException(nameof(typeToConvert)); - } -#endif var valueString = reader.GetString(); if (EnumHelper.TryParseEnumFromSchemaUri(typeToConvert, valueString, out var result)) @@ -67,20 +60,8 @@ public override T Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerial /// The JSON serializer options. public override void Write(Utf8JsonWriter writer, T value, JsonSerializerOptions options) { -#if NET ArgumentNullException.ThrowIfNull(writer); ArgumentNullException.ThrowIfNull(options); -#else - if (writer is null) - { - throw new ArgumentNullException(nameof(writer)); - } - - if (options is null) - { - throw new ArgumentNullException(nameof(options)); - } -#endif writer.WriteStringValue(this.valueNameMap[value]); } diff --git a/Source/Common/SchemaSerializer.cs b/Source/Schema.NET.Common/SchemaSerializer.cs similarity index 97% rename from Source/Common/SchemaSerializer.cs rename to Source/Schema.NET.Common/SchemaSerializer.cs index e86d928a..1b25dd1a 100644 --- a/Source/Common/SchemaSerializer.cs +++ b/Source/Schema.NET.Common/SchemaSerializer.cs @@ -71,7 +71,7 @@ public static string SerializeObject(object value, JsonSerializerOptions options private static string RemoveAllButFirstContext(string json) { - if (json.IndexOf(ContextPropertyJson, StringComparison.Ordinal) != -1) + if (json.Contains(ContextPropertyJson, StringComparison.Ordinal)) { var stringBuilder = new StringBuilder(json); var startIndex = ContextPropertyJson.Length + 1; // We add the one to represent the opening curly brace. diff --git a/Source/Common/Thing.Partial.cs b/Source/Schema.NET.Common/Thing.Partial.cs similarity index 100% rename from Source/Common/Thing.Partial.cs rename to Source/Schema.NET.Common/Thing.Partial.cs diff --git a/Source/Common/TimeSpanToISO8601DurationValuesJsonConverter.cs b/Source/Schema.NET.Common/TimeSpanToISO8601DurationValuesJsonConverter.cs similarity index 83% rename from Source/Common/TimeSpanToISO8601DurationValuesJsonConverter.cs rename to Source/Schema.NET.Common/TimeSpanToISO8601DurationValuesJsonConverter.cs index fb7c9c97..247d81b4 100644 --- a/Source/Common/TimeSpanToISO8601DurationValuesJsonConverter.cs +++ b/Source/Schema.NET.Common/TimeSpanToISO8601DurationValuesJsonConverter.cs @@ -21,20 +21,8 @@ public class TimeSpanToISO8601DurationValuesJsonConverter : ValuesJsonConverter /// The JSON serializer options. public override void WriteObject(Utf8JsonWriter writer, object? value, JsonSerializerOptions options) { -#if NET ArgumentNullException.ThrowIfNull(writer); ArgumentNullException.ThrowIfNull(options); -#else - if (writer is null) - { - throw new ArgumentNullException(nameof(writer)); - } - - if (options is null) - { - throw new ArgumentNullException(nameof(options)); - } -#endif if (value is TimeSpan duration) { diff --git a/Source/Common/TypeExtensions.cs b/Source/Schema.NET.Common/TypeExtensions.cs similarity index 100% rename from Source/Common/TypeExtensions.cs rename to Source/Schema.NET.Common/TypeExtensions.cs diff --git a/Source/Common/ValuesJsonConverter.cs b/Source/Schema.NET.Common/ValuesJsonConverter.cs similarity index 89% rename from Source/Common/ValuesJsonConverter.cs rename to Source/Schema.NET.Common/ValuesJsonConverter.cs index 17fbc531..1f2d5be0 100644 --- a/Source/Common/ValuesJsonConverter.cs +++ b/Source/Schema.NET.Common/ValuesJsonConverter.cs @@ -42,20 +42,8 @@ static ValuesJsonConverter() /// The object value. public override IValues? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { -#if NET ArgumentNullException.ThrowIfNull(typeToConvert); ArgumentNullException.ThrowIfNull(options); -#else - if (typeToConvert is null) - { - throw new ArgumentNullException(nameof(typeToConvert)); - } - - if (options is null) - { - throw new ArgumentNullException(nameof(options)); - } -#endif var dynamicConstructor = FastActivator.GetDynamicConstructor>(typeToConvert); if (dynamicConstructor is not null) @@ -100,21 +88,9 @@ static ValuesJsonConverter() /// The JSON serializer options. public override void Write(Utf8JsonWriter writer, IValues value, JsonSerializerOptions options) { -#if NET ArgumentNullException.ThrowIfNull(writer); ArgumentNullException.ThrowIfNull(value); ArgumentNullException.ThrowIfNull(options); -#else - if (writer is null) - { - throw new ArgumentNullException(nameof(writer)); - } - - if (options is null) - { - throw new ArgumentNullException(nameof(options)); - } -#endif if (value is null || value.Count == 0) { @@ -146,42 +122,28 @@ public override void Write(Utf8JsonWriter writer, IValues value, JsonSerializerO /// The JSON serializer options. public virtual void WriteObject(Utf8JsonWriter writer, object? value, JsonSerializerOptions options) { -#if NET ArgumentNullException.ThrowIfNull(writer); ArgumentNullException.ThrowIfNull(options); -#else - if (writer is null) - { - throw new ArgumentNullException(nameof(writer)); - } - - if (options is null) - { - throw new ArgumentNullException(nameof(options)); - } -#endif - if (value is null) - { - writer.WriteNullValue(); - } - else if (value is TimeSpan timeSpan) - { - // System.Text.Json won't support timespans as time of day. See https://github.com/dotnet/runtime/issues/29932 - writer.WriteStringValue(timeSpan.ToString("c", CultureInfo.InvariantCulture)); - } - else if (value is decimal decimalNumber) + switch (value) { - // TODO: Potential unnecessary allocation - may be able to write to a stackalloc span. - writer.WriteRawValue(decimalNumber.ToString("G0", CultureInfo.InvariantCulture)); - } - else if (value is double doubleNumber) - { - writer.WriteRawValue(doubleNumber.ToString("G0", CultureInfo.InvariantCulture)); - } - else - { - JsonSerializer.Serialize(writer, value, value.GetType(), options); + case null: + writer.WriteNullValue(); + break; + case TimeSpan timeSpan: + // System.Text.Json won't support timespans as time of day. See https://github.com/dotnet/runtime/issues/29932 + writer.WriteStringValue(timeSpan.ToString("c", CultureInfo.InvariantCulture)); + break; + case decimal decimalNumber: + // TODO: Potential unnecessary allocation - may be able to write to a stackalloc span. + writer.WriteRawValue(decimalNumber.ToString("G0", CultureInfo.InvariantCulture)); + break; + case double doubleNumber: + writer.WriteRawValue(doubleNumber.ToString("G0", CultureInfo.InvariantCulture)); + break; + default: + JsonSerializer.Serialize(writer, value, value.GetType(), options); + break; } } @@ -201,7 +163,7 @@ public virtual void WriteObject(Utf8JsonWriter writer, object? value, JsonSerial var targetType = targetTypes[i]; if (targetType.IsAssignableFrom(explicitType)) { - return objectRoot.Deserialize(explicitType!, options); + return objectRoot.Deserialize(explicitType, options); } } } @@ -217,13 +179,10 @@ public virtual void WriteObject(Utf8JsonWriter writer, object? value, JsonSerial // If the target is an interface, attempt to identify concrete target var localTargetType = underlyingTargetType; var typeInfo = localTargetType.GetTypeInfo(); -#if NETCOREAPP3_0_OR_GREATER + if (typeInfo.IsInterface && TryGetConcreteType(typeInfo.Name[1..], out var concreteType)) -#else - if (typeInfo.IsInterface && TryGetConcreteType(typeInfo.Name.Substring(1), out var concreteType)) -#endif { - localTargetType = concreteType!; + localTargetType = concreteType; } return objectRoot.Deserialize(localTargetType, options); @@ -456,10 +415,7 @@ private static bool TryProcessTokenAsType(ref Utf8JsonReader reader, Type target private static bool TryGetConcreteType( string typeName, -#if NETCOREAPP3_1_OR_GREATER - [NotNullWhen(true)] -#endif - out Type? type) + [NotNullWhen(true)] out Type? type) { if (BuiltInThingTypeLookup.TryGetValue(typeName, out type)) { diff --git a/Source/Common/Values{T1,T2,T3,T4,T5,T6,T7}.cs b/Source/Schema.NET.Common/Values{T1,T2,T3,T4,T5,T6,T7}.cs similarity index 99% rename from Source/Common/Values{T1,T2,T3,T4,T5,T6,T7}.cs rename to Source/Schema.NET.Common/Values{T1,T2,T3,T4,T5,T6,T7}.cs index 7d161ab4..9286aaed 100644 --- a/Source/Common/Values{T1,T2,T3,T4,T5,T6,T7}.cs +++ b/Source/Schema.NET.Common/Values{T1,T2,T3,T4,T5,T6,T7}.cs @@ -189,14 +189,7 @@ public Values(params object?[] items) /// The items. public Values(IEnumerable items) { -#if NET ArgumentNullException.ThrowIfNull(items); -#else - if (items is null) - { - throw new ArgumentNullException(nameof(items)); - } -#endif List? items1 = null; List? items2 = null; diff --git a/Source/Common/Values{T1,T2,T3,T4,T5,T6}.cs b/Source/Schema.NET.Common/Values{T1,T2,T3,T4,T5,T6}.cs similarity index 99% rename from Source/Common/Values{T1,T2,T3,T4,T5,T6}.cs rename to Source/Schema.NET.Common/Values{T1,T2,T3,T4,T5,T6}.cs index 86615dcf..077e35f2 100644 --- a/Source/Common/Values{T1,T2,T3,T4,T5,T6}.cs +++ b/Source/Schema.NET.Common/Values{T1,T2,T3,T4,T5,T6}.cs @@ -154,14 +154,7 @@ public Values(params object?[] items) /// The items. public Values(IEnumerable items) { -#if NET ArgumentNullException.ThrowIfNull(items); -#else - if (items is null) - { - throw new ArgumentNullException(nameof(items)); - } -#endif List? items1 = null; List? items2 = null; diff --git a/Source/Common/Values{T1,T2,T3,T4,T5}.cs b/Source/Schema.NET.Common/Values{T1,T2,T3,T4,T5}.cs similarity index 99% rename from Source/Common/Values{T1,T2,T3,T4,T5}.cs rename to Source/Schema.NET.Common/Values{T1,T2,T3,T4,T5}.cs index f71464e5..9b9f3659 100644 --- a/Source/Common/Values{T1,T2,T3,T4,T5}.cs +++ b/Source/Schema.NET.Common/Values{T1,T2,T3,T4,T5}.cs @@ -123,14 +123,7 @@ public Values(params object?[] items) /// The items. public Values(IEnumerable items) { -#if NET ArgumentNullException.ThrowIfNull(items); -#else - if (items is null) - { - throw new ArgumentNullException(nameof(items)); - } -#endif List? items1 = null; List? items2 = null; diff --git a/Source/Common/Values{T1,T2,T3,T4}.cs b/Source/Schema.NET.Common/Values{T1,T2,T3,T4}.cs similarity index 99% rename from Source/Common/Values{T1,T2,T3,T4}.cs rename to Source/Schema.NET.Common/Values{T1,T2,T3,T4}.cs index 1d2d5db4..cdda0075 100644 --- a/Source/Common/Values{T1,T2,T3,T4}.cs +++ b/Source/Schema.NET.Common/Values{T1,T2,T3,T4}.cs @@ -96,14 +96,7 @@ public Values(params object?[] items) /// The items. public Values(IEnumerable items) { -#if NET ArgumentNullException.ThrowIfNull(items); -#else - if (items is null) - { - throw new ArgumentNullException(nameof(items)); - } -#endif List? items1 = null; List? items2 = null; diff --git a/Source/Common/Values{T1,T2,T3}.cs b/Source/Schema.NET.Common/Values{T1,T2,T3}.cs similarity index 99% rename from Source/Common/Values{T1,T2,T3}.cs rename to Source/Schema.NET.Common/Values{T1,T2,T3}.cs index 59a87684..91ca5327 100644 --- a/Source/Common/Values{T1,T2,T3}.cs +++ b/Source/Schema.NET.Common/Values{T1,T2,T3}.cs @@ -73,14 +73,7 @@ public Values(params object?[] items) /// The items. public Values(IEnumerable items) { -#if NET ArgumentNullException.ThrowIfNull(items); -#else - if (items is null) - { - throw new ArgumentNullException(nameof(items)); - } -#endif List? items1 = null; List? items2 = null; diff --git a/Source/Common/Values{T1,T2}.cs b/Source/Schema.NET.Common/Values{T1,T2}.cs similarity index 98% rename from Source/Common/Values{T1,T2}.cs rename to Source/Schema.NET.Common/Values{T1,T2}.cs index 5036f81e..1d49be1d 100644 --- a/Source/Common/Values{T1,T2}.cs +++ b/Source/Schema.NET.Common/Values{T1,T2}.cs @@ -54,14 +54,7 @@ public Values(params object?[] items) /// The items. public Values(IEnumerable items) { -#if NET ArgumentNullException.ThrowIfNull(items); -#else - if (items is null) - { - throw new ArgumentNullException(nameof(items)); - } -#endif List? items1 = null; List? items2 = null; diff --git a/Source/Schema.NET.Common/packages.lock.json b/Source/Schema.NET.Common/packages.lock.json new file mode 100644 index 00000000..03eccfa5 --- /dev/null +++ b/Source/Schema.NET.Common/packages.lock.json @@ -0,0 +1,136 @@ +{ + "version": 1, + "dependencies": { + "net10.0": { + "DotNet.ReproducibleBuilds": { + "type": "Direct", + "requested": "[1.2.39, )", + "resolved": "1.2.39", + "contentHash": "fcFN01tDTIQqDuTwr1jUQK/geofiwjG5DycJQOnC72i1SsLAk1ELe+apBOuZ11UMQG8YKFZG1FgvjZPbqHyatg==" + }, + "Microsoft.CodeAnalysis.CSharp": { + "type": "Direct", + "requested": "[4.14.0, )", + "resolved": "4.14.0", + "contentHash": "568a6wcTivauIhbeWcCwfWwIn7UV7MeHEBvFB2uzGIpM2OhJ4eM/FZ8KS0yhPoNxnSpjGzz7x7CIjTxhslojQA==", + "dependencies": { + "Microsoft.CodeAnalysis.Analyzers": "3.11.0", + "Microsoft.CodeAnalysis.Common": "[4.14.0]", + "System.Collections.Immutable": "9.0.0", + "System.Reflection.Metadata": "9.0.0" + } + }, + "MinVer": { + "type": "Direct", + "requested": "[6.0.0, )", + "resolved": "6.0.0", + "contentHash": "+/SsmiySsXJlvQLCGBqaZKNVt3s/Y/HbAdwtop7Km2CnuZbaScoqkWJEBQ5Cy9ebkn6kCYKrHsXgwrFdTgcb3g==" + }, + "System.Text.Json": { + "type": "Direct", + "requested": "[10.0.0, )", + "resolved": "10.0.0", + "contentHash": "1Dpjwq9peG/Wt5BNbrzIhTpclfOSqBWZsUO28vVr59yQlkvL5jLBWfpfzRmJ1OY+6DciaY0DUcltyzs4fuZHjw==" + }, + "Microsoft.CodeAnalysis.Analyzers": { + "type": "Transitive", + "resolved": "3.11.0", + "contentHash": "v/EW3UE8/lbEYHoC2Qq7AR/DnmvpgdtAMndfQNmpuIMx/Mto8L5JnuCfdBYtgvalQOtfNCnxFejxuRrryvUTsg==" + }, + "Microsoft.CodeAnalysis.Common": { + "type": "Transitive", + "resolved": "4.14.0", + "contentHash": "PC3tuwZYnC+idaPuoC/AZpEdwrtX7qFpmnrfQkgobGIWiYmGi5MCRtl5mx6QrfMGQpK78X2lfIEoZDLg/qnuHg==", + "dependencies": { + "Microsoft.CodeAnalysis.Analyzers": "3.11.0", + "System.Collections.Immutable": "9.0.0", + "System.Reflection.Metadata": "9.0.0" + } + }, + "System.Collections.Immutable": { + "type": "Transitive", + "resolved": "9.0.0", + "contentHash": "QhkXUl2gNrQtvPmtBTQHb0YsUrDiDQ2QS09YbtTTiSjGcf7NBqtYbrG/BE06zcBPCKEwQGzIv13IVdXNOSub2w==" + }, + "System.Reflection.Metadata": { + "type": "Transitive", + "resolved": "9.0.0", + "contentHash": "ANiqLu3DxW9kol/hMmTWbt3414t9ftdIuiIU7j80okq2YzAueo120M442xk1kDJWtmZTqWQn7wHDvMRipVOEOQ==" + } + }, + "net8.0": { + "DotNet.ReproducibleBuilds": { + "type": "Direct", + "requested": "[1.2.39, )", + "resolved": "1.2.39", + "contentHash": "fcFN01tDTIQqDuTwr1jUQK/geofiwjG5DycJQOnC72i1SsLAk1ELe+apBOuZ11UMQG8YKFZG1FgvjZPbqHyatg==" + }, + "Microsoft.CodeAnalysis.CSharp": { + "type": "Direct", + "requested": "[4.14.0, )", + "resolved": "4.14.0", + "contentHash": "568a6wcTivauIhbeWcCwfWwIn7UV7MeHEBvFB2uzGIpM2OhJ4eM/FZ8KS0yhPoNxnSpjGzz7x7CIjTxhslojQA==", + "dependencies": { + "Microsoft.CodeAnalysis.Analyzers": "3.11.0", + "Microsoft.CodeAnalysis.Common": "[4.14.0]", + "System.Collections.Immutable": "9.0.0", + "System.Reflection.Metadata": "9.0.0" + } + }, + "MinVer": { + "type": "Direct", + "requested": "[6.0.0, )", + "resolved": "6.0.0", + "contentHash": "+/SsmiySsXJlvQLCGBqaZKNVt3s/Y/HbAdwtop7Km2CnuZbaScoqkWJEBQ5Cy9ebkn6kCYKrHsXgwrFdTgcb3g==" + }, + "System.Text.Json": { + "type": "Direct", + "requested": "[10.0.0, )", + "resolved": "10.0.0", + "contentHash": "1Dpjwq9peG/Wt5BNbrzIhTpclfOSqBWZsUO28vVr59yQlkvL5jLBWfpfzRmJ1OY+6DciaY0DUcltyzs4fuZHjw==", + "dependencies": { + "System.IO.Pipelines": "10.0.0", + "System.Text.Encodings.Web": "10.0.0" + } + }, + "Microsoft.CodeAnalysis.Analyzers": { + "type": "Transitive", + "resolved": "3.11.0", + "contentHash": "v/EW3UE8/lbEYHoC2Qq7AR/DnmvpgdtAMndfQNmpuIMx/Mto8L5JnuCfdBYtgvalQOtfNCnxFejxuRrryvUTsg==" + }, + "Microsoft.CodeAnalysis.Common": { + "type": "Transitive", + "resolved": "4.14.0", + "contentHash": "PC3tuwZYnC+idaPuoC/AZpEdwrtX7qFpmnrfQkgobGIWiYmGi5MCRtl5mx6QrfMGQpK78X2lfIEoZDLg/qnuHg==", + "dependencies": { + "Microsoft.CodeAnalysis.Analyzers": "3.11.0", + "System.Collections.Immutable": "9.0.0", + "System.Reflection.Metadata": "9.0.0" + } + }, + "System.Collections.Immutable": { + "type": "Transitive", + "resolved": "9.0.0", + "contentHash": "QhkXUl2gNrQtvPmtBTQHb0YsUrDiDQ2QS09YbtTTiSjGcf7NBqtYbrG/BE06zcBPCKEwQGzIv13IVdXNOSub2w==" + }, + "System.IO.Pipelines": { + "type": "Transitive", + "resolved": "10.0.0", + "contentHash": "M1eb3nfXntaRJPrrMVM9EFS8I1bDTnt0uvUS6QP/SicZf/ZZjydMD5NiXxfmwW/uQwaMDP/yX2P+zQN1NBHChg==" + }, + "System.Reflection.Metadata": { + "type": "Transitive", + "resolved": "9.0.0", + "contentHash": "ANiqLu3DxW9kol/hMmTWbt3414t9ftdIuiIU7j80okq2YzAueo120M442xk1kDJWtmZTqWQn7wHDvMRipVOEOQ==", + "dependencies": { + "System.Collections.Immutable": "9.0.0" + } + }, + "System.Text.Encodings.Web": { + "type": "Transitive", + "resolved": "10.0.0", + "contentHash": "257hh1ep1Gqm1Lm0ulxf7vVBVMJuGN6EL4xSWjpi46DffXzm1058IiWsfSC06zSm7SniN+Tb5160UnXsSa8rRg==" + } + } + } +} \ No newline at end of file diff --git a/Source/Schema.NET.Pending/Schema.NET.Pending.csproj b/Source/Schema.NET.Pending/Schema.NET.Pending.csproj index 76e195ab..c0e0f918 100644 --- a/Source/Schema.NET.Pending/Schema.NET.Pending.csproj +++ b/Source/Schema.NET.Pending/Schema.NET.Pending.csproj @@ -1,9 +1,7 @@ - net8.0;netstandard2.0 - True - $(BaseIntermediateOutputPath)\GeneratedFiles + net10.0;net8.0 True @@ -14,30 +12,13 @@ true - - - - - - - - - - + - - - - - - - - - - + + diff --git a/Source/Schema.NET.Pending/packages.lock.json b/Source/Schema.NET.Pending/packages.lock.json index 5e6e229a..5529bdef 100644 --- a/Source/Schema.NET.Pending/packages.lock.json +++ b/Source/Schema.NET.Pending/packages.lock.json @@ -1,18 +1,12 @@ { "version": 1, "dependencies": { - ".NETStandard,Version=v2.0": { + "net10.0": { "DotNet.ReproducibleBuilds": { "type": "Direct", - "requested": "[1.1.1, )", - "resolved": "1.1.1", - "contentHash": "+H2t/t34h6mhEoUvHi8yGXyuZ2GjSovcGYehJrS2MDm2XgmPfZL2Sdxg+uL2lKgZ4M6tTwKHIlxOob2bgh0NRQ==", - "dependencies": { - "Microsoft.SourceLink.AzureRepos.Git": "1.1.1", - "Microsoft.SourceLink.Bitbucket.Git": "1.1.1", - "Microsoft.SourceLink.GitHub": "1.1.1", - "Microsoft.SourceLink.GitLab": "1.1.1" - } + "requested": "[1.2.39, )", + "resolved": "1.2.39", + "contentHash": "fcFN01tDTIQqDuTwr1jUQK/geofiwjG5DycJQOnC72i1SsLAk1ELe+apBOuZ11UMQG8YKFZG1FgvjZPbqHyatg==" }, "Microsoft.CodeAnalysis.CSharp": { "type": "Direct", @@ -22,70 +16,21 @@ "dependencies": { "Microsoft.CodeAnalysis.Analyzers": "3.11.0", "Microsoft.CodeAnalysis.Common": "[4.14.0]", - "System.Buffers": "4.5.1", "System.Collections.Immutable": "9.0.0", - "System.Memory": "4.5.5", - "System.Numerics.Vectors": "4.5.0", - "System.Reflection.Metadata": "9.0.0", - "System.Runtime.CompilerServices.Unsafe": "6.0.0", - "System.Text.Encoding.CodePages": "7.0.0", - "System.Threading.Tasks.Extensions": "4.5.4" + "System.Reflection.Metadata": "9.0.0" } }, - "Microsoft.CodeAnalysis.NetAnalyzers": { - "type": "Direct", - "requested": "[8.0.0, )", - "resolved": "8.0.0", - "contentHash": "DxiTgkCl3CGq1rYmBX2wjY7XGbxiBdL4J+/AJIAFLKy5z70NxhnVRnPghnicXZ8oF6JKVXlW3xwznRbI3ioEKg==" - }, - "Microsoft.VisualStudio.Threading.Analyzers": { - "type": "Direct", - "requested": "[17.12.19, )", - "resolved": "17.12.19", - "contentHash": "v3IYeedjoktvZ+GqYmLudxZJngmf/YWIxNT2Uy6QMMN19cvw+nkWoip1Gr1RtnFkUo1MPUVMis4C8Kj8d8DpSQ==" - }, "MinVer": { "type": "Direct", - "requested": "[4.3.0, )", - "resolved": "4.3.0", - "contentHash": "YNVAW3loCFW4kTwensApaZUl+7xREK75QQNOFSbsbXx2sCSm9/IHBjUHsJGn3u0UA5r/sAqrdYBNUlOFfLhUrA==" - }, - "NETStandard.Library": { - "type": "Direct", - "requested": "[2.0.3, )", - "resolved": "2.0.3", - "contentHash": "st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0" - } + "requested": "[6.0.0, )", + "resolved": "6.0.0", + "contentHash": "+/SsmiySsXJlvQLCGBqaZKNVt3s/Y/HbAdwtop7Km2CnuZbaScoqkWJEBQ5Cy9ebkn6kCYKrHsXgwrFdTgcb3g==" }, "System.Text.Json": { "type": "Direct", "requested": "[10.0.0, )", "resolved": "10.0.0", - "contentHash": "1Dpjwq9peG/Wt5BNbrzIhTpclfOSqBWZsUO28vVr59yQlkvL5jLBWfpfzRmJ1OY+6DciaY0DUcltyzs4fuZHjw==", - "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "10.0.0", - "System.Buffers": "4.6.1", - "System.IO.Pipelines": "10.0.0", - "System.Memory": "4.6.3", - "System.Runtime.CompilerServices.Unsafe": "6.1.2", - "System.Text.Encodings.Web": "10.0.0", - "System.Threading.Tasks.Extensions": "4.6.3" - } - }, - "Microsoft.Bcl.AsyncInterfaces": { - "type": "Transitive", - "resolved": "10.0.0", - "contentHash": "vFuwSLj9QJBbNR0NeNO4YVASUbokxs+i/xbuu8B+Fs4FAZg5QaFa6eGrMaRqTzzNI5tAb97T7BhSxtLckFyiRA==", - "dependencies": { - "System.Threading.Tasks.Extensions": "4.6.3" - } - }, - "Microsoft.Build.Tasks.Git": { - "type": "Transitive", - "resolved": "1.1.1", - "contentHash": "AT3HlgTjsqHnWpBHSNeR0KxbLZD7bztlZVj7I8vgeYG9SYqbeFGh0TM/KVtC6fg53nrWHl3VfZFvb5BiQFcY6Q==" + "contentHash": "1Dpjwq9peG/Wt5BNbrzIhTpclfOSqBWZsUO28vVr59yQlkvL5jLBWfpfzRmJ1OY+6DciaY0DUcltyzs4fuZHjw==" }, "Microsoft.CodeAnalysis.Analyzers": { "type": "Transitive", @@ -98,140 +43,27 @@ "contentHash": "PC3tuwZYnC+idaPuoC/AZpEdwrtX7qFpmnrfQkgobGIWiYmGi5MCRtl5mx6QrfMGQpK78X2lfIEoZDLg/qnuHg==", "dependencies": { "Microsoft.CodeAnalysis.Analyzers": "3.11.0", - "System.Buffers": "4.5.1", "System.Collections.Immutable": "9.0.0", - "System.Memory": "4.5.5", - "System.Numerics.Vectors": "4.5.0", - "System.Reflection.Metadata": "9.0.0", - "System.Runtime.CompilerServices.Unsafe": "6.0.0", - "System.Text.Encoding.CodePages": "7.0.0", - "System.Threading.Tasks.Extensions": "4.5.4" - } - }, - "Microsoft.NETCore.Platforms": { - "type": "Transitive", - "resolved": "1.1.0", - "contentHash": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==" - }, - "Microsoft.SourceLink.AzureRepos.Git": { - "type": "Transitive", - "resolved": "1.1.1", - "contentHash": "qB5urvw9LO2bG3eVAkuL+2ughxz2rR7aYgm2iyrB8Rlk9cp2ndvGRCvehk3rNIhRuNtQaeKwctOl1KvWiklv5w==", - "dependencies": { - "Microsoft.Build.Tasks.Git": "1.1.1", - "Microsoft.SourceLink.Common": "1.1.1" - } - }, - "Microsoft.SourceLink.Bitbucket.Git": { - "type": "Transitive", - "resolved": "1.1.1", - "contentHash": "cDzxXwlyWpLWaH0em4Idj0H3AmVo3L/6xRXKssYemx+7W52iNskj/SQ4FOmfCb8YQt39otTDNMveCZzYtMoucQ==", - "dependencies": { - "Microsoft.Build.Tasks.Git": "1.1.1", - "Microsoft.SourceLink.Common": "1.1.1" - } - }, - "Microsoft.SourceLink.Common": { - "type": "Transitive", - "resolved": "1.1.1", - "contentHash": "WMcGpWKrmJmzrNeuaEb23bEMnbtR/vLmvZtkAP5qWu7vQsY59GqfRJd65sFpBszbd2k/bQ8cs8eWawQKAabkVg==" - }, - "Microsoft.SourceLink.GitHub": { - "type": "Transitive", - "resolved": "1.1.1", - "contentHash": "IaJGnOv/M7UQjRJks7B6p7pbPnOwisYGOIzqCz5ilGFTApZ3ktOR+6zJ12ZRPInulBmdAf1SrGdDG2MU8g6XTw==", - "dependencies": { - "Microsoft.Build.Tasks.Git": "1.1.1", - "Microsoft.SourceLink.Common": "1.1.1" - } - }, - "Microsoft.SourceLink.GitLab": { - "type": "Transitive", - "resolved": "1.1.1", - "contentHash": "tvsg47DDLqqedlPeYVE2lmiTpND8F0hkrealQ5hYltSmvruy/Gr5nHAKSsjyw5L3NeM/HLMI5ORv7on/M4qyZw==", - "dependencies": { - "Microsoft.Build.Tasks.Git": "1.1.1", - "Microsoft.SourceLink.Common": "1.1.1" + "System.Reflection.Metadata": "9.0.0" } }, - "System.Buffers": { - "type": "Transitive", - "resolved": "4.6.1", - "contentHash": "N8GXpmiLMtljq7gwvyS+1QvKT/W2J8sNAvx+HVg4NGmsG/H+2k/y9QI23auLJRterrzCiDH+IWAw4V/GPwsMlw==" - }, "System.Collections.Immutable": { "type": "Transitive", "resolved": "9.0.0", - "contentHash": "QhkXUl2gNrQtvPmtBTQHb0YsUrDiDQ2QS09YbtTTiSjGcf7NBqtYbrG/BE06zcBPCKEwQGzIv13IVdXNOSub2w==", - "dependencies": { - "System.Memory": "4.5.5", - "System.Runtime.CompilerServices.Unsafe": "6.0.0" - } - }, - "System.IO.Pipelines": { - "type": "Transitive", - "resolved": "10.0.0", - "contentHash": "M1eb3nfXntaRJPrrMVM9EFS8I1bDTnt0uvUS6QP/SicZf/ZZjydMD5NiXxfmwW/uQwaMDP/yX2P+zQN1NBHChg==", - "dependencies": { - "System.Buffers": "4.6.1", - "System.Memory": "4.6.3", - "System.Threading.Tasks.Extensions": "4.6.3" - } - }, - "System.Memory": { - "type": "Transitive", - "resolved": "4.6.3", - "contentHash": "qdcDOgnFZY40+Q9876JUHnlHu7bosOHX8XISRoH94fwk6hgaeQGSgfZd8srWRZNt5bV9ZW2TljcegDNxsf+96A==", - "dependencies": { - "System.Buffers": "4.6.1", - "System.Numerics.Vectors": "4.6.1", - "System.Runtime.CompilerServices.Unsafe": "6.1.2" - } - }, - "System.Numerics.Vectors": { - "type": "Transitive", - "resolved": "4.6.1", - "contentHash": "sQxefTnhagrhoq2ReR0D/6K0zJcr9Hrd6kikeXsA1I8kOCboTavcUC4r7TSfpKFeE163uMuxZcyfO1mGO3EN8Q==" + "contentHash": "QhkXUl2gNrQtvPmtBTQHb0YsUrDiDQ2QS09YbtTTiSjGcf7NBqtYbrG/BE06zcBPCKEwQGzIv13IVdXNOSub2w==" }, "System.Reflection.Metadata": { "type": "Transitive", "resolved": "9.0.0", - "contentHash": "ANiqLu3DxW9kol/hMmTWbt3414t9ftdIuiIU7j80okq2YzAueo120M442xk1kDJWtmZTqWQn7wHDvMRipVOEOQ==", - "dependencies": { - "System.Collections.Immutable": "9.0.0", - "System.Memory": "4.5.5" - } - }, - "System.Runtime.CompilerServices.Unsafe": { - "type": "Transitive", - "resolved": "6.1.2", - "contentHash": "2hBr6zdbIBTDE3EhK7NSVNdX58uTK6iHW/P/Axmm9sl1xoGSLqDvMtpecn226TNwHByFokYwJmt/aQQNlO5CRw==" - }, - "System.Text.Encoding.CodePages": { - "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "LSyCblMpvOe0N3E+8e0skHcrIhgV2huaNcjUUEa8hRtgEAm36aGkRoC8Jxlb6Ra6GSfF29ftduPNywin8XolzQ==", - "dependencies": { - "System.Memory": "4.5.5", - "System.Runtime.CompilerServices.Unsafe": "6.0.0" - } - }, - "System.Text.Encodings.Web": { - "type": "Transitive", - "resolved": "10.0.0", - "contentHash": "257hh1ep1Gqm1Lm0ulxf7vVBVMJuGN6EL4xSWjpi46DffXzm1058IiWsfSC06zSm7SniN+Tb5160UnXsSa8rRg==", - "dependencies": { - "System.Buffers": "4.6.1", - "System.Memory": "4.6.3", - "System.Runtime.CompilerServices.Unsafe": "6.1.2" - } + "contentHash": "ANiqLu3DxW9kol/hMmTWbt3414t9ftdIuiIU7j80okq2YzAueo120M442xk1kDJWtmZTqWQn7wHDvMRipVOEOQ==" }, - "System.Threading.Tasks.Extensions": { - "type": "Transitive", - "resolved": "4.6.3", - "contentHash": "7sCiwilJLYbTZELaKnc7RecBBXWXA+xMLQWZKWawBxYjp6DBlSE3v9/UcvKBvr1vv2tTOhipiogM8rRmxlhrVA==", + "schema.net.common": { + "type": "Project", "dependencies": { - "System.Runtime.CompilerServices.Unsafe": "6.1.2" + "DotNet.ReproducibleBuilds": "[1.2.39, )", + "Microsoft.CodeAnalysis.CSharp": "[4.14.0, )", + "MinVer": "[6.0.0, )", + "System.Text.Json": "[10.0.0, )" } } }, @@ -254,18 +86,6 @@ "System.Reflection.Metadata": "9.0.0" } }, - "Microsoft.CodeAnalysis.NetAnalyzers": { - "type": "Direct", - "requested": "[10.0.100, )", - "resolved": "10.0.100", - "contentHash": "uj9VuyvqylnNueJfU7u2PkI/hEMpZl8Wg9BXyI0eatNEldU5jDYPdwsM8aDL18+1oLovju25MiqOPaGRBnG72A==" - }, - "Microsoft.VisualStudio.Threading.Analyzers": { - "type": "Direct", - "requested": "[17.14.15, )", - "resolved": "17.14.15", - "contentHash": "mXQPJsbuUD2ydq4/ffd8h8tSOFCXec+2xJOVNCvXjuMOq/+5EKHq3D2m2MC2+nUaXeFMSt66VS/J4HdKBixgcw==" - }, "MinVer": { "type": "Direct", "requested": "[6.0.0, )", @@ -319,6 +139,15 @@ "type": "Transitive", "resolved": "10.0.0", "contentHash": "257hh1ep1Gqm1Lm0ulxf7vVBVMJuGN6EL4xSWjpi46DffXzm1058IiWsfSC06zSm7SniN+Tb5160UnXsSa8rRg==" + }, + "schema.net.common": { + "type": "Project", + "dependencies": { + "DotNet.ReproducibleBuilds": "[1.2.39, )", + "Microsoft.CodeAnalysis.CSharp": "[4.14.0, )", + "MinVer": "[6.0.0, )", + "System.Text.Json": "[10.0.0, )" + } } } } diff --git a/Source/Schema.NET/Schema.NET.csproj b/Source/Schema.NET/Schema.NET.csproj index 1cf9db13..4e97d678 100644 --- a/Source/Schema.NET/Schema.NET.csproj +++ b/Source/Schema.NET/Schema.NET.csproj @@ -1,9 +1,7 @@ - net8.0;netstandard2.0 - True - $(BaseIntermediateOutputPath)\GeneratedFiles + net10.0;net8.0 False @@ -13,30 +11,13 @@ Schema;.NET;Schema.org;Schema.NET;Structured Data;Google Structured Data - - - - - - - - - - + - - - - - - - - - - + + diff --git a/Source/Schema.NET/packages.lock.json b/Source/Schema.NET/packages.lock.json index 5e6e229a..5529bdef 100644 --- a/Source/Schema.NET/packages.lock.json +++ b/Source/Schema.NET/packages.lock.json @@ -1,18 +1,12 @@ { "version": 1, "dependencies": { - ".NETStandard,Version=v2.0": { + "net10.0": { "DotNet.ReproducibleBuilds": { "type": "Direct", - "requested": "[1.1.1, )", - "resolved": "1.1.1", - "contentHash": "+H2t/t34h6mhEoUvHi8yGXyuZ2GjSovcGYehJrS2MDm2XgmPfZL2Sdxg+uL2lKgZ4M6tTwKHIlxOob2bgh0NRQ==", - "dependencies": { - "Microsoft.SourceLink.AzureRepos.Git": "1.1.1", - "Microsoft.SourceLink.Bitbucket.Git": "1.1.1", - "Microsoft.SourceLink.GitHub": "1.1.1", - "Microsoft.SourceLink.GitLab": "1.1.1" - } + "requested": "[1.2.39, )", + "resolved": "1.2.39", + "contentHash": "fcFN01tDTIQqDuTwr1jUQK/geofiwjG5DycJQOnC72i1SsLAk1ELe+apBOuZ11UMQG8YKFZG1FgvjZPbqHyatg==" }, "Microsoft.CodeAnalysis.CSharp": { "type": "Direct", @@ -22,70 +16,21 @@ "dependencies": { "Microsoft.CodeAnalysis.Analyzers": "3.11.0", "Microsoft.CodeAnalysis.Common": "[4.14.0]", - "System.Buffers": "4.5.1", "System.Collections.Immutable": "9.0.0", - "System.Memory": "4.5.5", - "System.Numerics.Vectors": "4.5.0", - "System.Reflection.Metadata": "9.0.0", - "System.Runtime.CompilerServices.Unsafe": "6.0.0", - "System.Text.Encoding.CodePages": "7.0.0", - "System.Threading.Tasks.Extensions": "4.5.4" + "System.Reflection.Metadata": "9.0.0" } }, - "Microsoft.CodeAnalysis.NetAnalyzers": { - "type": "Direct", - "requested": "[8.0.0, )", - "resolved": "8.0.0", - "contentHash": "DxiTgkCl3CGq1rYmBX2wjY7XGbxiBdL4J+/AJIAFLKy5z70NxhnVRnPghnicXZ8oF6JKVXlW3xwznRbI3ioEKg==" - }, - "Microsoft.VisualStudio.Threading.Analyzers": { - "type": "Direct", - "requested": "[17.12.19, )", - "resolved": "17.12.19", - "contentHash": "v3IYeedjoktvZ+GqYmLudxZJngmf/YWIxNT2Uy6QMMN19cvw+nkWoip1Gr1RtnFkUo1MPUVMis4C8Kj8d8DpSQ==" - }, "MinVer": { "type": "Direct", - "requested": "[4.3.0, )", - "resolved": "4.3.0", - "contentHash": "YNVAW3loCFW4kTwensApaZUl+7xREK75QQNOFSbsbXx2sCSm9/IHBjUHsJGn3u0UA5r/sAqrdYBNUlOFfLhUrA==" - }, - "NETStandard.Library": { - "type": "Direct", - "requested": "[2.0.3, )", - "resolved": "2.0.3", - "contentHash": "st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0" - } + "requested": "[6.0.0, )", + "resolved": "6.0.0", + "contentHash": "+/SsmiySsXJlvQLCGBqaZKNVt3s/Y/HbAdwtop7Km2CnuZbaScoqkWJEBQ5Cy9ebkn6kCYKrHsXgwrFdTgcb3g==" }, "System.Text.Json": { "type": "Direct", "requested": "[10.0.0, )", "resolved": "10.0.0", - "contentHash": "1Dpjwq9peG/Wt5BNbrzIhTpclfOSqBWZsUO28vVr59yQlkvL5jLBWfpfzRmJ1OY+6DciaY0DUcltyzs4fuZHjw==", - "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "10.0.0", - "System.Buffers": "4.6.1", - "System.IO.Pipelines": "10.0.0", - "System.Memory": "4.6.3", - "System.Runtime.CompilerServices.Unsafe": "6.1.2", - "System.Text.Encodings.Web": "10.0.0", - "System.Threading.Tasks.Extensions": "4.6.3" - } - }, - "Microsoft.Bcl.AsyncInterfaces": { - "type": "Transitive", - "resolved": "10.0.0", - "contentHash": "vFuwSLj9QJBbNR0NeNO4YVASUbokxs+i/xbuu8B+Fs4FAZg5QaFa6eGrMaRqTzzNI5tAb97T7BhSxtLckFyiRA==", - "dependencies": { - "System.Threading.Tasks.Extensions": "4.6.3" - } - }, - "Microsoft.Build.Tasks.Git": { - "type": "Transitive", - "resolved": "1.1.1", - "contentHash": "AT3HlgTjsqHnWpBHSNeR0KxbLZD7bztlZVj7I8vgeYG9SYqbeFGh0TM/KVtC6fg53nrWHl3VfZFvb5BiQFcY6Q==" + "contentHash": "1Dpjwq9peG/Wt5BNbrzIhTpclfOSqBWZsUO28vVr59yQlkvL5jLBWfpfzRmJ1OY+6DciaY0DUcltyzs4fuZHjw==" }, "Microsoft.CodeAnalysis.Analyzers": { "type": "Transitive", @@ -98,140 +43,27 @@ "contentHash": "PC3tuwZYnC+idaPuoC/AZpEdwrtX7qFpmnrfQkgobGIWiYmGi5MCRtl5mx6QrfMGQpK78X2lfIEoZDLg/qnuHg==", "dependencies": { "Microsoft.CodeAnalysis.Analyzers": "3.11.0", - "System.Buffers": "4.5.1", "System.Collections.Immutable": "9.0.0", - "System.Memory": "4.5.5", - "System.Numerics.Vectors": "4.5.0", - "System.Reflection.Metadata": "9.0.0", - "System.Runtime.CompilerServices.Unsafe": "6.0.0", - "System.Text.Encoding.CodePages": "7.0.0", - "System.Threading.Tasks.Extensions": "4.5.4" - } - }, - "Microsoft.NETCore.Platforms": { - "type": "Transitive", - "resolved": "1.1.0", - "contentHash": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==" - }, - "Microsoft.SourceLink.AzureRepos.Git": { - "type": "Transitive", - "resolved": "1.1.1", - "contentHash": "qB5urvw9LO2bG3eVAkuL+2ughxz2rR7aYgm2iyrB8Rlk9cp2ndvGRCvehk3rNIhRuNtQaeKwctOl1KvWiklv5w==", - "dependencies": { - "Microsoft.Build.Tasks.Git": "1.1.1", - "Microsoft.SourceLink.Common": "1.1.1" - } - }, - "Microsoft.SourceLink.Bitbucket.Git": { - "type": "Transitive", - "resolved": "1.1.1", - "contentHash": "cDzxXwlyWpLWaH0em4Idj0H3AmVo3L/6xRXKssYemx+7W52iNskj/SQ4FOmfCb8YQt39otTDNMveCZzYtMoucQ==", - "dependencies": { - "Microsoft.Build.Tasks.Git": "1.1.1", - "Microsoft.SourceLink.Common": "1.1.1" - } - }, - "Microsoft.SourceLink.Common": { - "type": "Transitive", - "resolved": "1.1.1", - "contentHash": "WMcGpWKrmJmzrNeuaEb23bEMnbtR/vLmvZtkAP5qWu7vQsY59GqfRJd65sFpBszbd2k/bQ8cs8eWawQKAabkVg==" - }, - "Microsoft.SourceLink.GitHub": { - "type": "Transitive", - "resolved": "1.1.1", - "contentHash": "IaJGnOv/M7UQjRJks7B6p7pbPnOwisYGOIzqCz5ilGFTApZ3ktOR+6zJ12ZRPInulBmdAf1SrGdDG2MU8g6XTw==", - "dependencies": { - "Microsoft.Build.Tasks.Git": "1.1.1", - "Microsoft.SourceLink.Common": "1.1.1" - } - }, - "Microsoft.SourceLink.GitLab": { - "type": "Transitive", - "resolved": "1.1.1", - "contentHash": "tvsg47DDLqqedlPeYVE2lmiTpND8F0hkrealQ5hYltSmvruy/Gr5nHAKSsjyw5L3NeM/HLMI5ORv7on/M4qyZw==", - "dependencies": { - "Microsoft.Build.Tasks.Git": "1.1.1", - "Microsoft.SourceLink.Common": "1.1.1" + "System.Reflection.Metadata": "9.0.0" } }, - "System.Buffers": { - "type": "Transitive", - "resolved": "4.6.1", - "contentHash": "N8GXpmiLMtljq7gwvyS+1QvKT/W2J8sNAvx+HVg4NGmsG/H+2k/y9QI23auLJRterrzCiDH+IWAw4V/GPwsMlw==" - }, "System.Collections.Immutable": { "type": "Transitive", "resolved": "9.0.0", - "contentHash": "QhkXUl2gNrQtvPmtBTQHb0YsUrDiDQ2QS09YbtTTiSjGcf7NBqtYbrG/BE06zcBPCKEwQGzIv13IVdXNOSub2w==", - "dependencies": { - "System.Memory": "4.5.5", - "System.Runtime.CompilerServices.Unsafe": "6.0.0" - } - }, - "System.IO.Pipelines": { - "type": "Transitive", - "resolved": "10.0.0", - "contentHash": "M1eb3nfXntaRJPrrMVM9EFS8I1bDTnt0uvUS6QP/SicZf/ZZjydMD5NiXxfmwW/uQwaMDP/yX2P+zQN1NBHChg==", - "dependencies": { - "System.Buffers": "4.6.1", - "System.Memory": "4.6.3", - "System.Threading.Tasks.Extensions": "4.6.3" - } - }, - "System.Memory": { - "type": "Transitive", - "resolved": "4.6.3", - "contentHash": "qdcDOgnFZY40+Q9876JUHnlHu7bosOHX8XISRoH94fwk6hgaeQGSgfZd8srWRZNt5bV9ZW2TljcegDNxsf+96A==", - "dependencies": { - "System.Buffers": "4.6.1", - "System.Numerics.Vectors": "4.6.1", - "System.Runtime.CompilerServices.Unsafe": "6.1.2" - } - }, - "System.Numerics.Vectors": { - "type": "Transitive", - "resolved": "4.6.1", - "contentHash": "sQxefTnhagrhoq2ReR0D/6K0zJcr9Hrd6kikeXsA1I8kOCboTavcUC4r7TSfpKFeE163uMuxZcyfO1mGO3EN8Q==" + "contentHash": "QhkXUl2gNrQtvPmtBTQHb0YsUrDiDQ2QS09YbtTTiSjGcf7NBqtYbrG/BE06zcBPCKEwQGzIv13IVdXNOSub2w==" }, "System.Reflection.Metadata": { "type": "Transitive", "resolved": "9.0.0", - "contentHash": "ANiqLu3DxW9kol/hMmTWbt3414t9ftdIuiIU7j80okq2YzAueo120M442xk1kDJWtmZTqWQn7wHDvMRipVOEOQ==", - "dependencies": { - "System.Collections.Immutable": "9.0.0", - "System.Memory": "4.5.5" - } - }, - "System.Runtime.CompilerServices.Unsafe": { - "type": "Transitive", - "resolved": "6.1.2", - "contentHash": "2hBr6zdbIBTDE3EhK7NSVNdX58uTK6iHW/P/Axmm9sl1xoGSLqDvMtpecn226TNwHByFokYwJmt/aQQNlO5CRw==" - }, - "System.Text.Encoding.CodePages": { - "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "LSyCblMpvOe0N3E+8e0skHcrIhgV2huaNcjUUEa8hRtgEAm36aGkRoC8Jxlb6Ra6GSfF29ftduPNywin8XolzQ==", - "dependencies": { - "System.Memory": "4.5.5", - "System.Runtime.CompilerServices.Unsafe": "6.0.0" - } - }, - "System.Text.Encodings.Web": { - "type": "Transitive", - "resolved": "10.0.0", - "contentHash": "257hh1ep1Gqm1Lm0ulxf7vVBVMJuGN6EL4xSWjpi46DffXzm1058IiWsfSC06zSm7SniN+Tb5160UnXsSa8rRg==", - "dependencies": { - "System.Buffers": "4.6.1", - "System.Memory": "4.6.3", - "System.Runtime.CompilerServices.Unsafe": "6.1.2" - } + "contentHash": "ANiqLu3DxW9kol/hMmTWbt3414t9ftdIuiIU7j80okq2YzAueo120M442xk1kDJWtmZTqWQn7wHDvMRipVOEOQ==" }, - "System.Threading.Tasks.Extensions": { - "type": "Transitive", - "resolved": "4.6.3", - "contentHash": "7sCiwilJLYbTZELaKnc7RecBBXWXA+xMLQWZKWawBxYjp6DBlSE3v9/UcvKBvr1vv2tTOhipiogM8rRmxlhrVA==", + "schema.net.common": { + "type": "Project", "dependencies": { - "System.Runtime.CompilerServices.Unsafe": "6.1.2" + "DotNet.ReproducibleBuilds": "[1.2.39, )", + "Microsoft.CodeAnalysis.CSharp": "[4.14.0, )", + "MinVer": "[6.0.0, )", + "System.Text.Json": "[10.0.0, )" } } }, @@ -254,18 +86,6 @@ "System.Reflection.Metadata": "9.0.0" } }, - "Microsoft.CodeAnalysis.NetAnalyzers": { - "type": "Direct", - "requested": "[10.0.100, )", - "resolved": "10.0.100", - "contentHash": "uj9VuyvqylnNueJfU7u2PkI/hEMpZl8Wg9BXyI0eatNEldU5jDYPdwsM8aDL18+1oLovju25MiqOPaGRBnG72A==" - }, - "Microsoft.VisualStudio.Threading.Analyzers": { - "type": "Direct", - "requested": "[17.14.15, )", - "resolved": "17.14.15", - "contentHash": "mXQPJsbuUD2ydq4/ffd8h8tSOFCXec+2xJOVNCvXjuMOq/+5EKHq3D2m2MC2+nUaXeFMSt66VS/J4HdKBixgcw==" - }, "MinVer": { "type": "Direct", "requested": "[6.0.0, )", @@ -319,6 +139,15 @@ "type": "Transitive", "resolved": "10.0.0", "contentHash": "257hh1ep1Gqm1Lm0ulxf7vVBVMJuGN6EL4xSWjpi46DffXzm1058IiWsfSC06zSm7SniN+Tb5160UnXsSa8rRg==" + }, + "schema.net.common": { + "type": "Project", + "dependencies": { + "DotNet.ReproducibleBuilds": "[1.2.39, )", + "Microsoft.CodeAnalysis.CSharp": "[4.14.0, )", + "MinVer": "[6.0.0, )", + "System.Text.Json": "[10.0.0, )" + } } } } diff --git a/Tests/Schema.NET.Test/OneOrManyTest.cs b/Tests/Schema.NET.Test/OneOrManyTest.cs index f69ffe13..5bd6d2ca 100644 --- a/Tests/Schema.NET.Test/OneOrManyTest.cs +++ b/Tests/Schema.NET.Test/OneOrManyTest.cs @@ -192,7 +192,7 @@ public void GetEnumerator_Enumerable_ReturnsTwo() => Assert.Equal(new List { 1, 2 }, new OneOrMany(new List { 1, 2 }).Cast()); [Fact] - public void GetEnumeratorT_NoItems_ReturnsEmptyCllection() => + public void GetEnumeratorT_NoItems_ReturnsEmptyCollection() => Assert.Equal([], default(OneOrMany).ToList()); [Fact] diff --git a/Tests/Schema.NET.Test/Schema.NET.Test.csproj b/Tests/Schema.NET.Test/Schema.NET.Test.csproj index 2ef83ffc..d03a3162 100644 --- a/Tests/Schema.NET.Test/Schema.NET.Test.csproj +++ b/Tests/Schema.NET.Test/Schema.NET.Test.csproj @@ -1,7 +1,7 @@ - net8.0;net48 + net10.0;net8.0 @@ -17,12 +17,9 @@ - + runtime; build; native; contentfiles; analyzers - - - diff --git a/Tests/Schema.NET.Test/ThingTest.cs b/Tests/Schema.NET.Test/ThingTest.cs index c21a2db7..1131aa8e 100644 --- a/Tests/Schema.NET.Test/ThingTest.cs +++ b/Tests/Schema.NET.Test/ThingTest.cs @@ -334,14 +334,14 @@ public void TryGetValue_Generic_CaseInsensitive() private static void CompareEqual(T a, T? b) { Assert.NotNull(a); - Assert.Equal(a!.GetHashCode(), b?.GetHashCode()); + Assert.Equal(a.GetHashCode(), b?.GetHashCode()); Assert.True(a.Equals(b)); } private static void CompareNotEqual(T a, T? b) { Assert.NotNull(a); - Assert.NotEqual(a!.GetHashCode(), b?.GetHashCode()); + Assert.NotEqual(a.GetHashCode(), b?.GetHashCode()); Assert.False(a.Equals(b)); } } diff --git a/Tests/Schema.NET.Test/packages.lock.json b/Tests/Schema.NET.Test/packages.lock.json index eb9aa31e..e218bfc7 100644 --- a/Tests/Schema.NET.Test/packages.lock.json +++ b/Tests/Schema.NET.Test/packages.lock.json @@ -1,7 +1,7 @@ { "version": 1, "dependencies": { - ".NETFramework,Version=v4.8": { + "net10.0": { "coverlet.collector": { "type": "Direct", "requested": "[6.0.4, )", @@ -14,19 +14,14 @@ "resolved": "7.0.2", "contentHash": "f6swYzT8DOVS6byaz1f7SYT06aoZTFXooLlJFX9Da3JB1/RLK+Z0UW1Q33NqMX+T9JFpal276qAJfPVUp96qbg==" }, - "Microsoft.CodeAnalysis.NetAnalyzers": { - "type": "Direct", - "requested": "[10.0.100, )", - "resolved": "10.0.100", - "contentHash": "uj9VuyvqylnNueJfU7u2PkI/hEMpZl8Wg9BXyI0eatNEldU5jDYPdwsM8aDL18+1oLovju25MiqOPaGRBnG72A==" - }, "Microsoft.NET.Test.Sdk": { "type": "Direct", "requested": "[18.0.1, )", "resolved": "18.0.1", "contentHash": "WNpu6vI2rA0pXY4r7NKxCN16XRWl5uHu6qjuyVLoDo6oYEggIQefrMjkRuibQHm/NslIUNCcKftvoWAN80MSAg==", "dependencies": { - "Microsoft.CodeCoverage": "18.0.1" + "Microsoft.CodeCoverage": "18.0.1", + "Microsoft.TestPlatform.TestHost": "18.0.1" } }, "Microsoft.TestPlatform.ObjectModel": { @@ -38,12 +33,6 @@ "System.Reflection.Metadata": "8.0.0" } }, - "Microsoft.VisualStudio.Threading.Analyzers": { - "type": "Direct", - "requested": "[17.14.15, )", - "resolved": "17.14.15", - "contentHash": "mXQPJsbuUD2ydq4/ffd8h8tSOFCXec+2xJOVNCvXjuMOq/+5EKHq3D2m2MC2+nUaXeFMSt66VS/J4HdKBixgcw==" - }, "MinVer": { "type": "Direct", "requested": "[6.0.0, )", @@ -56,8 +45,7 @@ "resolved": "4.20.72", "contentHash": "EA55cjyNn8eTNWrgrdZJH5QLFp2L43oxl1tlkoYUKIE9pRwL784OWiTXeCV5ApS+AMYEAlt7Fo03A2XfouvHmQ==", "dependencies": { - "Castle.Core": "5.1.1", - "System.Threading.Tasks.Extensions": "4.5.4" + "Castle.Core": "5.1.1" } }, "xunit": { @@ -73,26 +61,23 @@ }, "xunit.runner.visualstudio": { "type": "Direct", - "requested": "[2.8.2, )", - "resolved": "2.8.2", - "contentHash": "vm1tbfXhFmjFMUmS4M0J0ASXz3/U5XvXBa6DOQUL3fEz4Vt6YPhv+ESCarx6M6D+9kJkJYZKCNvJMas1+nVfmQ==", - "dependencies": { - "Microsoft.TestPlatform.ObjectModel": "17.10.0" - } + "requested": "[3.1.5, )", + "resolved": "3.1.5", + "contentHash": "tKi7dSTwP4m5m9eXPM2Ime4Kn7xNf4x4zT9sdLO/G4hZVnQCRiMTWoSZqI/pYTVeI27oPPqHBKYI/DjJ9GsYgA==" }, "Castle.Core": { "type": "Transitive", "resolved": "5.1.1", - "contentHash": "rpYtIczkzGpf+EkZgDr9CClTdemhsrwA/W5hMoPjLkRFnXzH44zDLoovXeKtmxb1ykXK9aJVODSpiJml8CTw2g==" - }, - "Microsoft.Bcl.AsyncInterfaces": { - "type": "Transitive", - "resolved": "10.0.0", - "contentHash": "vFuwSLj9QJBbNR0NeNO4YVASUbokxs+i/xbuu8B+Fs4FAZg5QaFa6eGrMaRqTzzNI5tAb97T7BhSxtLckFyiRA==", + "contentHash": "rpYtIczkzGpf+EkZgDr9CClTdemhsrwA/W5hMoPjLkRFnXzH44zDLoovXeKtmxb1ykXK9aJVODSpiJml8CTw2g==", "dependencies": { - "System.Threading.Tasks.Extensions": "4.6.3" + "System.Diagnostics.EventLog": "6.0.0" } }, + "DotNet.ReproducibleBuilds": { + "type": "Transitive", + "resolved": "1.2.39", + "contentHash": "fcFN01tDTIQqDuTwr1jUQK/geofiwjG5DycJQOnC72i1SsLAk1ELe+apBOuZ11UMQG8YKFZG1FgvjZPbqHyatg==" + }, "Microsoft.CodeAnalysis.Analyzers": { "type": "Transitive", "resolved": "3.11.0", @@ -104,14 +89,8 @@ "contentHash": "PC3tuwZYnC+idaPuoC/AZpEdwrtX7qFpmnrfQkgobGIWiYmGi5MCRtl5mx6QrfMGQpK78X2lfIEoZDLg/qnuHg==", "dependencies": { "Microsoft.CodeAnalysis.Analyzers": "3.11.0", - "System.Buffers": "4.5.1", "System.Collections.Immutable": "9.0.0", - "System.Memory": "4.5.5", - "System.Numerics.Vectors": "4.5.0", - "System.Reflection.Metadata": "9.0.0", - "System.Runtime.CompilerServices.Unsafe": "6.0.0", - "System.Text.Encoding.CodePages": "7.0.0", - "System.Threading.Tasks.Extensions": "4.5.4" + "System.Reflection.Metadata": "9.0.0" } }, "Microsoft.CodeAnalysis.CSharp": { @@ -121,14 +100,8 @@ "dependencies": { "Microsoft.CodeAnalysis.Analyzers": "3.11.0", "Microsoft.CodeAnalysis.Common": "[4.14.0]", - "System.Buffers": "4.5.1", "System.Collections.Immutable": "9.0.0", - "System.Memory": "4.5.5", - "System.Numerics.Vectors": "4.5.0", - "System.Reflection.Metadata": "9.0.0", - "System.Runtime.CompilerServices.Unsafe": "6.0.0", - "System.Text.Encoding.CodePages": "7.0.0", - "System.Threading.Tasks.Extensions": "4.5.4" + "System.Reflection.Metadata": "9.0.0" } }, "Microsoft.CodeCoverage": { @@ -136,105 +109,39 @@ "resolved": "18.0.1", "contentHash": "O+utSr97NAJowIQT/OVp3Lh9QgW/wALVTP4RG1m2AfFP4IyJmJz0ZBmFJUsRQiAPgq6IRC0t8AAzsiPIsaUDEA==" }, - "System.Buffers": { - "type": "Transitive", - "resolved": "4.6.1", - "contentHash": "N8GXpmiLMtljq7gwvyS+1QvKT/W2J8sNAvx+HVg4NGmsG/H+2k/y9QI23auLJRterrzCiDH+IWAw4V/GPwsMlw==" - }, - "System.Collections.Immutable": { + "Microsoft.TestPlatform.TestHost": { "type": "Transitive", - "resolved": "9.0.0", - "contentHash": "QhkXUl2gNrQtvPmtBTQHb0YsUrDiDQ2QS09YbtTTiSjGcf7NBqtYbrG/BE06zcBPCKEwQGzIv13IVdXNOSub2w==", + "resolved": "18.0.1", + "contentHash": "uDJKAEjFTaa2wHdWlfo6ektyoh+WD4/Eesrwb4FpBFKsLGehhACVnwwTI4qD3FrIlIEPlxdXg3SyrYRIcO+RRQ==", "dependencies": { - "System.Memory": "4.5.5", - "System.Runtime.CompilerServices.Unsafe": "6.0.0" + "Microsoft.TestPlatform.ObjectModel": "18.0.1", + "Newtonsoft.Json": "13.0.3" } }, - "System.IO.Pipelines": { + "Newtonsoft.Json": { "type": "Transitive", - "resolved": "10.0.0", - "contentHash": "M1eb3nfXntaRJPrrMVM9EFS8I1bDTnt0uvUS6QP/SicZf/ZZjydMD5NiXxfmwW/uQwaMDP/yX2P+zQN1NBHChg==", - "dependencies": { - "System.Buffers": "4.6.1", - "System.Memory": "4.6.3", - "System.Threading.Tasks.Extensions": "4.6.3" - } + "resolved": "13.0.3", + "contentHash": "HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==" }, - "System.Memory": { + "System.Collections.Immutable": { "type": "Transitive", - "resolved": "4.6.3", - "contentHash": "qdcDOgnFZY40+Q9876JUHnlHu7bosOHX8XISRoH94fwk6hgaeQGSgfZd8srWRZNt5bV9ZW2TljcegDNxsf+96A==", - "dependencies": { - "System.Buffers": "4.6.1", - "System.Numerics.Vectors": "4.6.1", - "System.Runtime.CompilerServices.Unsafe": "6.1.2" - } + "resolved": "9.0.0", + "contentHash": "QhkXUl2gNrQtvPmtBTQHb0YsUrDiDQ2QS09YbtTTiSjGcf7NBqtYbrG/BE06zcBPCKEwQGzIv13IVdXNOSub2w==" }, - "System.Numerics.Vectors": { + "System.Diagnostics.EventLog": { "type": "Transitive", - "resolved": "4.6.1", - "contentHash": "sQxefTnhagrhoq2ReR0D/6K0zJcr9Hrd6kikeXsA1I8kOCboTavcUC4r7TSfpKFeE163uMuxZcyfO1mGO3EN8Q==" + "resolved": "6.0.0", + "contentHash": "lcyUiXTsETK2ALsZrX+nWuHSIQeazhqPphLfaRxzdGaG93+0kELqpgEHtwWOlQe7+jSFnKwaCAgL4kjeZCQJnw==" }, "System.Reflection.Metadata": { "type": "Transitive", "resolved": "9.0.0", - "contentHash": "ANiqLu3DxW9kol/hMmTWbt3414t9ftdIuiIU7j80okq2YzAueo120M442xk1kDJWtmZTqWQn7wHDvMRipVOEOQ==", - "dependencies": { - "System.Collections.Immutable": "9.0.0", - "System.Memory": "4.5.5" - } - }, - "System.Runtime.CompilerServices.Unsafe": { - "type": "Transitive", - "resolved": "6.1.2", - "contentHash": "2hBr6zdbIBTDE3EhK7NSVNdX58uTK6iHW/P/Axmm9sl1xoGSLqDvMtpecn226TNwHByFokYwJmt/aQQNlO5CRw==" - }, - "System.Text.Encoding.CodePages": { - "type": "Transitive", - "resolved": "7.0.0", - "contentHash": "LSyCblMpvOe0N3E+8e0skHcrIhgV2huaNcjUUEa8hRtgEAm36aGkRoC8Jxlb6Ra6GSfF29ftduPNywin8XolzQ==", - "dependencies": { - "System.Memory": "4.5.5", - "System.Runtime.CompilerServices.Unsafe": "6.0.0" - } - }, - "System.Text.Encodings.Web": { - "type": "Transitive", - "resolved": "10.0.0", - "contentHash": "257hh1ep1Gqm1Lm0ulxf7vVBVMJuGN6EL4xSWjpi46DffXzm1058IiWsfSC06zSm7SniN+Tb5160UnXsSa8rRg==", - "dependencies": { - "System.Buffers": "4.6.1", - "System.Memory": "4.6.3", - "System.Runtime.CompilerServices.Unsafe": "6.1.2" - } + "contentHash": "ANiqLu3DxW9kol/hMmTWbt3414t9ftdIuiIU7j80okq2YzAueo120M442xk1kDJWtmZTqWQn7wHDvMRipVOEOQ==" }, "System.Text.Json": { "type": "Transitive", "resolved": "10.0.0", - "contentHash": "1Dpjwq9peG/Wt5BNbrzIhTpclfOSqBWZsUO28vVr59yQlkvL5jLBWfpfzRmJ1OY+6DciaY0DUcltyzs4fuZHjw==", - "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "10.0.0", - "System.Buffers": "4.6.1", - "System.IO.Pipelines": "10.0.0", - "System.Memory": "4.6.3", - "System.Runtime.CompilerServices.Unsafe": "6.1.2", - "System.Text.Encodings.Web": "10.0.0", - "System.Threading.Tasks.Extensions": "4.6.3", - "System.ValueTuple": "4.6.1" - } - }, - "System.Threading.Tasks.Extensions": { - "type": "Transitive", - "resolved": "4.6.3", - "contentHash": "7sCiwilJLYbTZELaKnc7RecBBXWXA+xMLQWZKWawBxYjp6DBlSE3v9/UcvKBvr1vv2tTOhipiogM8rRmxlhrVA==", - "dependencies": { - "System.Runtime.CompilerServices.Unsafe": "6.1.2" - } - }, - "System.ValueTuple": { - "type": "Transitive", - "resolved": "4.6.1", - "contentHash": "+RJT4qaekpZ7DDLhf+LTjq+E48jieKiY9ulJ+BoxKmZblIJfIJT8Ufcaa/clQqnYvWs8jugfGSMu8ylS0caG0w==" + "contentHash": "1Dpjwq9peG/Wt5BNbrzIhTpclfOSqBWZsUO28vVr59yQlkvL5jLBWfpfzRmJ1OY+6DciaY0DUcltyzs4fuZHjw==" }, "xunit.abstractions": { "type": "Transitive", @@ -279,7 +186,19 @@ "schema.net": { "type": "Project", "dependencies": { + "DotNet.ReproducibleBuilds": "[1.2.39, )", "Microsoft.CodeAnalysis.CSharp": "[4.14.0, )", + "MinVer": "[6.0.0, )", + "Schema.NET.Common": "[1.0.0, )", + "System.Text.Json": "[10.0.0, )" + } + }, + "schema.net.common": { + "type": "Project", + "dependencies": { + "DotNet.ReproducibleBuilds": "[1.2.39, )", + "Microsoft.CodeAnalysis.CSharp": "[4.14.0, )", + "MinVer": "[6.0.0, )", "System.Text.Json": "[10.0.0, )" } } @@ -297,12 +216,6 @@ "resolved": "7.0.2", "contentHash": "f6swYzT8DOVS6byaz1f7SYT06aoZTFXooLlJFX9Da3JB1/RLK+Z0UW1Q33NqMX+T9JFpal276qAJfPVUp96qbg==" }, - "Microsoft.CodeAnalysis.NetAnalyzers": { - "type": "Direct", - "requested": "[10.0.100, )", - "resolved": "10.0.100", - "contentHash": "uj9VuyvqylnNueJfU7u2PkI/hEMpZl8Wg9BXyI0eatNEldU5jDYPdwsM8aDL18+1oLovju25MiqOPaGRBnG72A==" - }, "Microsoft.NET.Test.Sdk": { "type": "Direct", "requested": "[18.0.1, )", @@ -322,12 +235,6 @@ "System.Reflection.Metadata": "8.0.0" } }, - "Microsoft.VisualStudio.Threading.Analyzers": { - "type": "Direct", - "requested": "[17.14.15, )", - "resolved": "17.14.15", - "contentHash": "mXQPJsbuUD2ydq4/ffd8h8tSOFCXec+2xJOVNCvXjuMOq/+5EKHq3D2m2MC2+nUaXeFMSt66VS/J4HdKBixgcw==" - }, "MinVer": { "type": "Direct", "requested": "[6.0.0, )", @@ -356,9 +263,9 @@ }, "xunit.runner.visualstudio": { "type": "Direct", - "requested": "[2.8.2, )", - "resolved": "2.8.2", - "contentHash": "vm1tbfXhFmjFMUmS4M0J0ASXz3/U5XvXBa6DOQUL3fEz4Vt6YPhv+ESCarx6M6D+9kJkJYZKCNvJMas1+nVfmQ==" + "requested": "[3.1.5, )", + "resolved": "3.1.5", + "contentHash": "tKi7dSTwP4m5m9eXPM2Ime4Kn7xNf4x4zT9sdLO/G4hZVnQCRiMTWoSZqI/pYTVeI27oPPqHBKYI/DjJ9GsYgA==" }, "Castle.Core": { "type": "Transitive", @@ -368,6 +275,11 @@ "System.Diagnostics.EventLog": "6.0.0" } }, + "DotNet.ReproducibleBuilds": { + "type": "Transitive", + "resolved": "1.2.39", + "contentHash": "fcFN01tDTIQqDuTwr1jUQK/geofiwjG5DycJQOnC72i1SsLAk1ELe+apBOuZ11UMQG8YKFZG1FgvjZPbqHyatg==" + }, "Microsoft.CodeAnalysis.Analyzers": { "type": "Transitive", "resolved": "3.11.0", @@ -493,7 +405,19 @@ "schema.net": { "type": "Project", "dependencies": { + "DotNet.ReproducibleBuilds": "[1.2.39, )", + "Microsoft.CodeAnalysis.CSharp": "[4.14.0, )", + "MinVer": "[6.0.0, )", + "Schema.NET.Common": "[1.0.0, )", + "System.Text.Json": "[10.0.0, )" + } + }, + "schema.net.common": { + "type": "Project", + "dependencies": { + "DotNet.ReproducibleBuilds": "[1.2.39, )", "Microsoft.CodeAnalysis.CSharp": "[4.14.0, )", + "MinVer": "[6.0.0, )", "System.Text.Json": "[10.0.0, )" } } diff --git a/Tools/Schema.NET.Tool/CollectionExtensions.cs b/Tools/Schema.NET.Tool/CollectionExtensions.cs index f075837b..3ef7da23 100644 --- a/Tools/Schema.NET.Tool/CollectionExtensions.cs +++ b/Tools/Schema.NET.Tool/CollectionExtensions.cs @@ -7,10 +7,6 @@ public static class CollectionExtensions { public static void AddRange(this ICollection collection, IEnumerable items) { -#if NET - ArgumentNullException.ThrowIfNull(collection); - ArgumentNullException.ThrowIfNull(items); -#else if (collection is null) { throw new ArgumentNullException(nameof(collection)); @@ -20,7 +16,6 @@ public static void AddRange(this ICollection collection, IEnumerable it { throw new ArgumentNullException(nameof(items)); } -#endif foreach (var item in items) { diff --git a/Tools/Schema.NET.Tool/CustomOverrides/AddNumberTypeToMediaObjectHeightAndWidth.cs b/Tools/Schema.NET.Tool/CustomOverrides/AddNumberTypeToMediaObjectHeightAndWidth.cs index 0630c154..5659ff35 100644 --- a/Tools/Schema.NET.Tool/CustomOverrides/AddNumberTypeToMediaObjectHeightAndWidth.cs +++ b/Tools/Schema.NET.Tool/CustomOverrides/AddNumberTypeToMediaObjectHeightAndWidth.cs @@ -9,14 +9,10 @@ public class AddNumberTypeToMediaObjectHeightAndWidth : IClassOverride { public bool CanOverride(GeneratorSchemaClass c) { -#if NET - ArgumentNullException.ThrowIfNull(c); -#else if (c is null) { throw new ArgumentNullException(nameof(c)); } -#endif return string.Equals(c.Name, "MediaObject", StringComparison.OrdinalIgnoreCase) || c.CombinationOf.Any(co => string.Equals(co.Name, "MediaObject", StringComparison.OrdinalIgnoreCase)); @@ -24,14 +20,10 @@ public bool CanOverride(GeneratorSchemaClass c) public void Override(GeneratorSchemaClass c) { -#if NET - ArgumentNullException.ThrowIfNull(c); -#else if (c is null) { throw new ArgumentNullException(nameof(c)); } -#endif c .Properties diff --git a/Tools/Schema.NET.Tool/CustomOverrides/AddQueryInputPropertyToSearchAction.cs b/Tools/Schema.NET.Tool/CustomOverrides/AddQueryInputPropertyToSearchAction.cs index 0b19362e..aab84729 100644 --- a/Tools/Schema.NET.Tool/CustomOverrides/AddQueryInputPropertyToSearchAction.cs +++ b/Tools/Schema.NET.Tool/CustomOverrides/AddQueryInputPropertyToSearchAction.cs @@ -8,28 +8,20 @@ public class AddQueryInputPropertyToSearchAction : IClassOverride { public bool CanOverride(GeneratorSchemaClass c) { -#if NET - ArgumentNullException.ThrowIfNull(c); -#else if (c is null) { throw new ArgumentNullException(nameof(c)); } -#endif return string.Equals(c.Name, "SearchAction", StringComparison.Ordinal); } public void Override(GeneratorSchemaClass c) { -#if NET - ArgumentNullException.ThrowIfNull(c); -#else if (c is null) { throw new ArgumentNullException(nameof(c)); } -#endif var property = new GeneratorSchemaProperty(c, "query-input", "QueryInput", "Gets or sets the query input search parameter."); property.Types.AddRange( diff --git a/Tools/Schema.NET.Tool/CustomOverrides/RenameEventProperty.cs b/Tools/Schema.NET.Tool/CustomOverrides/RenameEventProperty.cs index 084e29fa..5db3f994 100644 --- a/Tools/Schema.NET.Tool/CustomOverrides/RenameEventProperty.cs +++ b/Tools/Schema.NET.Tool/CustomOverrides/RenameEventProperty.cs @@ -8,28 +8,20 @@ public class RenameEventProperty : IClassOverride { public bool CanOverride(GeneratorSchemaClass c) { -#if NET - ArgumentNullException.ThrowIfNull(c); -#else if (c is null) { throw new ArgumentNullException(nameof(c)); } -#endif return c.Properties.Any(x => string.Equals(x.Name, "Event", StringComparison.OrdinalIgnoreCase)); } public void Override(GeneratorSchemaClass c) { -#if NET - ArgumentNullException.ThrowIfNull(c); -#else if (c is null) { throw new ArgumentNullException(nameof(c)); } -#endif var eventProperty = c .Properties diff --git a/Tools/Schema.NET.Tool/EnumerableExtensions.cs b/Tools/Schema.NET.Tool/EnumerableExtensions.cs index ec849674..7ddc3c75 100644 --- a/Tools/Schema.NET.Tool/EnumerableExtensions.cs +++ b/Tools/Schema.NET.Tool/EnumerableExtensions.cs @@ -8,14 +8,10 @@ public static class EnumerableExtensions { public static IEnumerable Traverse(T node, Func parent) { -#if NET - ArgumentNullException.ThrowIfNull(parent); -#else if (parent is null) { throw new ArgumentNullException(nameof(parent)); } -#endif for (var x = node; x is not null; x = parent(x)) { @@ -25,14 +21,10 @@ public static IEnumerable Traverse(T node, Func parent) public static IEnumerable Traverse(T node, Func> children) { -#if NET - ArgumentNullException.ThrowIfNull(children); -#else if (children is null) { throw new ArgumentNullException(nameof(children)); } -#endif yield return node; diff --git a/Tools/Schema.NET.Tool/GeneratorModels/GeneratorSchemaPropertyType.cs b/Tools/Schema.NET.Tool/GeneratorModels/GeneratorSchemaPropertyType.cs index 6b5e058e..36fa8194 100644 --- a/Tools/Schema.NET.Tool/GeneratorModels/GeneratorSchemaPropertyType.cs +++ b/Tools/Schema.NET.Tool/GeneratorModels/GeneratorSchemaPropertyType.cs @@ -15,7 +15,7 @@ public GeneratorSchemaPropertyType(string name, params string[] csharpTypeString public GeneratorSchemaPropertyType(string name, IEnumerable csharpTypeStrings) { this.Name = name; - this.CSharpTypeStrings = new List(csharpTypeStrings); + this.CSharpTypeStrings = [.. csharpTypeStrings]; } public ICollection CSharpTypeStrings { get; } diff --git a/Tools/Schema.NET.Tool/Repositories/SchemaPropertyJsonConverter.cs b/Tools/Schema.NET.Tool/Repositories/SchemaPropertyJsonConverter.cs index 98379325..04662d50 100644 --- a/Tools/Schema.NET.Tool/Repositories/SchemaPropertyJsonConverter.cs +++ b/Tools/Schema.NET.Tool/Repositories/SchemaPropertyJsonConverter.cs @@ -12,14 +12,10 @@ public class SchemaPropertyJsonConverter : JsonConverter> { public override List Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { -#if NET - ArgumentNullException.ThrowIfNull(typeToConvert); -#else if (typeToConvert is null) { throw new ArgumentNullException(nameof(typeToConvert)); } -#endif if (reader.TokenType == JsonTokenType.StartObject) { @@ -71,11 +67,7 @@ public override void Write(Utf8JsonWriter writer, List value, Json var layer = LayerName.Core; if (isPartOf is not null && isPartOf.Host != "schema.org") { -#if NETSTANDARD2_0 layer = isPartOf.Host.Replace(".schema.org", string.Empty); -#else - layer = isPartOf.Host.Replace(".schema.org", string.Empty, StringComparison.Ordinal); -#endif } if (types.Any(type => string.Equals(type, "rdfs:Class", StringComparison.Ordinal))) diff --git a/Tools/Schema.NET.Tool/Schema.NET.Tool.csproj b/Tools/Schema.NET.Tool/Schema.NET.Tool.csproj index 6105fc2a..50ebdddb 100644 --- a/Tools/Schema.NET.Tool/Schema.NET.Tool.csproj +++ b/Tools/Schema.NET.Tool/Schema.NET.Tool.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/Tools/Schema.NET.Tool/SchemaSourceGenerator.cs b/Tools/Schema.NET.Tool/SchemaSourceGenerator.cs index caab512b..f3a777ac 100644 --- a/Tools/Schema.NET.Tool/SchemaSourceGenerator.cs +++ b/Tools/Schema.NET.Tool/SchemaSourceGenerator.cs @@ -61,7 +61,7 @@ private static void Generate(SourceProductionContext context, (AnalyzerConfigOpt source = RenderEnumeration(schemaEnumeration); } - context.AddSource($"{schemaObject.Layer}.{schemaObject.Name}.Generated.cs", source); + context.AddSource($"{schemaObject.Layer}.{schemaObject.Name}.g.cs", source); } } } @@ -85,6 +85,7 @@ private static string RenderClass(GeneratorSchemaClass schemaClass) return $$""" + // #nullable enable namespace Schema.NET; diff --git a/Tools/Schema.NET.Tool/Services/EnumerationValueComparer.cs b/Tools/Schema.NET.Tool/Services/EnumerationValueComparer.cs index 07a24c52..693149a2 100644 --- a/Tools/Schema.NET.Tool/Services/EnumerationValueComparer.cs +++ b/Tools/Schema.NET.Tool/Services/EnumerationValueComparer.cs @@ -18,10 +18,6 @@ public class EnumerationValueComparer : IComparer public int Compare(string? x, string? y) { -#if NET - ArgumentNullException.ThrowIfNull(x); - ArgumentNullException.ThrowIfNull(y); -#else if (x is null) { throw new ArgumentNullException(nameof(x)); @@ -31,7 +27,6 @@ public int Compare(string? x, string? y) { throw new ArgumentNullException(nameof(y)); } -#endif x = x.ToUpperInvariant(); y = y.ToUpperInvariant(); diff --git a/Tools/Schema.NET.Tool/Services/PropertyNameComparer.cs b/Tools/Schema.NET.Tool/Services/PropertyNameComparer.cs index dc5daf82..7c5ac1a2 100644 --- a/Tools/Schema.NET.Tool/Services/PropertyNameComparer.cs +++ b/Tools/Schema.NET.Tool/Services/PropertyNameComparer.cs @@ -17,10 +17,6 @@ public class PropertyNameComparer : IComparer public int Compare(string? x, string? y) { -#if NET - ArgumentNullException.ThrowIfNull(x); - ArgumentNullException.ThrowIfNull(y); -#else if (x is null) { throw new ArgumentNullException(nameof(x)); @@ -30,7 +26,6 @@ public int Compare(string? x, string? y) { throw new ArgumentNullException(nameof(y)); } -#endif if (x.Equals("ENDDATE", StringComparison.Ordinal)) { diff --git a/Tools/Schema.NET.Tool/Services/SchemaService.cs b/Tools/Schema.NET.Tool/Services/SchemaService.cs index f4b1beba..bab8d408 100644 --- a/Tools/Schema.NET.Tool/Services/SchemaService.cs +++ b/Tools/Schema.NET.Tool/Services/SchemaService.cs @@ -12,13 +12,8 @@ namespace Schema.NET.Tool.Services; public partial class SchemaService { -#if NET8_0_OR_GREATER - [GeneratedRegex("^[0-9]", RegexOptions.Compiled)] - private static partial Regex StartsWithNumber(); -#else private static readonly Regex StartsWithNumberRegex = new Regex("^[0-9]", RegexOptions.Compiled); private static Regex StartsWithNumber() => StartsWithNumberRegex; -#endif private readonly IEnumerable classOverrides; private readonly IEnumerable enumerationOverrides; private readonly ISchemaRepository schemaRepository; @@ -243,11 +238,7 @@ private static GeneratorSchemaClass TranslateClass( }) .Select(id => { -#if NETSTANDARD2_0 var propertyTypeName = id.ToString().Replace("https://schema.org/", string.Empty); -#else - var propertyTypeName = id.ToString().Replace("https://schema.org/", string.Empty, StringComparison.Ordinal); -#endif var isPropertyTypeEnum = isEnumMap.Contains(propertyTypeName); var csharpTypeStrings = GetCSharpTypeStrings( propertyName, @@ -313,30 +304,16 @@ private static string[] GetCSharpTypeStrings(string propertyName, string typeNam return ["DateTimeOffset?"]; case "Integer": case "Number" when -#if NETSTANDARD2_0 propertyName.Contains("NumberOf") || propertyName.Contains("Year") || propertyName.Contains("Count") || propertyName.Contains("Age"): -#else - propertyName.Contains("NumberOf", StringComparison.Ordinal) || - propertyName.Contains("Year", StringComparison.Ordinal) || - propertyName.Contains("Count", StringComparison.Ordinal) || - propertyName.Contains("Age", StringComparison.Ordinal): -#endif return ["int?"]; case "Number" when -#if NETSTANDARD2_0 propertyName.Contains("Price") || propertyName.Contains("Amount") || propertyName.Contains("Salary") || propertyName.Contains("Discount"): -#else - propertyName.Contains("Price", StringComparison.Ordinal) || - propertyName.Contains("Amount", StringComparison.Ordinal) || - propertyName.Contains("Salary", StringComparison.Ordinal) || - propertyName.Contains("Discount", StringComparison.Ordinal): -#endif return ["decimal?"]; case "Number": return ["double?"]; diff --git a/Tools/Schema.NET.Tool/SourceUtility.cs b/Tools/Schema.NET.Tool/SourceUtility.cs index 01b24260..a0e302ff 100644 --- a/Tools/Schema.NET.Tool/SourceUtility.cs +++ b/Tools/Schema.NET.Tool/SourceUtility.cs @@ -13,14 +13,10 @@ public static partial class SourceUtility public static string Render(string value, int indent = 0) { -#if NET - ArgumentNullException.ThrowIfNull(value); -#else if (value is null) { throw new ArgumentNullException(nameof(value)); } -#endif var indentString = new string(Space, indent); return indentString + EnvironmentAgnosticNewLineReplace().Replace(value, "$1" + indentString); @@ -40,10 +36,6 @@ public static string RenderItems(bool canRender, IReadOnlyCollection items public static string RenderItems(IReadOnlyCollection items, Func action, int indent = 0, SourceDelimeter sourceDelimeter = SourceDelimeter.None) { -#if NET - ArgumentNullException.ThrowIfNull(items); - ArgumentNullException.ThrowIfNull(action); -#else if (items is null) { throw new ArgumentNullException(nameof(items)); @@ -53,7 +45,6 @@ public static string RenderItems(IReadOnlyCollection items, Func NewLineRegex; private static readonly Regex EnvironmentAgnosticNewLineRegex = new Regex("(\r?\n)", RegexOptions.Compiled); private static Regex EnvironmentAgnosticNewLineReplace() => EnvironmentAgnosticNewLineRegex; -#endif } diff --git a/Tools/Schema.NET.Tool/packages.lock.json b/Tools/Schema.NET.Tool/packages.lock.json index fdb56a06..232e2b60 100644 --- a/Tools/Schema.NET.Tool/packages.lock.json +++ b/Tools/Schema.NET.Tool/packages.lock.json @@ -4,30 +4,27 @@ ".NETStandard,Version=v2.0": { "Microsoft.CodeAnalysis.CSharp": { "type": "Direct", - "requested": "[4.5.0, )", - "resolved": "4.5.0", - "contentHash": "cM59oMKAOxvdv76bdmaKPy5hfj+oR+zxikWoueEB7CwTko7mt9sVKZI8Qxlov0C/LuKEG+WQwifepqL3vuTiBQ==", + "requested": "[4.14.0, )", + "resolved": "4.14.0", + "contentHash": "568a6wcTivauIhbeWcCwfWwIn7UV7MeHEBvFB2uzGIpM2OhJ4eM/FZ8KS0yhPoNxnSpjGzz7x7CIjTxhslojQA==", "dependencies": { - "Microsoft.CodeAnalysis.Common": "[4.5.0]" + "Microsoft.CodeAnalysis.Analyzers": "3.11.0", + "Microsoft.CodeAnalysis.Common": "[4.14.0]", + "System.Buffers": "4.5.1", + "System.Collections.Immutable": "9.0.0", + "System.Memory": "4.5.5", + "System.Numerics.Vectors": "4.5.0", + "System.Reflection.Metadata": "9.0.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Text.Encoding.CodePages": "7.0.0", + "System.Threading.Tasks.Extensions": "4.5.4" } }, - "Microsoft.CodeAnalysis.NetAnalyzers": { - "type": "Direct", - "requested": "[8.0.0, )", - "resolved": "8.0.0", - "contentHash": "DxiTgkCl3CGq1rYmBX2wjY7XGbxiBdL4J+/AJIAFLKy5z70NxhnVRnPghnicXZ8oF6JKVXlW3xwznRbI3ioEKg==" - }, - "Microsoft.VisualStudio.Threading.Analyzers": { - "type": "Direct", - "requested": "[17.12.19, )", - "resolved": "17.12.19", - "contentHash": "v3IYeedjoktvZ+GqYmLudxZJngmf/YWIxNT2Uy6QMMN19cvw+nkWoip1Gr1RtnFkUo1MPUVMis4C8Kj8d8DpSQ==" - }, "MinVer": { "type": "Direct", - "requested": "[4.3.0, )", - "resolved": "4.3.0", - "contentHash": "YNVAW3loCFW4kTwensApaZUl+7xREK75QQNOFSbsbXx2sCSm9/IHBjUHsJGn3u0UA5r/sAqrdYBNUlOFfLhUrA==" + "requested": "[6.0.0, )", + "resolved": "6.0.0", + "contentHash": "+/SsmiySsXJlvQLCGBqaZKNVt3s/Y/HbAdwtop7Km2CnuZbaScoqkWJEBQ5Cy9ebkn6kCYKrHsXgwrFdTgcb3g==" }, "NETStandard.Library": { "type": "Direct", @@ -40,42 +37,45 @@ }, "System.Text.Json": { "type": "Direct", - "requested": "[8.0.6, )", - "resolved": "8.0.6", - "contentHash": "BvSpVBsVN9b+Y+wONbvJOHd1HjXQf33+XiC28ZMOwRsYb42mz3Q8YHnpTSwpwJLqYCMqM+0UUVC3V+pi25XfkQ==", + "requested": "[10.0.0, )", + "resolved": "10.0.0", + "contentHash": "1Dpjwq9peG/Wt5BNbrzIhTpclfOSqBWZsUO28vVr59yQlkvL5jLBWfpfzRmJ1OY+6DciaY0DUcltyzs4fuZHjw==", "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "8.0.0", - "System.Buffers": "4.5.1", - "System.Memory": "4.5.5", - "System.Runtime.CompilerServices.Unsafe": "6.0.0", - "System.Text.Encodings.Web": "8.0.0", - "System.Threading.Tasks.Extensions": "4.5.4" + "Microsoft.Bcl.AsyncInterfaces": "10.0.0", + "System.Buffers": "4.6.1", + "System.IO.Pipelines": "10.0.0", + "System.Memory": "4.6.3", + "System.Runtime.CompilerServices.Unsafe": "6.1.2", + "System.Text.Encodings.Web": "10.0.0", + "System.Threading.Tasks.Extensions": "4.6.3" } }, "Microsoft.Bcl.AsyncInterfaces": { "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "3WA9q9yVqJp222P3x1wYIGDAkpjAku0TMUaaQV22g6L67AI0LdOIrVS7Ht2vJfLHGSPVuqN94vIr15qn+HEkHw==", + "resolved": "10.0.0", + "contentHash": "vFuwSLj9QJBbNR0NeNO4YVASUbokxs+i/xbuu8B+Fs4FAZg5QaFa6eGrMaRqTzzNI5tAb97T7BhSxtLckFyiRA==", "dependencies": { - "System.Threading.Tasks.Extensions": "4.5.4" + "System.Threading.Tasks.Extensions": "4.6.3" } }, "Microsoft.CodeAnalysis.Analyzers": { "type": "Transitive", - "resolved": "3.3.3", - "contentHash": "j/rOZtLMVJjrfLRlAMckJLPW/1rze9MT1yfWqSIbUPGRu1m1P0fuo9PmqapwsmePfGB5PJrudQLvmUOAMF0DqQ==" + "resolved": "3.11.0", + "contentHash": "v/EW3UE8/lbEYHoC2Qq7AR/DnmvpgdtAMndfQNmpuIMx/Mto8L5JnuCfdBYtgvalQOtfNCnxFejxuRrryvUTsg==" }, "Microsoft.CodeAnalysis.Common": { "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "lwAbIZNdnY0SUNoDmZHkVUwLO8UyNnyyh1t/4XsbFxi4Ounb3xszIYZaWhyj5ZjyfcwqwmtMbE7fUTVCqQEIdQ==", + "resolved": "4.14.0", + "contentHash": "PC3tuwZYnC+idaPuoC/AZpEdwrtX7qFpmnrfQkgobGIWiYmGi5MCRtl5mx6QrfMGQpK78X2lfIEoZDLg/qnuHg==", "dependencies": { - "Microsoft.CodeAnalysis.Analyzers": "3.3.3", - "System.Collections.Immutable": "6.0.0", + "Microsoft.CodeAnalysis.Analyzers": "3.11.0", + "System.Buffers": "4.5.1", + "System.Collections.Immutable": "9.0.0", "System.Memory": "4.5.5", - "System.Reflection.Metadata": "6.0.1", + "System.Numerics.Vectors": "4.5.0", + "System.Reflection.Metadata": "9.0.0", "System.Runtime.CompilerServices.Unsafe": "6.0.0", - "System.Text.Encoding.CodePages": "6.0.0", + "System.Text.Encoding.CodePages": "7.0.0", "System.Threading.Tasks.Extensions": "4.5.4" } }, @@ -86,71 +86,82 @@ }, "System.Buffers": { "type": "Transitive", - "resolved": "4.5.1", - "contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==" + "resolved": "4.6.1", + "contentHash": "N8GXpmiLMtljq7gwvyS+1QvKT/W2J8sNAvx+HVg4NGmsG/H+2k/y9QI23auLJRterrzCiDH+IWAw4V/GPwsMlw==" }, "System.Collections.Immutable": { "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "l4zZJ1WU2hqpQQHXz1rvC3etVZN+2DLmQMO79FhOTZHMn8tDRr+WU287sbomD0BETlmKDn0ygUgVy9k5xkkJdA==", + "resolved": "9.0.0", + "contentHash": "QhkXUl2gNrQtvPmtBTQHb0YsUrDiDQ2QS09YbtTTiSjGcf7NBqtYbrG/BE06zcBPCKEwQGzIv13IVdXNOSub2w==", "dependencies": { - "System.Memory": "4.5.4", + "System.Memory": "4.5.5", "System.Runtime.CompilerServices.Unsafe": "6.0.0" } }, + "System.IO.Pipelines": { + "type": "Transitive", + "resolved": "10.0.0", + "contentHash": "M1eb3nfXntaRJPrrMVM9EFS8I1bDTnt0uvUS6QP/SicZf/ZZjydMD5NiXxfmwW/uQwaMDP/yX2P+zQN1NBHChg==", + "dependencies": { + "System.Buffers": "4.6.1", + "System.Memory": "4.6.3", + "System.Threading.Tasks.Extensions": "4.6.3" + } + }, "System.Memory": { "type": "Transitive", - "resolved": "4.5.5", - "contentHash": "XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw==", + "resolved": "4.6.3", + "contentHash": "qdcDOgnFZY40+Q9876JUHnlHu7bosOHX8XISRoH94fwk6hgaeQGSgfZd8srWRZNt5bV9ZW2TljcegDNxsf+96A==", "dependencies": { - "System.Buffers": "4.5.1", - "System.Numerics.Vectors": "4.4.0", - "System.Runtime.CompilerServices.Unsafe": "4.5.3" + "System.Buffers": "4.6.1", + "System.Numerics.Vectors": "4.6.1", + "System.Runtime.CompilerServices.Unsafe": "6.1.2" } }, "System.Numerics.Vectors": { "type": "Transitive", - "resolved": "4.4.0", - "contentHash": "UiLzLW+Lw6HLed1Hcg+8jSRttrbuXv7DANVj0DkL9g6EnnzbL75EB7EWsw5uRbhxd/4YdG8li5XizGWepmG3PQ==" + "resolved": "4.6.1", + "contentHash": "sQxefTnhagrhoq2ReR0D/6K0zJcr9Hrd6kikeXsA1I8kOCboTavcUC4r7TSfpKFeE163uMuxZcyfO1mGO3EN8Q==" }, "System.Reflection.Metadata": { "type": "Transitive", - "resolved": "6.0.1", - "contentHash": "III/lNMSn0ZRBuM9m5Cgbiho5j81u0FAEagFX5ta2DKbljZ3T0IpD8j+BIiHQPeKqJppWS9bGEp6JnKnWKze0g==", + "resolved": "9.0.0", + "contentHash": "ANiqLu3DxW9kol/hMmTWbt3414t9ftdIuiIU7j80okq2YzAueo120M442xk1kDJWtmZTqWQn7wHDvMRipVOEOQ==", "dependencies": { - "System.Collections.Immutable": "6.0.0" + "System.Collections.Immutable": "9.0.0", + "System.Memory": "4.5.5" } }, "System.Runtime.CompilerServices.Unsafe": { "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg==" + "resolved": "6.1.2", + "contentHash": "2hBr6zdbIBTDE3EhK7NSVNdX58uTK6iHW/P/Axmm9sl1xoGSLqDvMtpecn226TNwHByFokYwJmt/aQQNlO5CRw==" }, "System.Text.Encoding.CodePages": { "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "ZFCILZuOvtKPauZ/j/swhvw68ZRi9ATCfvGbk1QfydmcXBkIWecWKn/250UH7rahZ5OoDBaiAudJtPvLwzw85A==", + "resolved": "7.0.0", + "contentHash": "LSyCblMpvOe0N3E+8e0skHcrIhgV2huaNcjUUEa8hRtgEAm36aGkRoC8Jxlb6Ra6GSfF29ftduPNywin8XolzQ==", "dependencies": { - "System.Memory": "4.5.4", + "System.Memory": "4.5.5", "System.Runtime.CompilerServices.Unsafe": "6.0.0" } }, "System.Text.Encodings.Web": { "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "yev/k9GHAEGx2Rg3/tU6MQh4HGBXJs70y7j1LaM1i/ER9po+6nnQ6RRqTJn1E7Xu0fbIFK80Nh5EoODxrbxwBQ==", + "resolved": "10.0.0", + "contentHash": "257hh1ep1Gqm1Lm0ulxf7vVBVMJuGN6EL4xSWjpi46DffXzm1058IiWsfSC06zSm7SniN+Tb5160UnXsSa8rRg==", "dependencies": { - "System.Buffers": "4.5.1", - "System.Memory": "4.5.5", - "System.Runtime.CompilerServices.Unsafe": "6.0.0" + "System.Buffers": "4.6.1", + "System.Memory": "4.6.3", + "System.Runtime.CompilerServices.Unsafe": "6.1.2" } }, "System.Threading.Tasks.Extensions": { "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", + "resolved": "4.6.3", + "contentHash": "7sCiwilJLYbTZELaKnc7RecBBXWXA+xMLQWZKWawBxYjp6DBlSE3v9/UcvKBvr1vv2tTOhipiogM8rRmxlhrVA==", "dependencies": { - "System.Runtime.CompilerServices.Unsafe": "4.5.3" + "System.Runtime.CompilerServices.Unsafe": "6.1.2" } } } diff --git a/Tools/Schema.NET.Updater/Schema.NET.Updater.csproj b/Tools/Schema.NET.Updater/Schema.NET.Updater.csproj index 683cf1a4..9e0e2a89 100644 --- a/Tools/Schema.NET.Updater/Schema.NET.Updater.csproj +++ b/Tools/Schema.NET.Updater/Schema.NET.Updater.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net10.0;net8.0 false @@ -28,10 +28,4 @@ - - - - - - diff --git a/Tools/Schema.NET.Updater/packages.lock.json b/Tools/Schema.NET.Updater/packages.lock.json index cc7dcaae..69ffd90e 100644 --- a/Tools/Schema.NET.Updater/packages.lock.json +++ b/Tools/Schema.NET.Updater/packages.lock.json @@ -1,19 +1,15 @@ { "version": 1, "dependencies": { - "net8.0": { - "Microsoft.CodeAnalysis.NetAnalyzers": { - "type": "Direct", - "requested": "[10.0.100, )", - "resolved": "10.0.100", - "contentHash": "uj9VuyvqylnNueJfU7u2PkI/hEMpZl8Wg9BXyI0eatNEldU5jDYPdwsM8aDL18+1oLovju25MiqOPaGRBnG72A==" - }, - "Microsoft.VisualStudio.Threading.Analyzers": { + "net10.0": { + "MinVer": { "type": "Direct", - "requested": "[17.14.15, )", - "resolved": "17.14.15", - "contentHash": "mXQPJsbuUD2ydq4/ffd8h8tSOFCXec+2xJOVNCvXjuMOq/+5EKHq3D2m2MC2+nUaXeFMSt66VS/J4HdKBixgcw==" - }, + "requested": "[6.0.0, )", + "resolved": "6.0.0", + "contentHash": "+/SsmiySsXJlvQLCGBqaZKNVt3s/Y/HbAdwtop7Km2CnuZbaScoqkWJEBQ5Cy9ebkn6kCYKrHsXgwrFdTgcb3g==" + } + }, + "net8.0": { "MinVer": { "type": "Direct", "requested": "[6.0.0, )", diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index a47c2cad..00000000 --- a/appveyor.yml +++ /dev/null @@ -1,53 +0,0 @@ -# AppVeyor documentation https://www.appveyor.com/docs - -version: "{build}" - -image: - # - macOS - - Ubuntu - - Visual Studio 2022 - -environment: - # Disable the .NET logo in the console output. - DOTNET_NOLOGO: true - # Disable the .NET first time experience to skip caching NuGet packages and speed up the build. - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true - # Disable sending .NET CLI telemetry to Microsoft. - DOTNET_CLI_TELEMETRY_OPTOUT: true - # Set the build number in MinVer. - MINVERBUILDMETADATA: build.%APPVEYOR_BUILD_NUMBER% - -build_script: - # https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script - - pwsh: | - if ($isWindows) { - Invoke-WebRequest "https://dot.net/v1/dotnet-install.ps1" -OutFile "./dotnet-install.ps1" - ./dotnet-install.ps1 -JSonFile global.json -InstallDir 'C:\Program Files\dotnet' - } - else { - Invoke-WebRequest "https://dot.net/v1/dotnet-install.sh" -OutFile "./dotnet-install.sh" - sudo chmod u+x dotnet-install.sh - if ($isMacOS) { - sudo ./dotnet-install.sh --jsonfile global.json --install-dir '/usr/local/share/dotnet' - } else { - sudo ./dotnet-install.sh --jsonfile global.json --install-dir '/usr/share/dotnet' - } - } - - pwsh: dotnet tool restore --verbosity diagnostic - - pwsh: dotnet cake --target=Build - - pwsh: dotnet cake --target=Test - - pwsh: dotnet cake --target=Pack - -test: off - -artifacts: - - name: NuGet Packages - path: ./Artefacts/**/*.nupkg - - name: NuGet Symbol Packages - path: ./Artefacts/**/*.snupkg - - name: xUnit XML Test Results - path: ./Artefacts/**/*.xml - - name: xUnit HTML Test Results - path: ./Artefacts/**/*.html - - name: Code Coverage - path: ./Artefacts/**/*.cobertura.xml diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 64dc04c1..00000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,98 +0,0 @@ -# Azure Pipelines documentation https://aka.ms/yaml - -trigger: - branches: - include: - - "main" - tags: - include: - - "*" -pr: - branches: - include: - - "*" - -variables: - # Disable the .NET logo in the console output. - DOTNET_NOLOGO: true - # Disable the .NET first time experience to skip caching NuGet packages and speed up the build. - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true - # Disable sending .NET CLI telemetry to Microsoft. - DOTNET_CLI_TELEMETRY_OPTOUT: true - # Set the build number in MinVer. - MINVERBUILDMETADATA: build.$(Build.BuildId) - -stages: - - stage: Build - jobs: - - job: Build - strategy: - matrix: - Linux: - matrixName: Ubuntu - vmImageName: ubuntu-latest - Mac: - matrixName: Mac - vmImageName: macos-latest - Windows: - matrixName: Windows - vmImageName: windows-latest - pool: - vmImage: $(vmImageName) - timeoutInMinutes: 30 - steps: - - checkout: self - lfs: true - - task: UseDotNet@2 - displayName: "Install .NET Core 6.0 SDK" - inputs: - packageType: "sdk" - version: 6.0.x - - task: UseDotNet@2 - displayName: "Install .NET Core 8.0 SDK" - inputs: - packageType: "sdk" - version: 8.0.x - - pwsh: "dotnet tool restore" - displayName: "Dotnet Tool Restore" - failOnStderr: true - - pwsh: "dotnet cake --target=Build" - displayName: "Dotnet Cake Build" - failOnStderr: true - - pwsh: "dotnet cake --target=Test" - displayName: "Dotnet Cake Test" - failOnStderr: true - - pwsh: "dotnet cake --target=Pack" - displayName: "Dotnet Cake Pack" - failOnStderr: true - - task: PublishTestResults@2 - displayName: "Publish Test Results" - inputs: - testResultsFormat: "VSTest" - testResultsFiles: "**/*.trx" - - task: PublishCodeCoverageResults@1 - inputs: - codeCoverageTool: cobertura - summaryFileLocation: "**/*.cobertura.xml" - - publish: "./Artefacts" - artifact: $(matrixName) - displayName: "Publish Artefacts" - - stage: Deploy - jobs: - - deployment: AzureArtefacts - displayName: "Azure Artefacts" - condition: ne(variables['Build.Reason'], 'PullRequest') - pool: - vmImage: windows-latest - environment: "Azure Artefacts" - strategy: - runOnce: - deploy: - steps: - - task: NuGetToolInstaller@1 - displayName: "NuGet Install" - - task: NuGetAuthenticate@0 - displayName: "NuGet Authenticate" - - pwsh: nuget push $(Agent.BuildDirectory)\Windows\*.nupkg -Source https://pkgs.dev.azure.com/schema-net/_packaging/schema-net/nuget/v3/index.json -ApiKey AzureArtifacts -SkipDuplicate - displayName: "NuGet Push" - failOnStderr: true diff --git a/global.json b/global.json index c98625b3..039c91bc 100644 --- a/global.json +++ b/global.json @@ -1,7 +1,7 @@ { "sdk": { - "version": "8.0.404", + "version": "10.0.0", "rollForward": "latestMinor", "allowPrerelease": false } -} \ No newline at end of file +}