Skip to content

Commit 6e934c1

Browse files
[ADD] .net10
1 parent bbd70b6 commit 6e934c1

File tree

10 files changed

+35
-48
lines changed

10 files changed

+35
-48
lines changed

.github/workflows/codeql.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ jobs:
1313
permissions:
1414
security-events: write
1515
steps:
16-
- uses: actions/checkout@v4
16+
- uses: actions/checkout@v5
1717
- name: .NET setup
18-
uses: actions/setup-dotnet@v4
18+
uses: actions/setup-dotnet@v5
1919
with:
20-
dotnet-version: '9.0.x'
20+
dotnet-version: '10.0.x'
2121
- name: Initialize CodeQL
22-
uses: github/codeql-action/init@v3
22+
uses: github/codeql-action/init@v4
2323
with:
2424
languages: csharp
2525
- name: Autobuild
26-
uses: github/codeql-action/autobuild@v3
26+
uses: github/codeql-action/autobuild@v4
2727
- name: Perform CodeQL Analysis
28-
uses: github/codeql-action/analyze@v3
28+
uses: github/codeql-action/analyze@v4

.github/workflows/publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ jobs:
88
publish:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v4
11+
- uses: actions/checkout@v5
1212
- name: .NET setup
13-
uses: actions/setup-dotnet@v4
13+
uses: actions/setup-dotnet@v5
1414
with:
15-
dotnet-version: '9.0.x'
15+
dotnet-version: '10.0.x'
1616
- name: Pack
1717
run: dotnet pack -o . -c Release /p:Version=${{ github.event.release.tag_name }} /p:PackageReleaseNotes="${{ github.event.release.body }}"
1818
- name: Push to Nuget

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<Sdk Name="DotNet.ReproducibleBuilds.Isolated" Version="1.2.39" />
44

55
<PropertyGroup>
6-
<TargetFrameworks>netstandard2.0;net6.0;net8.0;net9.0</TargetFrameworks>
6+
<TargetFrameworks>netstandard2.0;net8.0;net9.0;net10.0</TargetFrameworks>
77
<Product>AInq.Background</Product>
88
<Authors>Anton Andryushchenko</Authors>
99
<RepositoryUrl>https://github.com/andryushchenko/AInq.Background</RepositoryUrl>

Directory.Packages.props

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,28 @@
88

99
<ItemGroup>
1010
<PackageVersion Include="Cronos" Version="0.11.1" />
11-
<PackageVersion Include="AInq.Optional" Version="3.8.9" />
12-
<PackageVersion Include="System.Threading.Tasks.Extensions" Version="4.6.3" />
13-
<PackageVersion Include="System.Memory" Version="4.6.3" />
14-
<PackageVersion Include="System.Runtime.CompilerServices.Unsafe" Version="6.1.2" />
11+
<PackageVersion Include="AInq.Optional" Version="3.9.0-rc" />
1512
</ItemGroup>
1613

1714
<ItemGroup Condition="'$(TargetFramework)'=='netstandard2.0'">
1815
<PackageVersion Include="DotNext.Threading" Version="1.3.3" />
1916
<PackageVersion Include="DotNext" Version="1.2.10" />
20-
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="9.0.10" />
2117
</ItemGroup>
2218

23-
<ItemGroup Condition="'$(TargetFramework)'=='net6.0'">
24-
<PackageVersion Include="DotNext.Threading" Version="4.15.2" />
25-
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.3" />
26-
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.1" />
27-
<PackageVersion Include="System.Threading.Channels" Version="8.0.0" />
28-
</ItemGroup>
29-
30-
<ItemGroup Condition="'$(TargetFramework)'!='net6.0'">
31-
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.10" />
32-
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="9.0.10" />
33-
<PackageVersion Include="System.Threading.Channels" Version="9.0.10" />
19+
<ItemGroup Condition="'$(TargetFramework)'!='netstandard2.0'">
20+
<PackageVersion Include="DotNext.Threading" Version="5.25.2" />
3421
</ItemGroup>
3522

36-
<ItemGroup Condition="'$(TargetFramework)'=='net8.0' or '$(TargetFramework)'=='net9.0'">
37-
<PackageVersion Include="DotNext.Threading" Version="5.25.2" />
38-
<PackageVersion Include="System.IO.Hashing" Version="9.0.10" />
39-
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="9.0.10" />
23+
<ItemGroup>
24+
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="10.0.0-rc.2.25502.107" />
25+
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="10.0.0-rc.2.25502.107" />
26+
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.0-rc.2.25502.107" />
27+
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="10.0.0-rc.2.25502.107" />
28+
<PackageVersion Include="System.Threading.Channels" Version="10.0.0-rc.2.25502.107" />
29+
<PackageVersion Include="System.IO.Hashing" Version="10.0.0-rc.2.25502.107" />
30+
<PackageVersion Include="System.Threading.Tasks.Extensions" Version="4.6.3" />
31+
<PackageVersion Include="System.Memory" Version="4.6.3" />
32+
<PackageVersion Include="System.Runtime.CompilerServices.Unsafe" Version="6.1.2" />
4033
</ItemGroup>
4134

4235
<ItemGroup>

src/AInq.Background.Scheduler/Managers/WorkSchedulerManager.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,15 @@ public sealed class WorkSchedulerManager : IWorkScheduler, IWorkSchedulerManager
3030
private ConcurrentBag<IScheduledTaskWrapper> _works = [];
3131

3232
Task IWorkSchedulerManager.WaitForNewTaskAsync(CancellationToken cancellation)
33-
#if NETSTANDARD2_0
33+
#if NETSTANDARD
3434
=> _newWorkEvent.Wait(cancellation);
35-
#elif NETSTANDARD2_1
36-
=> _newWorkEvent.WaitAsync(cancellation);
3735
#else
3836
=> _newWorkEvent.WaitAsync(cancellation).AsTask();
3937
#endif
4038

4139
DateTime? IWorkSchedulerManager.GetNextTaskTime()
4240
{
43-
var works = Interlocked.Exchange(ref _works, new ConcurrentBag<IScheduledTaskWrapper>());
41+
var works = Interlocked.Exchange(ref _works, []);
4442
DateTime? next = null;
4543
while (!works.IsEmpty)
4644
if (works.TryTake(out var work) && work is {IsCanceled: false, NextScheduledTime: not null})
@@ -54,7 +52,7 @@ Task IWorkSchedulerManager.WaitForNewTaskAsync(CancellationToken cancellation)
5452

5553
ILookup<DateTime, IScheduledTaskWrapper> IWorkSchedulerManager.GetUpcomingTasks(TimeSpan horizon)
5654
{
57-
var works = Interlocked.Exchange(ref _works, new ConcurrentBag<IScheduledTaskWrapper>());
55+
var works = Interlocked.Exchange(ref _works, []);
5856
var upcoming = new LinkedList<IScheduledTaskWrapper>();
5957
var time = DateTime.Now.Add(horizon);
6058
while (!works.IsEmpty)

src/AInq.Background.Scheduler/Workers/SchedulerWorker.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ Task IHostedService.StartAsync(CancellationToken cancel)
7070

7171
async Task IHostedService.StopAsync(CancellationToken cancel)
7272
{
73-
#if NET8_0_OR_GREATER
74-
await _shutdown.CancelAsync().ConfigureAwait(false);
75-
#else
73+
#if NETSTANDARD
7674
_shutdown.Cancel();
75+
#else
76+
await _shutdown.CancelAsync().ConfigureAwait(false);
7777
#endif
7878
if (_worker != null)
7979
#if NETSTANDARD

src/AInq.Background/Managers/PriorityTaskManager.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,8 @@ protected PriorityTaskManager(int maxPriority = 100)
4141
Task ITaskManager<TArgument, int>.WaitForTaskAsync(CancellationToken cancellation)
4242
=> _queues.Any(queue => !queue.IsEmpty)
4343
? Task.CompletedTask
44-
#if NETSTANDARD2_0
44+
#if NETSTANDARD
4545
: _newDataEvent.Wait(cancellation);
46-
#elif NETSTANDARD2_1
47-
: _newDataEvent.WaitAsync(cancellation);
4846
#else
4947
: _newDataEvent.WaitAsync(cancellation).AsTask();
5048
#endif

src/AInq.Background/Managers/TaskManager.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,8 @@ public class TaskManager<TArgument> : ITaskManager<TArgument, object?>
2828

2929
Task ITaskManager<TArgument, object?>.WaitForTaskAsync(CancellationToken cancellation)
3030
=> _queue.IsEmpty
31-
#if NETSTANDARD2_0
31+
#if NETSTANDARD
3232
? _newDataEvent.Wait(cancellation)
33-
#elif NETSTANDARD2_1
34-
? _newDataEvent.WaitAsync(cancellation)
3533
#else
3634
? _newDataEvent.WaitAsync(cancellation).AsTask()
3735
#endif

src/AInq.Background/Workers/TaskWorker.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ Task IHostedService.StartAsync(CancellationToken cancel)
6060

6161
async Task IHostedService.StopAsync(CancellationToken cancel)
6262
{
63-
#if NET8_0_OR_GREATER
64-
await _shutdown.CancelAsync().ConfigureAwait(false);
65-
#else
63+
#if NETSTANDARD
6664
_shutdown.Cancel();
65+
#else
66+
await _shutdown.CancelAsync().ConfigureAwait(false);
6767
#endif
6868
if (_worker != null)
6969
#if NETSTANDARD

test/AInq.Background.Test/AInq.Background.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<OutputType>Exe</OutputType>
55
<IsPackable>false</IsPackable>
66
<!--suppress MsbuildTargetFrameworkTagInspection -->
7-
<TargetFrameworks>net9.0</TargetFrameworks>
7+
<TargetFrameworks>net10.0</TargetFrameworks>
88
<RootNamespace>AInq.Background.Test</RootNamespace>
99
<PublishAot>true</PublishAot>
1010
</PropertyGroup>

0 commit comments

Comments
 (0)