diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json deleted file mode 100644 index ba9f764..0000000 --- a/.config/dotnet-tools.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "version": 1, - "isRoot": true, - "tools": { - "dotnet-validate": { - "version": "0.0.1-preview.304", - "commands": [ - "dotnet-validate" - ] - } - } -} diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 41aded6..f0d591e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -10,7 +10,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v1 with: - dotnet-version: "7.0.401" + dotnet-version: "8.0.100" - name: Restore dependencies run: dotnet restore - name: Build @@ -29,7 +29,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v1 with: - dotnet-version: "7.0.401" + dotnet-version: "8.0.100" - name: Restore dependencies run: dotnet restore - name: Restore tools diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 33198bf..14cfa5d 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -12,7 +12,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v1 with: - dotnet-version: "7.0.401" + dotnet-version: "8.0.100" - name: Restore dependencies run: dotnet restore - name: Restore tools diff --git a/Directory.Build.props b/Directory.Build.props index e571684..72eba5d 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -4,6 +4,7 @@ + net6.0;net7.0;net8.0 0.1.0 diff --git a/Directory.Packages.props b/Directory.Packages.props index f48c2a9..e28d7b2 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -1,25 +1,27 @@ true + [6.0.0,%29 + [1.5.1,%29 - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/global.json b/global.json deleted file mode 100644 index 4917dce..0000000 --- a/global.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "sdk": { - "version": "7.0.401" - } -} \ No newline at end of file diff --git a/src/DCA.Extensions.BackgroundTask.MediatR/DCA.Extensions.BackgroundTask.MediatR.csproj b/src/DCA.Extensions.BackgroundTask.MediatR/DCA.Extensions.BackgroundTask.MediatR.csproj index ba46a8f..344a583 100644 --- a/src/DCA.Extensions.BackgroundTask.MediatR/DCA.Extensions.BackgroundTask.MediatR.csproj +++ b/src/DCA.Extensions.BackgroundTask.MediatR/DCA.Extensions.BackgroundTask.MediatR.csproj @@ -1,7 +1,6 @@ - net6.0;net7.0 readme.md diff --git a/src/DCA.Extensions.BackgroundTask/AssemblyInfo.cs b/src/DCA.Extensions.BackgroundTask/AssemblyInfo.cs index 955647f..c4cad7d 100644 --- a/src/DCA.Extensions.BackgroundTask/AssemblyInfo.cs +++ b/src/DCA.Extensions.BackgroundTask/AssemblyInfo.cs @@ -1,3 +1,4 @@ +#if !NET7_0_OR_GREATER namespace System.Runtime.CompilerServices { public class RequiredMemberAttribute : Attribute { } @@ -14,3 +15,4 @@ public sealed class SetsRequiredMembersAttribute : Attribute { } } +#endif diff --git a/src/DCA.Extensions.BackgroundTask/BackgroundTaskChannel.cs b/src/DCA.Extensions.BackgroundTask/BackgroundTaskChannel.cs index b11725d..2c993be 100644 --- a/src/DCA.Extensions.BackgroundTask/BackgroundTaskChannel.cs +++ b/src/DCA.Extensions.BackgroundTask/BackgroundTaskChannel.cs @@ -11,7 +11,7 @@ namespace DCA.Extensions.BackgroundTask; public sealed class BackgroundTaskChannel { private readonly Channel _channel; - private readonly List _readers = new(); + private readonly List _readers = []; private readonly CancellationTokenSource _stopTokenSource = new(); private readonly ILogger _logger; private readonly BackgroundTaskChannelOptions _options; diff --git a/src/DCA.Extensions.BackgroundTask/BackgroundTaskOptions.cs b/src/DCA.Extensions.BackgroundTask/BackgroundTaskOptions.cs index f1295c9..ee41300 100644 --- a/src/DCA.Extensions.BackgroundTask/BackgroundTaskOptions.cs +++ b/src/DCA.Extensions.BackgroundTask/BackgroundTaskOptions.cs @@ -5,10 +5,10 @@ public class BackgroundTaskOptions /// /// Configure channels /// - public List Channels { get; set; } = new() - { + public List Channels { get; set; } = + [ new (){ Key = Constants.DefaultChannelKey} - }; + ]; } diff --git a/src/DCA.Extensions.BackgroundTask/CompatibilitySuppressions.xml b/src/DCA.Extensions.BackgroundTask/CompatibilitySuppressions.xml new file mode 100644 index 0000000..be88d2e --- /dev/null +++ b/src/DCA.Extensions.BackgroundTask/CompatibilitySuppressions.xml @@ -0,0 +1,22 @@ + + + + + CP0001 + T:System.Diagnostics.CodeAnalysis.SetsRequiredMembersAttribute + lib/net6.0/DCA.Extensions.BackgroundTask.dll + lib/net7.0/DCA.Extensions.BackgroundTask.dll + + + CP0001 + T:System.Runtime.CompilerServices.CompilerFeatureRequiredAttribute + lib/net6.0/DCA.Extensions.BackgroundTask.dll + lib/net7.0/DCA.Extensions.BackgroundTask.dll + + + CP0001 + T:System.Runtime.CompilerServices.RequiredMemberAttribute + lib/net6.0/DCA.Extensions.BackgroundTask.dll + lib/net7.0/DCA.Extensions.BackgroundTask.dll + + \ No newline at end of file diff --git a/src/DCA.Extensions.BackgroundTask/DCA.Extensions.BackgroundTask.csproj b/src/DCA.Extensions.BackgroundTask/DCA.Extensions.BackgroundTask.csproj index 154b6b6..72a1f30 100644 --- a/src/DCA.Extensions.BackgroundTask/DCA.Extensions.BackgroundTask.csproj +++ b/src/DCA.Extensions.BackgroundTask/DCA.Extensions.BackgroundTask.csproj @@ -1,7 +1,6 @@  - net6.0;net7.0 readme.md diff --git a/src/Directory.Build.props b/src/Directory.Build.props index f5067de..335d64a 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -16,7 +16,7 @@ https://github.com/DCArea/DotNetToolkit - + true true @@ -24,7 +24,7 @@ snupkg true - + diff --git a/test/DCA.Extensions.BackgroundTask.MediatR.Test/DispatchTests.cs b/test/DCA.Extensions.BackgroundTask.MediatR.Test/DispatchTests.cs index f438caf..2a2a2c6 100644 --- a/test/DCA.Extensions.BackgroundTask.MediatR.Test/DispatchTests.cs +++ b/test/DCA.Extensions.BackgroundTask.MediatR.Test/DispatchTests.cs @@ -33,7 +33,7 @@ public record MyTask(string Id) : IRequest { public class MyTaskHandler : IRequestHandler { - private static readonly ConcurrentBag _processedTaskIds = new(); + private static readonly ConcurrentBag _processedTaskIds = []; public static ConcurrentBag ProcessedTaskIds => _processedTaskIds; diff --git a/test/Directory.Build.props b/test/Directory.Build.props index bf16689..d756dcd 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -1,7 +1,6 @@ - net7.0 true false