Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop full framework support, NET 8.0 new minimum #2226

Merged
merged 7 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,6 @@
<SignAssembly>true</SignAssembly>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net472' ">
<DefineConstants>$(DefineConstants);REMOTING</DefineConstants>
</PropertyGroup>

<PropertyGroup>
<DefineConstants>$(DefineConstants);DIAGNOSTICS_SOURCE</DefineConstants>
</PropertyGroup>

<ItemGroup>
<None Include="..\quartz-logo-small.png" Pack="true" Visible="false" PackagePath=""/>
</ItemGroup>
Expand Down
59 changes: 22 additions & 37 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,72 +2,57 @@
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'net472' ">
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="2.1.1" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="2.1.1" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="2.1.1" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="8.0.0" />
</ItemGroup>
<ItemGroup>
<PackageVersion Include="Microsoft.Bcl.TimeProvider" Version="8.0.1" />
<PackageVersion Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.3.4" />
<PackageVersion Include="NLog.Extensions.Logging" Version="5.3.11" />
<PackageVersion Include="AspNetCore.HealthChecks.UI" Version="8.0.0" />
<PackageVersion Include="AspNetCore.HealthChecks.UI.Client" Version="8.0.0" />
<PackageVersion Include="AspNetCore.HealthChecks.UI.InMemory.Storage" Version="8.0.0" />
<PackageVersion Include="AspNetCore.HealthChecks.UI" Version="8.0.1" />
<PackageVersion Include="AspNetCore.HealthChecks.UI.Client" Version="8.0.1" />
<PackageVersion Include="AspNetCore.HealthChecks.UI.InMemory.Storage" Version="8.0.1" />
<PackageVersion Include="BenchmarkDotNet" Version="0.13.12" />
<PackageVersion Include="FakeItEasy" Version="8.2.0" />
<PackageVersion Include="FakeItEasy" Version="8.3.0" />
<PackageVersion Include="FirebirdSql.Data.FirebirdClient" Version="10.3.1" />
<PackageVersion Include="FluentAssertions" Version="6.12.0" />
<PackageVersion Include="log4net" Version="2.0.17" />
<PackageVersion Include="MELT" Version="0.9.0" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="6.0.18" />
<PackageVersion Include="Microsoft.Data.SQLite" Version="8.0.6" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.7" />
<PackageVersion Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.3.4" />
<PackageVersion Include="Microsoft.Data.SQLite" Version="8.0.7" />
<PackageVersion Include="Microsoft.Data.SqlClient" Version="5.2.1" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="2.1.1" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="2.1.1" />
<PackageVersion Include="Microsoft.Extensions.Http" Version="6.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Http" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Configuration" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.TimeProvider.Testing" Version="8.7.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageVersion Include="Microsoft.Extensions.TimeProvider.Testing" Version="8.6.0" />
<PackageVersion Include="MySqlConnector" Version="2.3.7" />
<PackageVersion Include="Npgsql.DependencyInjection" Version="8.0.3" />
<PackageVersion Include="NSwag.AspNetCore" Version="14.0.7" />
<PackageVersion Include="NLog.Extensions.Logging" Version="5.3.11" />
<PackageVersion Include="NSwag.AspNetCore" Version="14.0.8" />
<PackageVersion Include="NUnit" Version="4.1.0" />
<PackageVersion Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="Npgsql" Version="8.0.3" />
<PackageVersion Include="Npgsql.DependencyInjection" Version="8.0.3" />
<PackageVersion Include="OpenTelemetry" Version="1.3.1" />
<PackageVersion Include="OpenTelemetry.Exporter.Console" Version="1.8.1" />
<PackageVersion Include="OpenTelemetry.Exporter.Console" Version="1.9.0" />
<PackageVersion Include="OpenTelemetry.Exporter.Jaeger" Version="1.5.1" />
<PackageVersion Include="OpenTelemetry.Exporter.Zipkin" Version="1.8.1" />
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="1.8.1" />
<PackageVersion Include="OpenTelemetry.Exporter.Zipkin" Version="1.9.0" />
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="1.9.0" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Quartz" Version="1.0.0-alpha.3" />
<PackageVersion Include="OpenTracing" Version="0.12.1" />
<PackageVersion Include="Oracle.ManagedDataAccess" Version="23.4.0" />
<PackageVersion Include="Oracle.ManagedDataAccess.Core" Version="3.21.120" />
<PackageVersion Include="Oracle.ManagedDataAccess" Version="21.12.0" />
<PackageVersion Include="Oracle.ManagedDataAccess.Core" Version="23.5.0" />
<PackageVersion Include="Serilog" Version="4.0.0" />
<PackageVersion Include="Serilog.Extensions.Hosting" Version="8.0.0" />
<PackageVersion Include="Serilog.Extensions.Logging" Version="8.0.0" />
<PackageVersion Include="Serilog.Sinks.Console" Version="5.0.1" />
<PackageVersion Include="Serilog.Sinks.Console" Version="6.0.0" />
<PackageVersion Include="Spectre.Console" Version="0.49.1" />
<PackageVersion Include="Swashbuckle.AspNetCore" Version="6.5.0" />
<PackageVersion Include="System.Data.SQLite.Core" Version="1.0.118" />
<PackageVersion Include="System.Diagnostics.DiagnosticSource" Version="8.0.1" />
<PackageVersion Include="System.Net.Http.Json" Version="5.0.0" />
<PackageVersion Include="System.Reflection.Emit" Version="4.7.0" />
<PackageVersion Include="System.Text.Json" Version="8.0.4" />
<PackageVersion Include="TimeZoneConverter" Version="6.1.0" />
<PackageVersion Include="Topshelf" Version="4.3.0" />
<PackageVersion Include="log4net" Version="2.0.17" />
<PackageVersion Include="Verify.NUnit" Version="25.3.0" />
<PackageVersion Include="Verify.NUnit" Version="25.3.1" />
</ItemGroup>
<ItemGroup>
<GlobalPackageReference Include="GitHubActionsTestLogger" Version="2.3.3" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public static IServiceCollectionQuartzConfigurator AddHttpApi(
{
var optionsBuilder = configurator.Services
.AddOptions<QuartzHttpApiOptions>()
.Validate(options => !string.IsNullOrWhiteSpace(options.ApiPath) && options.ApiPath.StartsWith("/"), "ApiPath is required and must start with '/'");
.Validate(options => !string.IsNullOrWhiteSpace(options.ApiPath) && options.ApiPath.StartsWith('/'), "ApiPath is required and must start with '/'");

if (configure is not null)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Quartz.Benchmark/Quartz.Benchmark.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net8.0;net48</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<!-- Necessary to run benchmarks on .NET 6.0+ -->
<ProduceReferenceAssembly>false</ProduceReferenceAssembly>
Expand Down
2 changes: 1 addition & 1 deletion src/Quartz.Examples/Quartz.Examples.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net472</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
<OutputType>Exe</OutputType>
<IsPackable>false</IsPackable>
<NoWarn>$(NoWarn);MA0004</NoWarn>
Expand Down
2 changes: 1 addition & 1 deletion src/Quartz.HttpClient/HttpClient/HttpScheduler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public HttpScheduler(string schedulerName, System.Net.Http.HttpClient httpClient
SchedulerName = schedulerName;

this.httpClient = httpClient ?? throw new ArgumentNullException(nameof(httpClient));
if (!this.httpClient.BaseAddress?.ToString().EndsWith("/") == true)
if (!this.httpClient.BaseAddress?.ToString().EndsWith('/') == true)
{
throw new ArgumentException("HttpClient's BaseAddress must end in /", nameof(httpClient));
}
Expand Down
8 changes: 1 addition & 7 deletions src/Quartz.HttpClient/Quartz.HttpClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,11 @@

<PropertyGroup>
<AssemblyTitle>Quartz.NET HTTP client</AssemblyTitle>
<TargetFrameworks>netstandard2.0;net8.0</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>Quartz</RootNamespace>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
</PropertyGroup>

<ItemGroup Condition="!$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">
<PackageReference Include="System.Net.Http.Json" />
<PackageReference Include="System.Reflection.Emit" />
<PackageReference Include="System.Text.Json" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Http" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Quartz.Jobs/Quartz.Jobs.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<Description>Quartz.NET Jobs; $(Description)</Description>
<TargetFrameworks>net472;netstandard2.0;net8.0</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>Quartz</RootNamespace>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<PackageReadmeFile>quartz-jobs.md</PackageReadmeFile>
Expand Down
3 changes: 1 addition & 2 deletions src/Quartz.Jobs/Simpl/DefaultDirectoryProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ then just use both. The directory names will be 'distincted' by the caller.
}
if (dirNames is not null)
{
directoriesToScan.AddRange(
dirNames.Split(new[] { ";" }, StringSplitOptions.RemoveEmptyEntries));
directoriesToScan.AddRange(dirNames.Split(';', StringSplitOptions.RemoveEmptyEntries));
}

return directoriesToScan;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;netstandard2.0;net8.0</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>Quartz</RootNamespace>
<Title>Quartz.NET TimeZoneConverter integration</Title>
<Description>Quartz.NET TimeZoneConverter integration https://github.com/mj1856/TimeZoneConverter; $(Description)</Description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,12 +390,7 @@ public async ValueTask Initialize(CancellationToken cancellationToken = default)
{
if (f is not null)
{
#if NET5_0_OR_GREATER
await f.DisposeAsync().ConfigureAwait(false);
#else
await Task.Yield();
f.Dispose();
#endif
}
}
catch (IOException ioe)
Expand Down
2 changes: 1 addition & 1 deletion src/Quartz.Plugins/Quartz.Plugins.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<Description>Quartz.NET Plugins; $(Description)</Description>
<TargetFrameworks>net472;netstandard2.0;net8.0</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>Quartz</RootNamespace>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<PackageReadmeFile>quartz-plugins.md</PackageReadmeFile>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;netstandard2.0;net8.0</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>Quartz</RootNamespace>
<Title>Quartz.NET JSON Serialization</Title>
<Description>Quartz.NET JSON Serialization Support; $(Description)</Description>
Expand Down
6 changes: 1 addition & 5 deletions src/Quartz.Server/Quartz.Server.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net8.0</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
<OutputType>Exe</OutputType>
<IsPackable>false</IsPackable>
</PropertyGroup>
Expand All @@ -13,10 +13,6 @@
<Content Include="log4net.config" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net472' ">
<Reference Include="System.Configuration" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Quartz\Quartz.csproj" />
<ProjectReference Include="..\Quartz.Serialization.Newtonsoft\Quartz.Serialization.Newtonsoft.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,25 +48,6 @@ public void TestDbMetadataMySql()
TestDbMetadata("MySqlConnector");
}

#if NETFRAMEWORK

[Test]
[Category("db-oracle")]
public void TestDbMetadataOracleODP()
{
TestDbMetadata("OracleODP");
}

[Test]
[Category("db-oracle")]
public void TestDbMetadataOracleODPManaged()
{
var provider = TestDbMetadata("OracleODPManaged");
var command = (Oracle.ManagedDataAccess.Client.OracleCommand) provider.CreateCommand();
Assert.That(command.BindByName, Is.True, "bind by name should default to true");
}
#endif

private static DbProvider TestDbMetadata(string dbname, bool hashCustomBinaryType = true)
{
DbProvider dbp = new DbProvider(dbname, "foo");
Expand Down
12 changes: 2 additions & 10 deletions src/Quartz.Tests.Integration/Quartz.Tests.Integration.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net472</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
<Nullable>disable</Nullable>
<NoWarn>SYSLIB0011;CAC001</NoWarn>
Expand Down Expand Up @@ -30,6 +30,7 @@
<PackageReference Include="MySqlConnector" />
<PackageReference Include="NUnit" />
<PackageReference Include="Npgsql" />
<PackageReference Include="Oracle.ManagedDataAccess.Core" />
<PackageReference Include="System.Data.SQLite.Core" />
<PackageReference Include="NUnit3TestAdapter" />
</ItemGroup>
Expand All @@ -40,15 +41,6 @@
<ProjectReference Include="..\Quartz.Serialization.Newtonsoft\Quartz.Serialization.Newtonsoft.csproj" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
<PackageReference Include="Oracle.ManagedDataAccess.Core" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net472' ">
<Reference Include="Microsoft.CSharp" />
<PackageReference Include="Oracle.ManagedDataAccess" />
</ItemGroup>

<ItemGroup>
<GlobalPackageReference Remove="Meziantou.Analyzer" />
</ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions src/Quartz.Tests.Integration/TestAssemblySetup.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Quartz.Tests.Integration;
namespace Quartz.Tests.Integration;

[SetUpFixture]
public class TestAssemblySetup
Expand All @@ -7,10 +7,10 @@ public class TestAssemblySetup
public void SetUp()
{
// set default directory to make sure file loading works
// (https://youtrack.jetbrains.com/issue/RSRP-451142)
// (https://youtrack.jetbrains.com/issue/RSRP-451142)
string codeBase = GetType().Assembly.Location;
string pathToUse = codeBase;
if (!codeBase.StartsWith("/"))
if (!codeBase.StartsWith('/'))
{
UriBuilder uri = new UriBuilder(codeBase);
string path = Uri.UnescapeDataString(uri.Path);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
#if NETFRAMEWORK
using System.Net.Http;
#endif

using FakeItEasy;

using FluentAssertions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ public void ScheduleJob_WithoutJobIdentityWithTriggerIdentity_ShouldCopyFromTrig
Assert.AreEqual(job.Key.Group, trigger.JobKey.Group);
}

#if NET8_0_OR_GREATER
[Test]
public void ConfiguredDbDataSource_ShouldBeUsed()
{
Expand All @@ -127,7 +126,6 @@ public void ConfiguredDbDataSource_ShouldBeUsed()
Assert.That(quartzOptions.ContainsKey($"quartz.dataSource.{SchedulerBuilder.AdoProviderOptions.DefaultDataSourceName}.connectionProvider.type"));
Assert.That(quartzOptions[$"quartz.dataSource.{SchedulerBuilder.AdoProviderOptions.DefaultDataSourceName}.connectionProvider.type"], Is.EqualTo(typeof(DataSourceDbProvider).AssemblyQualifiedNameWithoutVersion()));
}
#endif

private sealed class DummyJob : IJob
{
Expand Down
8 changes: 0 additions & 8 deletions src/Quartz.Tests.Unit/Impl/AdoJobStore/StdAdoDelegateTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@
{
var conn = new ConnectionAndTransactionHolder(connection, transaction);
await adoDelegate.SelectTrigger(conn, new TriggerKey("test"));
Assert.Fail("Trigger selection should result in exception");

Check warning on line 199 in src/Quartz.Tests.Unit/Impl/AdoJobStore/StdAdoDelegateTest.cs

View workflow job for this annotation

GitHub Actions / qodana

Access to a static member of a type via a derived type

Access to a static member of a type via a derived type
}
catch (InvalidOperationException e)
{
Expand Down Expand Up @@ -462,14 +462,6 @@

public override object SyncRoot => throw new NotImplementedException();

#if NETFRAMEWORK
public override bool IsFixedSize => throw new NotImplementedException();

public override bool IsReadOnly => throw new NotImplementedException();

public override bool IsSynchronized => throw new NotImplementedException();
#endif

public override int IndexOf(string parameterName)
{
throw new NotImplementedException();
Expand Down
2 changes: 1 addition & 1 deletion src/Quartz.Tests.Unit/Quartz.Tests.Unit.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net472</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
<Nullable>disable</Nullable>
<NoWarn>SYSLIB0011;CS0618</NoWarn>
Expand Down
Loading
Loading