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

Update to .NET 8 SDK #1002

Merged
merged 4 commits into from
Nov 16, 2023
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
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Refer to https://hub.docker.com/_/microsoft-dotnet-sdk for available versions
FROM mcr.microsoft.com/dotnet/sdk:7.0.401-jammy
FROM mcr.microsoft.com/dotnet/sdk:8.0.100-jammy

# Installing mono makes `dotnet test` work without errors even for net472.
# But installing it takes a long time, so it's excluded by default.
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<BaseOutputPath Condition=" '$(BaseOutputPath)' == '' ">$(RepoRootPath)bin\$(MSBuildProjectName)\</BaseOutputPath>
<PackageOutputPath>$(RepoRootPath)bin\Packages\$(Configuration)\</PackageOutputPath>
<DocumentationRootFolder>$(MSBuildThisFileDirectory)..\wiki\api</DocumentationRootFolder>
<LangVersion>11</LangVersion>
<LangVersion>12</LangVersion>
<!--<Nullable>enable</Nullable>-->
<ImplicitUsings>enable</ImplicitUsings>
<AnalysisLevel>latest</AnalysisLevel>
Expand Down
4 changes: 2 additions & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
<PackageVersion Include="System.Diagnostics.Tools" Version="4.3.0" />
<PackageVersion Include="System.Memory" Version="4.5.5" />
<PackageVersion Include="System.Runtime.Loader" Version="4.3.0" />
<PackageVersion Include="System.Text.Json" Version="7.0.3" />
<PackageVersion Include="System.Threading.Tasks.Dataflow" Version="7.0.0" />
<PackageVersion Include="System.Text.Json" Version="8.0.0" />
<PackageVersion Include="System.Threading.Tasks.Dataflow" Version="8.0.0" />
<PackageVersion Include="Validation" Version="2.5.51" />
<PackageVersion Include="Xunit.Combinatorial" Version="1.6.24" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.3" />
Expand Down
28 changes: 21 additions & 7 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,12 @@ resources:
image: mcr.microsoft.com/dotnet/sdk:6.0-jammy
- container: jammy70
image: mcr.microsoft.com/dotnet/sdk:7.0-jammy
- container: debian
- container: jammy80
image: mcr.microsoft.com/dotnet/sdk:8.0-jammy
- container: debian70
image: mcr.microsoft.com/dotnet/sdk:7.0
- container: debian80
image: mcr.microsoft.com/dotnet/sdk:8.0

variables:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
Expand All @@ -54,12 +58,22 @@ stages:
matrix:
Ubuntu_Focal:
containerImage: focal
testCake: true
Ubuntu_Jammy_60:
containerImage: jammy60
testCake: true
Ubuntu_Jammy_70:
containerImage: jammy70
Debian:
containerImage: debian
testCake: true
Ubuntu_Jammy_80:
containerImage: jammy80
testCake: false
Debian_70:
containerImage: debian70
testCake: true
Debian_80:
containerImage: debian80
testCake: false
pool:
vmImage: ubuntu-22.04
container: $[ variables['containerImage'] ]
Expand Down Expand Up @@ -105,10 +119,10 @@ stages:
clean: true
submodules: true # keep the warnings quiet about the wiki not being enlisted
- task: UseDotNet@2
displayName: Install .NET 7.0.401 SDK
displayName: Install .NET 8.0.100 SDK
inputs:
packageType: sdk
version: 7.0.401
version: 8.0.100
- script: dotnet --info
displayName: Show dotnet SDK info
- bash: |
Expand All @@ -122,7 +136,7 @@ stages:
dotnet build -c Release
displayName: Build in Release mode
- script: |
dotnet run -c Release -f net7.0 -- --filter *GetVersionBenchmarks* --artifacts $(Build.ArtifactStagingDirectory)/benchmarks/packed/$(imageName)
dotnet run -c Release -f net8.0 -- --filter *GetVersionBenchmarks* --artifacts $(Build.ArtifactStagingDirectory)/benchmarks/packed/$(imageName)
workingDirectory: test/Nerdbank.GitVersioning.Benchmarks
displayName: Run benchmarks (packed)
- bash: |
Expand All @@ -139,7 +153,7 @@ stages:
git unpack-objects < .git/objects/pack/*.pack
displayName: Unpack Git repositories
- script: |
dotnet run -c Release -f net7.0 -- --filter '*GetVersionBenchmarks*' --artifacts $(Build.ArtifactStagingDirectory)/benchmarks/unpacked/$(imageName)
dotnet run -c Release -f net8.0 -- --filter '*GetVersionBenchmarks*' --artifacts $(Build.ArtifactStagingDirectory)/benchmarks/unpacked/$(imageName)
workingDirectory: test/Nerdbank.GitVersioning.Benchmarks
displayName: Run benchmarks (unpacked)
- task: PublishBuildArtifacts@1
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- template: install-dependencies.yml
- pwsh: |
Invoke-WebRequest -Uri "https://dot.net/v1/dotnet-install.ps1" -OutFile dotnet-install.ps1
& .\dotnet-install.ps1 -Architecture x86 -Version 7.0.401 -InstallDir "C:\Program Files (x86)\dotnet\" -NoPath -Verbose
& .\dotnet-install.ps1 -Architecture x86 -Version 8.0.100 -InstallDir "C:\Program Files (x86)\dotnet\" -NoPath -Verbose
displayName: ⚙ Install 32-bit .NET SDK and runtimes
- template: dotnet.yml
Expand Down
1 change: 1 addition & 0 deletions azure-pipelines/xplattest-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ steps:
dotnet cake
displayName: Consume Cake.GitVersioning
condition: and(succeeded(), ne(variables.testCake, 'false'))
failOnStderr: true

- script: >
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "7.0.401",
"version": "8.0.100",
"rollForward": "patch",
"allowPrerelease": false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace Nerdbank.GitVersioning.Benchmarks
{
[SimpleJob(RuntimeMoniker.Net70)]
[SimpleJob(RuntimeMoniker.Net80)]
[SimpleJob(RuntimeMoniker.Net472, baseline: true)]
public class GetVersionBenchmarks
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net7.0</TargetFrameworks>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">$(TargetFrameworks);net472</TargetFrameworks>
<OutputType>Exe</OutputType>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand Down
2 changes: 1 addition & 1 deletion test/Nerdbank.GitVersioning.Tests/MSBuildExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ internal static void LoadMSBuild()
if (IntPtr.Size == 4)
{
// 32-bit .NET runtime requires special code to find the x86 SDK (where MSBuild is).
MSBuildLocator.RegisterMSBuildPath(@"C:\Program Files (x86)\dotnet\sdk\7.0.401");
MSBuildLocator.RegisterMSBuildPath(@"C:\Program Files (x86)\dotnet\sdk\8.0.100");
}
else
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net7.0</TargetFrameworks>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('Windows'))">$(TargetFrameworks);net472</TargetFrameworks>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
Expand Down