Skip to content

Commit

Permalink
Target .net 8. Remove jetbrains.annotations dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
dombrovsky committed Mar 12, 2024
1 parent b58f150 commit 44d482e
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<LangVersion>10</LangVersion>
<TargetFrameworks>netstandard2.0;net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
<Nullable>enable</Nullable>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<Deterministic>true</Deterministic>
Expand All @@ -10,7 +10,7 @@

<PropertyGroup>
<PackageId>TaskFlow.Microsoft.Extensions.DependencyInjection</PackageId>
<Version>1.0.0-rc2</Version>
<Version>1.0.0-rc3</Version>
<Authors>Volodymyr Dombrovskyi</Authors>
<Copyright>Copyright (c) 2023 Volodymyr Dombrovskyi</Copyright>
<PackageTags>TODO</PackageTags>
Expand Down Expand Up @@ -51,8 +51,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="JetBrains.Annotations" Version="2022.3.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" />
<PackageReference Include="JetBrains.Annotations" Version="2022.3.1" PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion TaskFlow.Tests/TaskFlow.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

Expand Down
8 changes: 4 additions & 4 deletions TaskFlow/TaskFlow.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<LangVersion>10</LangVersion>
<TargetFrameworks>netstandard2.0;net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
<Nullable>enable</Nullable>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<Deterministic>true</Deterministic>
Expand All @@ -10,7 +10,7 @@

<PropertyGroup>
<PackageId>TaskFlow</PackageId>
<Version>1.0.0-rc2</Version>
<Version>1.0.0-rc3</Version>
<Authors>Volodymyr Dombrovskyi</Authors>
<Copyright>Copyright (c) 2023 Volodymyr Dombrovskyi</Copyright>
<PackageTags>TODO</PackageTags>
Expand All @@ -29,7 +29,7 @@
</PropertyGroup>

<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>

<PropertyGroup>
Expand Down Expand Up @@ -60,7 +60,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="JetBrains.Annotations" Version="2022.3.1" />
<PackageReference Include="JetBrains.Annotations" Version="2022.3.1" PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
</ItemGroup>

Expand Down
8 changes: 8 additions & 0 deletions TaskFlow/TaskFlowBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ protected virtual async ValueTask DisposeAsyncCore()

await initializationTask.ConfigureAwait(false);

#if NET8_0_OR_GREATER
await _disposeCancellationTokenSource.CancelAsync().ConfigureAwait(false);
#else
_disposeCancellationTokenSource.Cancel();
#endif

try
{
Expand Down Expand Up @@ -126,10 +130,14 @@ protected void Starting()

protected void CheckDisposed()
{
#if NET7_0_OR_GREATER
ObjectDisposedException.ThrowIf(_state is TaskFlowState.Disposing or TaskFlowState.Disposed, nameof(TaskFlow));
#else
if (_state is TaskFlowState.Disposing or TaskFlowState.Disposed)
{
throw new ObjectDisposedException(nameof(TaskFlow));
}
#endif
}

protected abstract Task GetInitializationTask();
Expand Down

0 comments on commit 44d482e

Please sign in to comment.