diff --git a/.editorconfig b/.editorconfig index 277d4cd..8d6604d 100644 --- a/.editorconfig +++ b/.editorconfig @@ -191,6 +191,54 @@ dotnet_diagnostic.CA1819.severity = none # CA2225: Provide a method … as an alternate for operator dotnet_diagnostic.CA2225.severity = none +# CA1515: Consider making public types internal +dotnet_diagnostic.CA1515.severity = none + +# CA1869: Cache and reuse 'JsonSerializerOptions' instances +dotnet_diagnostic.CA1869.severity = none + +# CA1062: Validate arguments of public methods +dotnet_diagnostic.CA1062.severity = none + +# CA1707: Identifiers should not contain underscores +dotnet_diagnostic.CA1707.severity = none + +# CA1720: Identifiers should not contain type names +dotnet_diagnostic.CA1720.severity = none + +# CA1002: Do not expose generic lists +dotnet_diagnostic.CA1002.severity = none + +# CA1019: Define accessors for attribute arguments +dotnet_diagnostic.CA1019.severity = none + +# CA1859: Use concrete types when possible for improved performance +dotnet_diagnostic.CA1859.severity = none + +# CA1305: Specify IFormatProvider +dotnet_diagnostic.CA1305.severity = none + +# CA1851: Possible multiple enumerations of IEnumerable collection +dotnet_diagnostic.CA1851.severity = none + +# CA1307: Specify StringComparison for clarity +dotnet_diagnostic.CA1307.severity = none + +# CA1034: Nested types should not be visible +dotnet_diagnostic.CA1034.severity = none + +# CA1309: Use ordinal StringComparison +dotnet_diagnostic.CA1309.severity = none + +# CA2007: Do not directly await a Task +dotnet_diagnostic.CA2007.severity = none + +# CA1716: Identifiers should not match keywords +dotnet_diagnostic.CA1716.severity = none + +# CA1032: Implement standard exception constructors +dotnet_diagnostic.CA1032.severity = none + # IDE0022: Use expression body for methods dotnet_diagnostic.IDE0022.severity = suggestion diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4be2927..6e587bb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - dotnet: ["8.0", "9.0"] + dotnet: ["8.0", "9.0", "10.0"] env: DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 DOTNET_CLI_TELEMETRY_OPTOUT: 1 @@ -23,6 +23,7 @@ jobs: dotnet-version: | 8.0.x 9.0.x + 10.0.x - name: Tool Restore run: dotnet tool restore - name: Restore diff --git a/.github/workflows/contracts-admin.yml b/.github/workflows/contracts-admin.yml index 3469341..7c4147a 100644 --- a/.github/workflows/contracts-admin.yml +++ b/.github/workflows/contracts-admin.yml @@ -32,12 +32,13 @@ jobs: dotnet-version: | 8.0.x 9.0.x + 10.0.x - name: Restore working-directory: src/LeanCode.Contracts.Admin run: dotnet restore - name: Generate Protobuf working-directory: src/LeanCode.Contracts.Admin - run: dotnet run -f net9.0 --project ../LeanCode.ContractsGenerator/LeanCode.ContractsGenerator.csproj -- project -p ./LeanCode.Contracts.Admin.csproj -o LeanCode.Contracts.pb + run: dotnet run -f net10.0 --project ../LeanCode.ContractsGenerator/LeanCode.ContractsGenerator.csproj -- project -p ./LeanCode.Contracts.Admin.csproj -o LeanCode.Contracts.pb - name: Build env: BUILD_VERSION: ${{ steps.version.outputs.version }} diff --git a/.github/workflows/contracts.yml b/.github/workflows/contracts.yml index 230b184..e18ed4a 100644 --- a/.github/workflows/contracts.yml +++ b/.github/workflows/contracts.yml @@ -32,6 +32,7 @@ jobs: dotnet-version: | 8.0.x 9.0.x + 10.0.x - name: Restore working-directory: src/LeanCode.Contracts run: dotnet restore diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 414971d..da39ffe 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,6 +25,7 @@ jobs: dotnet-version: | 8.0.x 9.0.x + 10.0.x - name: Restore run: dotnet restore - name: Build @@ -39,7 +40,7 @@ jobs: env: BUILD_VERSION: ${{ steps.get_version.outputs.version }} working-directory: src/LeanCode.ContractsGenerator - run: dotnet publish --output ./publish --no-self-contained --no-build --configuration Release --framework net9.0 + run: dotnet publish --output ./publish --no-self-contained --no-build --configuration Release --framework net10.0 - name: Pack env: BUILD_VERSION: ${{ steps.get_version.outputs.version }} diff --git a/CHANGELOG.md b/CHANGELOG.md index f219f6a..ad4b8d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## LeanCode.ContractsGenerator +### [4.1.0] + +#### Added + +- Support for `net10.0` TFM. + ### [4.0.0] #### Added @@ -102,3 +108,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [1.0.0]: https://github.com/leancodepl/contractsgenerator/compare/v0.1.0-alpha11...v1.0.0 [2.0.0]: https://github.com/leancodepl/contractsgenerator/compare/v1.0.0...v2.0.0 [3.0.0]: https://github.com/leancodepl/contractsgenerator/compare/v2.0.0...v3.0.0 +[4.0.0]: https://github.com/leancodepl/contractsgenerator/compare/v3.0.0...v4.0.0 +[4.1.0]: https://github.com/leancodepl/contractsgenerator/compare/v4.0.0...main diff --git a/Directory.Build.targets b/Directory.Build.targets index 756dbcd..55f00ce 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -11,12 +11,18 @@ 9.0.0 8.1.2496 + + 18.0.2 + 5.0.0-2.final + 10.0.0 + 9.0.2703 + - - + + - + @@ -26,12 +32,12 @@ - + - + diff --git a/examples/project/Directory.Build.props b/examples/project/Directory.Build.props index bbe4a9a..a988bd0 100644 --- a/examples/project/Directory.Build.props +++ b/examples/project/Directory.Build.props @@ -1,5 +1,5 @@ - net8.0;net9.0 + net8.0;net9.0;net10.0 diff --git a/examples/project/Directory.Build.targets b/examples/project/Directory.Build.targets index dd1e88f..d0da98c 100644 --- a/examples/project/Directory.Build.targets +++ b/examples/project/Directory.Build.targets @@ -1,5 +1,9 @@ + net8.0;net9.0 net8.0 diff --git a/global.json b/global.json index e1333a3..cd9fb53 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "9.0.100", + "version": "10.0.100", "allowPrerelease": true, "rollForward": "latestMajor" } diff --git a/src/LeanCode.Contracts.Admin/LeanCode.Contracts.Admin.csproj b/src/LeanCode.Contracts.Admin/LeanCode.Contracts.Admin.csproj index 36cd6d7..39b2a3e 100644 --- a/src/LeanCode.Contracts.Admin/LeanCode.Contracts.Admin.csproj +++ b/src/LeanCode.Contracts.Admin/LeanCode.Contracts.Admin.csproj @@ -2,7 +2,7 @@ LeanCode.Contracts.Admin annotations - net8.0;net9.0 + net8.0;net9.0;net10.0 Package with base contracts for LeanCode's Admin App Generator Contracts. diff --git a/src/LeanCode.Contracts/LeanCode.Contracts.csproj b/src/LeanCode.Contracts/LeanCode.Contracts.csproj index 225506f..003b272 100644 --- a/src/LeanCode.Contracts/LeanCode.Contracts.csproj +++ b/src/LeanCode.Contracts/LeanCode.Contracts.csproj @@ -1,6 +1,6 @@ - net8.0;net9.0 + net8.0;net9.0;net10.0 true Package with base contracts for LeanCode's Contracts Generator. diff --git a/src/LeanCode.ContractsGenerator.Tests/LeanCode.ContractsGenerator.Tests.csproj b/src/LeanCode.ContractsGenerator.Tests/LeanCode.ContractsGenerator.Tests.csproj index 9cd19e7..4c7c662 100644 --- a/src/LeanCode.ContractsGenerator.Tests/LeanCode.ContractsGenerator.Tests.csproj +++ b/src/LeanCode.ContractsGenerator.Tests/LeanCode.ContractsGenerator.Tests.csproj @@ -1,6 +1,6 @@ - net8.0;net9.0 + net8.0;net9.0;net10.0 true false diff --git a/src/LeanCode.ContractsGenerator.Tests/Serialization/BinarySerializationTests.cs b/src/LeanCode.ContractsGenerator.Tests/Serialization/BinarySerializationTests.cs index f117933..8af63a6 100644 --- a/src/LeanCode.ContractsGenerator.Tests/Serialization/BinarySerializationTests.cs +++ b/src/LeanCode.ContractsGenerator.Tests/Serialization/BinarySerializationTests.cs @@ -12,7 +12,7 @@ private sealed record class BinaryDTO(Binary? Null, Binary? NullableValue, Binar private static readonly BinaryDTO DTO = new(null, Hello?.AsBinary(), Hello!.AsBinary()); - private static readonly string Json = $$""" + private const string Json = $$""" { "{{nameof(BinaryDTO.Null)}}": null, "{{nameof(BinaryDTO.NullableValue)}}": "aGVsbG8=", diff --git a/src/LeanCode.ContractsGenerator.Tests/Serialization/NotificationEnvelopeSerializationTests.cs b/src/LeanCode.ContractsGenerator.Tests/Serialization/NotificationEnvelopeSerializationTests.cs index 5758764..b35a5ca 100644 --- a/src/LeanCode.ContractsGenerator.Tests/Serialization/NotificationEnvelopeSerializationTests.cs +++ b/src/LeanCode.ContractsGenerator.Tests/Serialization/NotificationEnvelopeSerializationTests.cs @@ -75,12 +75,12 @@ public void NotificationEnvelope_is_deserializable() deserializedNotification.Should().BeEquivalentTo(SampleNotification); } - private class Topic : ITopic, IProduceNotification + private sealed class Topic : ITopic, IProduceNotification { public List EntityIds { get; set; } = default!; } - private class Notification + private sealed class Notification { public string EntityId { get; set; } = default!; } diff --git a/src/LeanCode.ContractsGenerator.Tests/Serialization/SubscriptionEnvelopeSerializationTests.cs b/src/LeanCode.ContractsGenerator.Tests/Serialization/SubscriptionEnvelopeSerializationTests.cs index e1a9109..67c7e4a 100644 --- a/src/LeanCode.ContractsGenerator.Tests/Serialization/SubscriptionEnvelopeSerializationTests.cs +++ b/src/LeanCode.ContractsGenerator.Tests/Serialization/SubscriptionEnvelopeSerializationTests.cs @@ -59,7 +59,7 @@ public void SubscriptionEnvelope_is_deserializable() deserializedTopic.Should().BeEquivalentTo(SampleTopic); } - private class Topic : ITopic + private sealed class Topic : ITopic { public List EntityIds { get; set; } = default!; } diff --git a/src/LeanCode.ContractsGenerator/Compilation/ProjectLoader.cs b/src/LeanCode.ContractsGenerator/Compilation/ProjectLoader.cs index 1231f6c..addf435 100644 --- a/src/LeanCode.ContractsGenerator/Compilation/ProjectLoader.cs +++ b/src/LeanCode.ContractsGenerator/Compilation/ProjectLoader.cs @@ -72,7 +72,7 @@ public async Task> CompileAsync() return output.Values; } - private async Task CompileTransitivelyAsync( + private static async Task CompileTransitivelyAsync( Workspace workspace, ProjectId id, Dictionary output diff --git a/src/LeanCode.ContractsGenerator/LeanCode.ContractsGenerator.csproj b/src/LeanCode.ContractsGenerator/LeanCode.ContractsGenerator.csproj index 98787ab..58c4c6f 100644 --- a/src/LeanCode.ContractsGenerator/LeanCode.ContractsGenerator.csproj +++ b/src/LeanCode.ContractsGenerator/LeanCode.ContractsGenerator.csproj @@ -1,7 +1,7 @@ Exe - net8.0;net9.0 + net8.0;net9.0;net10.0 true LeanCode.ContractsGenerator @@ -13,6 +13,7 @@ + diff --git a/src/LeanCode.ContractsGenerator/Program.cs b/src/LeanCode.ContractsGenerator/Program.cs index be8a925..9393240 100644 --- a/src/LeanCode.ContractsGenerator/Program.cs +++ b/src/LeanCode.ContractsGenerator/Program.cs @@ -105,7 +105,7 @@ public class ProtocolOptions : IGenerationOptions public bool AllowDateTime { get; set; } } -internal class Program +internal sealed class Program { [System.Diagnostics.CodeAnalysis.SuppressMessage("?", "CA1031", Justification = "Exception boundary.")] private static async Task Main(string[] args)