Skip to content

Commit

Permalink
Add a .NET 8.0 TFM
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinchalet committed Nov 14, 2023
1 parent 7391a3e commit 6636784
Show file tree
Hide file tree
Showing 14 changed files with 126 additions and 12 deletions.
7 changes: 5 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,16 @@
</NetFrameworkTargetFrameworks>
<NetCoreTargetFrameworks Condition=" '$(NetCoreTargetFrameworks)' == '' ">
net6.0;
net7.0
net7.0;
net8.0
</NetCoreTargetFrameworks>
<NetCoreWindowsTargetFrameworks Condition=" '$(NetCoreWindowsTargetFrameworks)' == '' ">
net6.0-windows7.0;
net6.0-windows10.0.17763;
net7.0-windows7.0;
net7.0-windows10.0.17763
net7.0-windows10.0.17763;
net8.0-windows7.0;
net8.0-windows10.0.17763
</NetCoreWindowsTargetFrameworks>
<NetStandardTargetFrameworks Condition=" '$(NetStandardTargetFrameworks)' == '' ">
netstandard2.0;
Expand Down
6 changes: 6 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@
<DefineConstants>$(DefineConstants);SUPPORTS_AUTHENTICATION_HANDLER_SELECTION_FALLBACK</DefineConstants>
</PropertyGroup>

<PropertyGroup
Condition=" ('$(TargetFrameworkIdentifier)' == '.NETCoreApp' And $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), '8.0'))) ">
<DefineConstants>$(DefineConstants);SUPPORTS_IMMUTABLE_COLLECTIONS_MARSHAL</DefineConstants>
<DefineConstants>$(DefineConstants);SUPPORTS_TIME_PROVIDER</DefineConstants>
</PropertyGroup>

<PropertyGroup
Condition=" ('$(TargetFrameworkIdentifier)' == '.NETCoreApp' And $([MSBuild]::VersionLessThan($(TargetFrameworkVersion), '5.0'))) Or
Expand Down
54 changes: 49 additions & 5 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -296,17 +296,61 @@
<PackageVersion Include="Moq" Version="4.18.4" />
<PackageVersion Include="System.Linq.Async" Version="6.0.1" />

<!--
Note: OpenIddict uses PolySharp to dynamically generate polyfills for types that are not available on
some of the targeted TFMs (e.g Index, Range or nullable attributes on .NET Framework/.NET Standard).
-->
<GlobalPackageReference Include="PolySharp" Condition=" '$(DisablePolySharp)' != 'true' " Version="1.13.1" />
</ItemGroup>

<!--
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█████ ▀██ ██ ▄▄▄█▄▄ ▄▄███▀▄▄▀████ ▄▄ ██
█▀▀██ █ █ ██ ▄▄▄███ █████▀▄▄▀█▀▀█ ▀▄ ██
█▄▄██ ██▄ ██ ▀▀▀███ █████▄▀▀▄█▄▄█ ▀▀ ██
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
-->

<ItemGroup Label="Package versions for .NET 8.0"
Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' And $([MSBuild]::VersionEquals($(TargetFrameworkVersion), '8.0')) ">
<PackageVersion Include="EntityFramework" Version="6.4.4" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Caching.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Http.Polly" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Primitives" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.WebEncoders" Version="8.0.0" />
<PackageVersion Include="Microsoft.IdentityModel.JsonWebTokens" Version="7.0.0" />
<PackageVersion Include="Microsoft.IdentityModel.Protocols" Version="7.0.0" />
<PackageVersion Include="Microsoft.IdentityModel.Tokens" Version="7.0.0" />
<PackageVersion Include="MongoDB.Bson" Version="2.20.0" />
<PackageVersion Include="MongoDB.Driver" Version="2.20.0" />
<PackageVersion Include="Quartz.Extensions.DependencyInjection" Version="3.5.0" />

<!--
Note: the following references are exclusively used in the test projects:
-->
<PackageVersion Include="AngleSharp" Version="0.17.1" />
<PackageVersion Include="MartinCostello.Logging.XUnit" Version="0.3.0" />
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageVersion Include="Moq" Version="4.18.4" />
<PackageVersion Include="System.Linq.Async" Version="6.0.1" />

<!--
Note: the following references are exclusively used in the samples:
-->
<PackageVersion Include="Dapplo.Microsoft.Extensions.Hosting.AppServices" Version="1.0.14" />
<PackageVersion Include="Dapplo.Microsoft.Extensions.Hosting.WinForms" Version="1.0.14" />
<PackageVersion Include="Dapplo.Microsoft.Extensions.Hosting.Wpf" Version="1.0.14" />
<PackageVersion Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="7.0.5" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.5" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.5" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
<PackageVersion Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
<PackageVersion Include="Quartz.Extensions.Hosting" Version="3.5.0" />
<PackageVersion Include="Spectre.Console" Version="0.46.0" />

Expand Down
15 changes: 15 additions & 0 deletions NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
<add key="dotnet-eng" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" />
<add key="dotnet-tools" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" />
<add key="dotnet7" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet7/nuget/v3/index.json" />
<add key="dotnet8" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json" />
<add key="dotnet9" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v3/index.json" />
</packageSources>

<packageSourceMapping>
Expand All @@ -19,6 +22,18 @@
<packageSource key="dotnet-tools">
<package pattern="*" />
</packageSource>

<packageSource key="dotnet7">
<package pattern="*" />
</packageSource>

<packageSource key="dotnet8">
<package pattern="*" />
</packageSource>

<packageSource key="dotnet9">
<package pattern="*" />
</packageSource>
</packageSourceMapping>

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

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsShipping>false</IsShipping>
<Nullable>disable</Nullable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsShipping>false</IsShipping>
<SignAssembly>false</SignAssembly>
<TypeScriptEnabled>false</TypeScriptEnabled>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net48;net7.0</TargetFrameworks>
<TargetFrameworks>net48;net8.0</TargetFrameworks>
<EnablePreviewFeatures>true</EnablePreviewFeatures>
<IsShipping>false</IsShipping>
<SignAssembly>false</SignAssembly>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFrameworks>net48;net7.0-windows7.0</TargetFrameworks>
<TargetFrameworks>net48;net8.0-windows7.0</TargetFrameworks>
<EnablePreviewFeatures>true</EnablePreviewFeatures>
<EnableWindowsTargeting>true</EnableWindowsTargeting>
<UseWindowsForms>true</UseWindowsForms>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFrameworks>net48;net7.0-windows10.0.17763</TargetFrameworks>
<TargetFrameworks>net48;net8.0-windows10.0.17763</TargetFrameworks>
<EnablePreviewFeatures>true</EnablePreviewFeatures>
<EnableWindowsTargeting>true</EnableWindowsTargeting>
<UseWPF>true</UseWPF>
Expand Down
1 change: 1 addition & 0 deletions src/OpenIddict.AspNetCore/OpenIddict.AspNetCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<None Include="_._" Pack="true" PackagePath="lib\net48\_._" />
<None Include="_._" Pack="true" PackagePath="lib\net6.0\_._" />
<None Include="_._" Pack="true" PackagePath="lib\net7.0\_._" />
<None Include="_._" Pack="true" PackagePath="lib\net8.0\_._" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,19 @@ public sealed class OpenIddictClientAspNetCoreHandler : AuthenticationHandler<Op
/// <summary>
/// Creates a new instance of the <see cref="OpenIddictClientAspNetCoreHandler"/> class.
/// </summary>
#if SUPPORTS_TIME_PROVIDER
public OpenIddictClientAspNetCoreHandler(
IOpenIddictClientDispatcher dispatcher,
IOpenIddictClientFactory factory,
IOptionsMonitor<OpenIddictClientAspNetCoreOptions> options,
ILoggerFactory logger,
UrlEncoder encoder)
: base(options, logger, encoder)
{
_dispatcher = dispatcher ?? throw new ArgumentNullException(nameof(dispatcher));
_factory = factory ?? throw new ArgumentNullException(nameof(factory));
}
#else
public OpenIddictClientAspNetCoreHandler(
IOpenIddictClientDispatcher dispatcher,
IOpenIddictClientFactory factory,
Expand All @@ -42,6 +55,7 @@ public OpenIddictClientAspNetCoreHandler(
_dispatcher = dispatcher ?? throw new ArgumentNullException(nameof(dispatcher));
_factory = factory ?? throw new ArgumentNullException(nameof(factory));
}
#endif

/// <inheritdoc/>
public async Task<bool> HandleRequestAsync()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,19 @@ public sealed class OpenIddictServerAspNetCoreHandler : AuthenticationHandler<Op
/// <summary>
/// Creates a new instance of the <see cref="OpenIddictServerAspNetCoreHandler"/> class.
/// </summary>
#if SUPPORTS_TIME_PROVIDER
public OpenIddictServerAspNetCoreHandler(
IOpenIddictServerDispatcher dispatcher,
IOpenIddictServerFactory factory,
IOptionsMonitor<OpenIddictServerAspNetCoreOptions> options,
ILoggerFactory logger,
UrlEncoder encoder)
: base(options, logger, encoder)
{
_dispatcher = dispatcher ?? throw new ArgumentNullException(nameof(dispatcher));
_factory = factory ?? throw new ArgumentNullException(nameof(factory));
}
#else
public OpenIddictServerAspNetCoreHandler(
IOpenIddictServerDispatcher dispatcher,
IOpenIddictServerFactory factory,
Expand All @@ -42,6 +55,7 @@ public OpenIddictServerAspNetCoreHandler(
_dispatcher = dispatcher ?? throw new ArgumentNullException(nameof(dispatcher));
_factory = factory ?? throw new ArgumentNullException(nameof(factory));
}
#endif

/// <inheritdoc/>
public async Task<bool> HandleRequestAsync()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,19 @@ public sealed class OpenIddictValidationAspNetCoreHandler : AuthenticationHandle
/// <summary>
/// Creates a new instance of the <see cref="OpenIddictValidationAspNetCoreHandler"/> class.
/// </summary>
#if SUPPORTS_TIME_PROVIDER
public OpenIddictValidationAspNetCoreHandler(
IOpenIddictValidationDispatcher dispatcher,
IOpenIddictValidationFactory factory,
IOptionsMonitor<OpenIddictValidationAspNetCoreOptions> options,
ILoggerFactory logger,
UrlEncoder encoder)
: base(options, logger, encoder)
{
_dispatcher = dispatcher ?? throw new ArgumentNullException(nameof(dispatcher));
_factory = factory ?? throw new ArgumentNullException(nameof(factory));
}
#else
public OpenIddictValidationAspNetCoreHandler(
IOpenIddictValidationDispatcher dispatcher,
IOpenIddictValidationFactory factory,
Expand All @@ -39,6 +52,7 @@ public OpenIddictValidationAspNetCoreHandler(
_dispatcher = dispatcher ?? throw new ArgumentNullException(nameof(dispatcher));
_factory = factory ?? throw new ArgumentNullException(nameof(factory));
}
#endif

/// <inheritdoc/>
public async Task<bool> HandleRequestAsync()
Expand Down
3 changes: 3 additions & 0 deletions src/OpenIddict/OpenIddict.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ To use these features on ASP.NET Core or OWIN/Katana/ASP.NET 4.x, reference the
<None Include="_._" Pack="true" PackagePath="lib\net7.0\_._" />
<None Include="_._" Pack="true" PackagePath="lib\net7.0-windows7.0\_._" />
<None Include="_._" Pack="true" PackagePath="lib\net7.0-windows10.0.17763\_._" />
<None Include="_._" Pack="true" PackagePath="lib\net8.0\_._" />
<None Include="_._" Pack="true" PackagePath="lib\net8.0-windows7.0\_._" />
<None Include="_._" Pack="true" PackagePath="lib\net8.0-windows10.0.17763\_._" />
<None Include="_._" Pack="true" PackagePath="lib\netstandard2.0\_._" />
<None Include="_._" Pack="true" PackagePath="lib\netstandard2.1\_._" />
</ItemGroup>
Expand Down

0 comments on commit 6636784

Please sign in to comment.