Skip to content

Commit

Permalink
Update to target .NET 8 (#159)
Browse files Browse the repository at this point in the history
- Update to the .NET 8 SDK and target `net8.0`.
- Add a README file to the NuGet packages as recommended by the .NET 8 SDK.
- Remove now-obsolete use of `ISystemClock`.
- Fix code analysis warning by using `TryGetValue()`.
- Use static `ArgumentException` methods.
- Use `AuthenticationFailureException` where relevant.
- Use primary constructors in a few places where relevant.
- Apply some IDE suggestions to use newer C# syntax.
- Fix typo.
- Update to the latest release of arcade for .NET 8.
- Update NuGet packages to their latest versions.
- Remove System.Text.Json as an explicit package reference.
- Bump Microsoft.IdentityModel.Protocols to 7.0.3 as there's been some bugs in v7 that .NET 8 is picking up e.g. dotnet/aspnetcore#51430.
- Fix AoT warning.
- Simplify member name.
- Add support for native AoT for the libraries.
  • Loading branch information
martincostello authored Nov 14, 2023
1 parent ece2c73 commit b30d42e
Show file tree
Hide file tree
Showing 62 changed files with 1,393 additions and 1,365 deletions.
15 changes: 14 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Import Project="Sdk.props" Sdk="Microsoft.DotNet.Arcade.Sdk" />

<PropertyGroup>
<DefaultNetCoreTargetFramework>net7.0</DefaultNetCoreTargetFramework>
<DefaultNetCoreTargetFramework>net8.0</DefaultNetCoreTargetFramework>
<LangVersion>latest</LangVersion>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
Expand Down Expand Up @@ -43,6 +43,7 @@
<PackageIconFullPath>$(MSBuildThisFileDirectory)package-icon.png</PackageIconFullPath>
<PackageProjectUrl>https://github.com/aspnet-contrib/AspNet.Security.OpenId.Providers</PackageProjectUrl>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>git://github.com/aspnet-contrib/AspNet.Security.OpenId.Providers</RepositoryUrl>
</PropertyGroup>
Expand All @@ -53,6 +54,14 @@
<EnableNETAnalyzers>true</EnableNETAnalyzers>
</PropertyGroup>

<PropertyGroup Condition=" '$(IsPackable)' == 'true' ">
<EnableAotAnalyzer>true</EnableAotAnalyzer>
<EnableSingleFileAnalyzer>true</EnableSingleFileAnalyzer>
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
<IsAotCompatible>true</IsAotCompatible>
<IsTrimmable>true</IsTrimmable>
</PropertyGroup>

<PropertyGroup>
<EnablePackageValidation>$(IsPackable)</EnablePackageValidation>
</PropertyGroup>
Expand Down Expand Up @@ -84,4 +93,8 @@
<Using Include="Microsoft.AspNetCore.Authentication" />
</ItemGroup>

<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)$(PackageReadmeFile)" Pack="True" PackagePath="" />
</ItemGroup>

</Project>
15 changes: 7 additions & 8 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
<Project>

<ItemGroup>
<PackageVersion Include="AngleSharp" Version="0.13.0" />
<PackageVersion Include="JetBrains.Annotations" Version="2022.1.0" />
<PackageVersion Include="JustEat.HttpClientInterception" Version="3.1.2" />
<PackageVersion Include="AngleSharp" Version="1.0.6" />
<PackageVersion Include="JetBrains.Annotations" Version="2023.3.0" />
<PackageVersion Include="JustEat.HttpClientInterception" Version="4.0.0" />
<PackageVersion Include="MartinCostello.Logging.XUnit" Version="0.3.0" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="7.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="7.0.0" />
<PackageVersion Include="Microsoft.IdentityModel.Protocols" Version="6.10.0" />
<PackageVersion Include="Shouldly" Version="4.1.0" />
<PackageVersion Include="System.Text.Json" Version="7.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="8.0.0" />
<PackageVersion Include="Microsoft.IdentityModel.Protocols" Version="7.0.3" />
<PackageVersion Include="Shouldly" Version="4.2.1" />
</ItemGroup>

</Project>
7 changes: 5 additions & 2 deletions eng/Versions.props
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
<Project>

<PropertyGroup>
<MajorVersion>7</MajorVersion>
<MajorVersion>8</MajorVersion>
<MinorVersion>0</MinorVersion>
<PatchVersion>1</PatchVersion>
<PatchVersion>0</PatchVersion>
<VersionPrefix>$(MajorVersion).$(MinorVersion).$(PatchVersion)</VersionPrefix>
<!--
TODO Change to 8.0.0 post-release
-->
<PackageValidationBaselineVersion>7.0.0</PackageValidationBaselineVersion>
<PreReleaseVersionLabel>preview</PreReleaseVersionLabel>
<PreReleaseVersionIteration></PreReleaseVersionIteration>
Expand Down
4 changes: 4 additions & 0 deletions eng/common/BuildConfiguration/build-configuration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"RetryCountLimit": 1,
"RetryByAnyError": false
}
2 changes: 1 addition & 1 deletion eng/common/SetupNugetSources.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ if ($dotnet31Source -ne $null) {
AddPackageSource -Sources $sources -SourceName "dotnet3.1-internal-transport" -SourceEndPoint "https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal-transport/nuget/v2" -Creds $creds -Username $userName -Password $Password
}

$dotnetVersions = @('5','6','7')
$dotnetVersions = @('5','6','7','8')

foreach ($dotnetVersion in $dotnetVersions) {
$feedPrefix = "dotnet" + $dotnetVersion;
Expand Down
2 changes: 1 addition & 1 deletion eng/common/SetupNugetSources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ if [ "$?" == "0" ]; then
PackageSources+=('dotnet3.1-internal-transport')
fi

DotNetVersions=('5' '6' '7')
DotNetVersions=('5' '6' '7' '8')

for DotNetVersion in ${DotNetVersions[@]} ; do
FeedPrefix="dotnet${DotNetVersion}";
Expand Down
2 changes: 1 addition & 1 deletion eng/common/cross/arm/sources.list.xenial
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ deb http://ports.ubuntu.com/ubuntu-ports/ xenial-backports main restricted
deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-backports main restricted

deb http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted universe multiverse
deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted universe multiverse
deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted universe multiverse
35 changes: 0 additions & 35 deletions eng/common/cross/arm/tizen-build-rootfs.sh

This file was deleted.

170 changes: 0 additions & 170 deletions eng/common/cross/arm/tizen-fetch.sh

This file was deleted.

2 changes: 1 addition & 1 deletion eng/common/cross/arm64/sources.list.xenial
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ deb http://ports.ubuntu.com/ubuntu-ports/ xenial-backports main restricted
deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-backports main restricted

deb http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted universe multiverse
deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted universe multiverse
deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted universe multiverse
Loading

0 comments on commit b30d42e

Please sign in to comment.