Skip to content

Commit

Permalink
Update .NET 8 SDK (#351)
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesNK authored May 28, 2024
1 parent ef8fec0 commit 29b1e14
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 31 deletions.
11 changes: 5 additions & 6 deletions Build/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
$workingName = if ($workingName) {$workingName} else {"Working"}
$assemblyVersion = if ($assemblyVersion) {$assemblyVersion} else {$majorVersion + '.0.0'}
$netCliChannel = "STS"
$netCliVersion = "6.0.300"
$netCliVersion = "8.0.300"
$nugetUrl = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"
$ensureNetCliSdk = $true

Expand All @@ -33,8 +33,8 @@
$nunitConsolePath = "$buildDir\Temp\NUnit.ConsoleRunner.$nunitConsoleVersion"

$builds = @(
@{Framework = "netstandard2.0"; TestsFunction = "NetCliTests"; TestFramework = "netcoreapp3.1"; Enabled=$true}
@{Framework = "netstandard2.1"; TestsFunction = "NetCliTests"; TestFramework = "net6.0"; Enabled=$true}
@{Framework = "netstandard2.0"; TestsFunction = "NetCliTests"; TestFramework = "net6.0"; Enabled=$true}
@{Framework = "netstandard2.1"; TestsFunction = "NetCliTests"; TestFramework = "net8.0"; Enabled=$true}
@{Framework = "net45"; TestsFunction = "NUnitTests"; TestFramework = "net46"; NUnitFramework="net-4.0"; Enabled=$true},
@{Framework = "net40"; TestsFunction = "NUnitTests"; NUnitFramework="net-4.0"; Enabled=$true},
@{Framework = "net35"; TestsFunction = "NUnitTests"; NUnitFramework="net-2.0"; Enabled=$true}
Expand Down Expand Up @@ -173,8 +173,7 @@ function EnsureDotnetCli()
-OutFile "$buildDir\Temp\dotnet-install.ps1"

exec { & $buildDir\Temp\dotnet-install.ps1 -Channel $netCliChannel -Version $netCliVersion | Out-Default }
exec { & $buildDir\Temp\dotnet-install.ps1 -Channel $netCliChannel -Version '3.1.402' | Out-Default }
exec { & $buildDir\Temp\dotnet-install.ps1 -Channel $netCliChannel -Version '2.1.811' | Out-Default }
exec { & $buildDir\Temp\dotnet-install.ps1 -Channel $netCliChannel -Version '6.0.300' | Out-Default }
}

function EnsureNuGetExists()
Expand Down Expand Up @@ -234,7 +233,7 @@ function NetCliTests($build)
Write-Host "Project path: $projectPath"
Write-Host

exec { dotnet test $projectPath -f $testDir -c Release -l trx -r $workingDir --no-restore --no-build | Out-Default }
exec { dotnet test $projectPath -f $testDir -c Release -l trx --results-directory $workingDir --no-restore --no-build | Out-Default }
}
finally
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void ValidateData_Sha1_Failure()
Assert.IsFalse(valid);
}

#if !(NETCOREAPP3_1 || NET35)
#if !(NETSTANDARD2_0 || NET35)
[Test]
public void ValidateData_Sha256()
{
Expand Down
2 changes: 1 addition & 1 deletion Src/Newtonsoft.Json.Schema.Tests/JSchemaGeneratorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1152,7 +1152,7 @@ public void GenerateSchemaForType()
}

#if !DNXCORE50
#if !PORTABLE || NETSTANDARD1_3 || NETSTANDARD2_0
#if !PORTABLE || NETSTANDARD1_3 || NETSTANDARD2_0 || NETSTANDARD2_1
[Test]
public void GenerateSchemaForISerializable()
{
Expand Down
4 changes: 2 additions & 2 deletions Src/Newtonsoft.Json.Schema.Tests/LicenseTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void RegisterLicense_Sha1_Failure()
public void RegisterLicense_Sha256_Success_ish()
{
string licenseText = "1002-s/d/CeY2p5IJs1YycKRckMxyAW5Ol6fRqrWf2f8hjgcz8Vwv7qBnmCw4pF66Dj/xJkTEIyHyvbZNgcTp/pb6mASzwuwFj/CGG9HuGETNtlLYWyp+ZbG3tPqtQPAzGv4RnhgmyAclWlV//6XbF5LlUSZSJnf5Hs0FpKMaSZmRw5o/h/FoVitCOkONMlgI+6u3gDWRRz00vIdxOayFGucLMN6qAK8f46z3GbOBBgNYIMy2doJn+uo8nhrDueN4W9zTRx3YtgprDi9r9UnHn8/rAVGAPDYJPwS7GyfZu4zWOFODSZ8a8g2Tc/yWXhbrzs8ApPh0LrdIsc0loay2gjcpunsiSWQiOjEwMDIsIkV4cGlyeURhdGUiOiIyMTE2LTEyLTI3VDAwOjAwOjAwWiIsIlR5cGUiOiJUZXN0In0=";
#if NETCOREAPP3_1
#if NETSTANDARD2_0
string errorMessage = "License hash algorithm is not supported on this platform: SHA256";
#else
string errorMessage = "Specified test license expiried on 2116-12-27.";
Expand All @@ -54,7 +54,7 @@ public void RegisterLicense_Sha256_Success_ish()
public void RegisterLicense_Sha256_Failure()
{
string licenseText = "1003-s/d/CeY2p5IJs1YycKRckMxyAW5Ol6fRqrWf2f8hjgcz8Vwv7qBnmCw4pF66Dj/xJkTEIyHyvbZNgcTp/pb6mASzwuwFj/CGG9HuGETNtlLYWyp+ZbG3tPqtQPAzGv4RnhgmyAclWlV//6XbF5LlUSZSJnf5Hs0FpKMaSZmRw5o/h/FoVitCOkONMlgI+6u3gDWRRz00vIdxOayFGucLMN6qAK8f46z3GbOBBgNYIMy2doJn+uo8nhrDueN4W9zTRx3YtgprDi9r9UnHn8/rAVGAPDYJPwS7GyfZu4zWOFODSZ8a8g2Tc/yWXhbrzs8ApPh0LrdIsc0loay2gjcpunsiSWQiOjEwMDIsIkV4cGlyeURhdGUiOiIyMTE2LTEyLTI3VDAwOjAwOjAwWiIsIlR5cGUiOiJUZXN0In0=";
#if NETCOREAPP3_1
#if NETSTANDARD2_0
string errorMessage = "License hash algorithm is not supported on this platform: SHA256";
#else
string errorMessage = "License ID does not match signature license ID.";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks Condition="'$(TestFrameworks)'==''">net46;net40;net35;netcoreapp3.1;net6.0;</TargetFrameworks>
<TargetFrameworks Condition="'$(TestFrameworks)'==''">net46;net40;net35;net6.0;net8.0;</TargetFrameworks>
<TargetFrameworks Condition="'$(TestFrameworks)'!=''">$(TestFrameworks)</TargetFrameworks>
<VersionPrefix>1.0</VersionPrefix>
<Authors>Newtonsoft</Authors>
Expand All @@ -12,7 +12,7 @@
<AssemblyName>Newtonsoft.Json.Schema.Tests</AssemblyName>
<IsPackable>false</IsPackable>
<!-- Workaround for https://github.com/nunit/nunit3-vs-adapter/issues/296 -->
<DebugType Condition="'$(TargetFramework)' != '' AND '$(TargetFramework)' != 'netcoreapp3.1' AND '$(TargetFramework)' != 'net6.0'">Full</DebugType>
<DebugType Condition="'$(TargetFramework)' != '' AND '$(TargetFramework)' != 'net6.0' AND '$(TargetFramework)' != 'net8.0'">Full</DebugType>
<NoWarn>1685;1701;1702;1705</NoWarn>
<!-- Disabled because SourceLink isn't referenced to calculate paths -->
<DeterministicSourcePaths>false</DeterministicSourcePaths>
Expand Down Expand Up @@ -60,7 +60,7 @@
<DefineConstants>NET35;$(AdditionalConstants)</DefineConstants>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)'=='netcoreapp3.1'">
<ItemGroup Condition="'$(TargetFramework)'=='net6.0'">
<PackageReference Include="BenchmarkDotNet" Version="$(BenchmarkDotNetPackageVersion)" />
<PackageReference Include="FSharp.Core" Version="$(FSharpCorePackageVersion)" />
<PackageReference Include="System.ComponentModel.Annotations" Version="$(SystemComponentModelAnnotationsPackageVersion)" />
Expand All @@ -69,13 +69,13 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkPackageVersion)" />
</ItemGroup>

<PropertyGroup Condition="'$(TargetFramework)'=='netcoreapp3.1'">
<PropertyGroup Condition="'$(TargetFramework)'=='net6.0'">
<AssemblyTitle>Json.NET Schema Tests .NET Standard 2.0</AssemblyTitle>
<ReferringTargetFrameworkForProjectReferences>.NETStandard,Version=v2.0</ReferringTargetFrameworkForProjectReferences>
<DefineConstants>NETSTANDARD1_3;DNXCORE50;PORTABLE;HAVE_BENCHMARKS;$(AdditionalConstants)</DefineConstants>
<DefineConstants>NETSTANDARD2_0;DNXCORE50;PORTABLE;HAVE_BENCHMARKS;$(AdditionalConstants)</DefineConstants>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)'=='net6.0'">
<ItemGroup Condition="'$(TargetFramework)'=='net8.0'">
<PackageReference Include="BenchmarkDotNet" Version="$(BenchmarkDotNetPackageVersion)" />
<PackageReference Include="FSharp.Core" Version="$(FSharpCorePackageVersion)" />
<PackageReference Include="System.ComponentModel.Annotations" Version="$(SystemComponentModelAnnotationsPackageVersion)" />
Expand All @@ -84,9 +84,9 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkPackageVersion)" />
</ItemGroup>

<PropertyGroup Condition="'$(TargetFramework)'=='net6.0'">
<PropertyGroup Condition="'$(TargetFramework)'=='net8.0'">
<AssemblyTitle>Json.NET Schema Tests .NET Standard 2.1</AssemblyTitle>
<ReferringTargetFrameworkForProjectReferences>.NETStandard,Version=v2.1</ReferringTargetFrameworkForProjectReferences>
<DefineConstants>NETSTANDARD1_3;DNXCORE50;PORTABLE;HAVE_BENCHMARKS;$(AdditionalConstants)</DefineConstants>
<DefineConstants>NETSTANDARD2_1;DNXCORE50;PORTABLE;HAVE_BENCHMARKS;$(AdditionalConstants)</DefineConstants>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion Src/global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "6.0.300",
"version": "8.0.300",
"rollForward": "latestFeature"
}
}
14 changes: 2 additions & 12 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,11 @@ variables:
steps:
- task: UseDotNet@2
inputs:
version: '6.0.x'

- task: UseDotNet@2
inputs:
version: '2.1.x'
packageType: runtime
version: '8.0.x'

- task: UseDotNet@2
inputs:
version: '3.1.x'
packageType: runtime

- task: UseDotNet@2
inputs:
version: '5.0.x'
version: '6.0.x'
packageType: runtime

- powershell: |
Expand Down

0 comments on commit 29b1e14

Please sign in to comment.