Skip to content

Commit

Permalink
Add .NET 8 support (#425)
Browse files Browse the repository at this point in the history
  • Loading branch information
RussKie authored Nov 24, 2022
1 parent 519148d commit 2784705
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 6 deletions.
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
<LangVersion>Latest</LangVersion>
<MSBuildTreatWarningsAsErrors>true</MSBuildTreatWarningsAsErrors>
<NoWarn>$(NoWarn);SA0001;SA1515;SA1005;SA1629;NETSDK1192</NoWarn>
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
</PropertyGroup>
</Project>
6 changes: 6 additions & 0 deletions azure-pipelines-official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ variables:
DotNet5Version: '5.x'
DotNet6Version: '6.x'
DotNet7Version: '7.x'
DotNet8Version: '8.x'
MSBuildArgs: '"/Property:Platform=$(BuildPlatform);Configuration=$(BuildConfiguration)" "/BinaryLogger:$(Build.SourcesDirectory)\$(ArtifactsDirectoryName)\msbuild.binlog"'
SignType: 'Test'

Expand Down Expand Up @@ -56,6 +57,11 @@ stages:
version: '$(DotNet7Version)'
includePreviewVersions: true

- script: |
powershell -NoProfile -ExecutionPolicy unrestricted -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; &([scriptblock]::Create((Invoke-WebRequest -UseBasicParsing 'https://dot.net/v1/dotnet-install.ps1'))) -Channel 8.0 -Quality daily -InstallDir D:\a\_work\_tool\dotnet"
dotnet --info
displayName: 'Install .NET $(DotNet8Version)'
- task: MicroBuildSigningPlugin@1
displayName: 'Install MicroBuild Signing Plugin'
inputs:
Expand Down
29 changes: 28 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ variables:
DotNet5Version: '5.x'
DotNet6Version: '6.x'
DotNet7Version: '7.x'
DotNet8Version: '8.x'
MSBuildArgs: '"/Property:Platform=$(BuildPlatform);Configuration=$(BuildConfiguration)"'
SignType: 'Test'

Expand Down Expand Up @@ -68,6 +69,24 @@ jobs:
version: '$(DotNet7Version)'
includePreviewVersions: true

- script: |
powershell -NoProfile -ExecutionPolicy unrestricted -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; &([scriptblock]::Create((Invoke-WebRequest -UseBasicParsing 'https://dot.net/v1/dotnet-install.ps1'))) -Channel 8.0 -Quality daily -InstallDir C:\hostedtoolcache\windows\dotnet"
dotnet --info
displayName: 'Install .NET $(DotNet8Version) (Windows)'
condition: eq(variables.osName, 'Windows')
- script: |
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel 8.0 --quality daily --install-dir /opt/hostedtoolcache/dotnet
dotnet --info
displayName: 'Install .NET $(DotNet8Version) (Linux)'
condition: eq(variables.osName, 'Linux')
- script: |
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel 8.0 --quality daily --install-dir /Users/runner/hostedtoolcache/dotnet
dotnet --info
displayName: 'Install .NET $(DotNet8Version) (MacOS)'
condition: eq(variables.osName, 'MacOS')
- task: VSBuild@1
displayName: 'Build (Visual Studio)'
inputs:
Expand Down Expand Up @@ -117,10 +136,18 @@ jobs:
displayName: 'Run Unit Tests (.NET 7)'
inputs:
command: 'test'
arguments: '--no-restore --no-build --framework net7.0 /noautorsp $(MSBuildArgs) "/BinaryLogger:$(ArtifactsDirectoryName)/test-net6.0.binlog"'
arguments: '--no-restore --no-build --framework net7.0 /noautorsp $(MSBuildArgs) "/BinaryLogger:$(ArtifactsDirectoryName)/test-net7.0.binlog"'
testRunTitle: '$(osName) .NET 7.0'
condition: succeededOrFailed()

- task: DotNetCoreCLI@2
displayName: 'Run Unit Tests (.NET 8)'
inputs:
command: 'test'
arguments: '--no-restore --no-build --framework net8.0 /noautorsp $(MSBuildArgs) "/BinaryLogger:$(ArtifactsDirectoryName)/test-net8.0.binlog"'
testRunTitle: '$(osName) .NET 8.0'
condition: succeededOrFailed()

- task: PublishBuildArtifacts@1
displayName: 'Publish Artifacts'
inputs:
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": "6.0.0",
"version": "7.0.0",
"rollForward": "latestMajor",
"allowPrerelease": true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@
ReferenceOutputAssembly="false"
SkipGetTargetFrameworkProperties="true"
TargetFramework="net7.0" />
<ProjectReference Include="..\Microsoft.VisualStudio.SlnGen\Microsoft.VisualStudio.SlnGen.csproj"
SetTargetFramework="TargetFramework=net8.0"
IncludeAssets="None"
OutputItemType="SlnGenBuildOutput"
PrivateAssets="All"
ReferenceOutputAssembly="false"
SkipGetTargetFrameworkProperties="true"
TargetFramework="net8.0" />
</ItemGroup>
<Target Name="CopySlnGenToOutputDirectoryAndPackage"
AfterTargets="PrepareForRun"
Expand Down
4 changes: 4 additions & 0 deletions src/Microsoft.VisualStudio.SlnGen.Tool/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ public static int Main(string[] args)
framework = "net7.0";
break;

case "8":
framework = "net8.0";
break;

default:
Console.WriteLine($"SlnGen does not currently support the .NET SDK {developmentEnvironment.DotNetSdkVersion} defined by in global.json. Please update to the latest version and if you still get this error message, file an issue at https://github.com/microsoft/slngen/issues/new so it can be added.");

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net472;netcoreapp3.1;net5.0;net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net472;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0</TargetFrameworks>
<IsPackable>false</IsPackable>
<NoWarn>$(NoWarn);SA1600</NoWarn>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net461;net472;netcoreapp3.1;net5.0;net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net461;net472;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0</TargetFrameworks>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.config</AllowedOutputExtensionsInPackageBuildOutputFolder>
<IncludeReferenceCopyLocalPathsInBuildOutputInPackage>true</IncludeReferenceCopyLocalPathsInBuildOutputInPackage>
<IsTool>true</IsTool>
Expand Down Expand Up @@ -31,7 +31,7 @@
<Reference Include="$(PkgMicrosoft_Build_Runtime)\contentFiles\any\net472\MSBuild.exe" Private="false" Condition="'$(TargetFramework)' == 'net472'" />
<Reference Include="$(PkgMicrosoft_Build_Runtime)\contentFiles\any\netcoreapp2.1\MSBuild.dll" Private="false" Condition="'$(TargetFramework)' == 'netcoreapp3.1'" />
<Reference Include="$(PkgMicrosoft_Build_Runtime)\contentFiles\any\net5.0\MSBuild.dll" Private="false" Condition="'$(TargetFramework)' == 'net5.0'" />
<Reference Include="$(PkgMicrosoft_Build_Runtime)\contentFiles\any\net6.0\MSBuild.dll" Private="false" Condition="'$(TargetFramework)' == 'net6.0' Or '$(TargetFramework)' == 'net7.0'" />
<Reference Include="$(PkgMicrosoft_Build_Runtime)\contentFiles\any\net6.0\MSBuild.dll" Private="false" Condition="'$(TargetFramework)' == 'net6.0' Or '$(TargetFramework)' == 'net7.0' Or '$(TargetFramework)' == 'net8.0'" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" Condition="'$(TargetFramework)' == 'net461' Or '$(TargetFramework)' == 'net472'" />
Expand Down
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://raw.githubusercontent.com/AArnott/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
"version": "8.6",
"version": "9.0",
"assemblyVersion": "3.0",
"buildNumberOffset": -1,
"publicReleaseRefSpec": [
Expand Down

0 comments on commit 2784705

Please sign in to comment.