Skip to content

Commit

Permalink
update net8
Browse files Browse the repository at this point in the history
  • Loading branch information
suraciii committed Nov 23, 2023
1 parent 2399d4e commit 292c02a
Show file tree
Hide file tree
Showing 15 changed files with 54 additions and 47 deletions.
12 changes: 0 additions & 12 deletions .config/dotnet-tools.json

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
</PropertyGroup>

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<VersionPrefix>0.1.0</VersionPrefix>
</PropertyGroup>

Expand Down
36 changes: 19 additions & 17 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<MExVersion>[6.0.0,%29</MExVersion>
<OtelVersion>[1.5.1,%29</OtelVersion>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="MediatR" Version="12.1.1" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="[6.0.0,)" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="[6.0.0,)" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="[6.0.0,)" />
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="[6.0.0,)" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="[6.0.0,)" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="[6.0.0,)" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="[6.0.0,)" />
<PackageVersion Include="OpenTelemetry" Version="1.5.1" />
<PackageVersion Include="OpenTelemetry.Exporter.InMemory" Version="1.5.1" />
<PackageVersion Include="OpenTelemetry.Exporter.Console" Version="1.5.1" />
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="1.5.1" />
<PackageVersion Include="System.Diagnostics.DiagnosticSource" Version="7.0.2" />
<PackageVersion Include="System.Threading.Channels" Version="7.0.0" />
<PackageVersion Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
<PackageVersion Include="System.Threading.ThreadPool" Version="4.3.0" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.1.1" />
<PackageVersion Include="MediatR" Version="[12.2.0,)" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="$(MExVersion)" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="$(MExVersion)" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="$(MExVersion)" />
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="$(MExVersion)" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="$(MExVersion)" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="$(MExVersion)" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="$(MExVersion)" />
<PackageVersion Include="OpenTelemetry" Version="$(OtelVersion)" />
<PackageVersion Include="OpenTelemetry.Exporter.InMemory" Version="$(OtelVersion)" />
<PackageVersion Include="OpenTelemetry.Exporter.Console" Version="$(OtelVersion)" />
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="$(OtelVersion)" />
<PackageVersion Include="System.Diagnostics.DiagnosticSource" Version="[7.0.2,)" />
<PackageVersion Include="System.Threading.Channels" Version="[7.0.0,)" />
<PackageVersion Include="System.Threading.Tasks.Extensions" Version="[4.5.4,)" />
<PackageVersion Include="System.Threading.ThreadPool" Version="[4.3.0,)" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
</ItemGroup>
<ItemGroup>
<PackageVersion Include="FakeItEasy" Version="7.4.0" />
Expand Down
5 changes: 0 additions & 5 deletions global.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<PackageReadmeFile>readme.md</PackageReadmeFile>
</PropertyGroup>
<ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions src/DCA.Extensions.BackgroundTask/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if !NET7_0_OR_GREATER
namespace System.Runtime.CompilerServices
{
public class RequiredMemberAttribute : Attribute { }
Expand All @@ -14,3 +15,4 @@ public sealed class SetsRequiredMembersAttribute : Attribute
{
}
}
#endif
2 changes: 1 addition & 1 deletion src/DCA.Extensions.BackgroundTask/BackgroundTaskChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace DCA.Extensions.BackgroundTask;
public sealed class BackgroundTaskChannel
{
private readonly Channel<IBackgroundTask> _channel;
private readonly List<BackgroundTaskChannelReader> _readers = new();
private readonly List<BackgroundTaskChannelReader> _readers = [];
private readonly CancellationTokenSource _stopTokenSource = new();
private readonly ILogger<BackgroundTaskChannel> _logger;
private readonly BackgroundTaskChannelOptions _options;
Expand Down
6 changes: 3 additions & 3 deletions src/DCA.Extensions.BackgroundTask/BackgroundTaskOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ public class BackgroundTaskOptions
/// <summary>
/// Configure channels
/// </summary>
public List<BackgroundTaskChannelOptions> Channels { get; set; } = new()
{
public List<BackgroundTaskChannelOptions> Channels { get; set; } =
[
new (){ Key = Constants.DefaultChannelKey}
};
];
}


Expand Down
22 changes: 22 additions & 0 deletions src/DCA.Extensions.BackgroundTask/CompatibilitySuppressions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- https://learn.microsoft.com/en-us/dotnet/fundamentals/package-validation/diagnostic-ids -->
<Suppressions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Suppression>
<DiagnosticId>CP0001</DiagnosticId>
<Target>T:System.Diagnostics.CodeAnalysis.SetsRequiredMembersAttribute</Target>
<Left>lib/net6.0/DCA.Extensions.BackgroundTask.dll</Left>
<Right>lib/net7.0/DCA.Extensions.BackgroundTask.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0001</DiagnosticId>
<Target>T:System.Runtime.CompilerServices.CompilerFeatureRequiredAttribute</Target>
<Left>lib/net6.0/DCA.Extensions.BackgroundTask.dll</Left>
<Right>lib/net7.0/DCA.Extensions.BackgroundTask.dll</Right>
</Suppression>
<Suppression>
<DiagnosticId>CP0001</DiagnosticId>
<Target>T:System.Runtime.CompilerServices.RequiredMemberAttribute</Target>
<Left>lib/net6.0/DCA.Extensions.BackgroundTask.dll</Left>
<Right>lib/net7.0/DCA.Extensions.BackgroundTask.dll</Right>
</Suppression>
</Suppressions>
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<PackageReadmeFile>readme.md</PackageReadmeFile>
</PropertyGroup>
<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
<SourceLinkOriginUrl>https://github.com/DCArea/DotNetToolkit</SourceLinkOriginUrl>
</PropertyGroup>

<PropertyGroup Condition="'$(IsPackable)'=='true' and '$(SourceLinkCreate)'=='true'">
<PropertyGroup Condition="'$(IsPackable)'=='true'">
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<!-- <DebugType>embedded</DebugType> -->
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<EnablePackageValidation>true</EnablePackageValidation>
</PropertyGroup>
<ItemGroup Condition="'$(IsPackable)'=='true' and '$(SourceLinkCreate)'=='true'">
<ItemGroup Condition="'$(IsPackable)'=='true'">
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All"/>
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public record MyTask(string Id) : IRequest
{
public class MyTaskHandler : IRequestHandler<MyTask>
{
private static readonly ConcurrentBag<string> _processedTaskIds = new();
private static readonly ConcurrentBag<string> _processedTaskIds = [];

public static ConcurrentBag<string> ProcessedTaskIds => _processedTaskIds;

Expand Down
1 change: 0 additions & 1 deletion test/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<IsTestProject>true</IsTestProject>
<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down

0 comments on commit 292c02a

Please sign in to comment.