Skip to content

Commit

Permalink
Update to NET 8 SDK
Browse files Browse the repository at this point in the history
* tests and samples target NET8.0
* use artifacts output
* move .props to root level
  • Loading branch information
lahma committed Nov 19, 2023
1 parent 63ee615 commit 62ae640
Show file tree
Hide file tree
Showing 15 changed files with 30 additions and 26 deletions.
3 changes: 3 additions & 0 deletions src/Directory.Build.props → Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
<LangVersion>latest</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Nullable>enable</Nullable>

<UseArtifactsOutput>true</UseArtifactsOutput>

</PropertyGroup>

</Project>
File renamed without changes.
4 changes: 2 additions & 2 deletions build/Build.CI.GitHubActions.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Nuke.Common.CI.GitHubActions;

[GitHubActionsAttribute(
[GitHubActions(
"pr",
GitHubActionsImage.WindowsLatest,
GitHubActionsImage.UbuntuLatest,
Expand All @@ -11,7 +11,7 @@
InvokedTargets = new[] { nameof(Compile), nameof(Test), nameof(Pack) },
CacheKeyFiles = new[] { "global.json", "src/**/*.csproj", "src/**/package.json" }),
]
[GitHubActionsAttribute(
[GitHubActions(
"build",
GitHubActionsImage.WindowsLatest,
GitHubActionsImage.UbuntuLatest,
Expand Down
4 changes: 2 additions & 2 deletions build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ string DetermineVersionPrefix()
}
else
{
var propsDocument = XDocument.Parse((SourceDirectory / "Directory.Build.props").ReadAllText());
var propsDocument = XDocument.Parse((RootDirectory / "Directory.Build.props").ReadAllText());
versionPrefix = propsDocument.Element("Project").Element("PropertyGroup").Element("VersionPrefix").Value;
Serilog.Log.Information("Version prefix {VersionPrefix} read from Directory.Build.props", versionPrefix);
}
Expand Down Expand Up @@ -128,7 +128,7 @@ protected override void OnBuildInitialized()
var framework = "";
if (!IsRunningOnWindows)
{
framework = "net6.0";
framework = "net8.0";
}
DotNetTest(s => s
Expand Down
5 changes: 4 additions & 1 deletion build/_build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace></RootNamespace>
<NoWarn>CS0649;CS0169</NoWarn>
<NukeRootDirectory>..</NukeRootDirectory>
<NukeScriptDirectory>..</NukeScriptDirectory>
<NukeTelemetryVersion>1</NukeTelemetryVersion>
<IsPackable>false</IsPackable>
<EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization>
<ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally>
<UseArtifactsOutput>false</UseArtifactsOutput>
</PropertyGroup>

<ItemGroup>
Expand Down
6 changes: 6 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"sdk": {
"version": "8.0.100",
"rollForward": "latestMinor"
}
}
2 changes: 1 addition & 1 deletion src/NJsonSchema.Benchmark/NJsonSchema.Benchmark.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<GenerateProgramFile>false</GenerateProgramFile>
<NoWarn>$(NoWarn),xUnit1013</NoWarn>
<SignAssembly>false</SignAssembly>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn),1587,1998,1591,618,SYSLIB0012</NoWarn>
Expand All @@ -16,8 +16,8 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Condition="'$(TargetFramework)' == 'net6.0'" />
<PackageReference Condition="'$(TargetFramework)' == 'net6.0'" Include="System.ComponentModel.Annotations" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Condition="'$(TargetFramework)' == 'net8.0'" />
<PackageReference Condition="'$(TargetFramework)' == 'net8.0'" Include="System.ComponentModel.Annotations" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net462</TargetFrameworks>
<TargetFrameworks>net8.0;net462</TargetFrameworks>
<IsPackable>false</IsPackable>
<NoWarn>$(NoWarn),1998,1591,618</NoWarn>
<Nullable>disable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Condition="'$(TargetFramework)' == 'net462'" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Condition="'$(TargetFramework)' == 'net6.0'" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Condition="'$(TargetFramework)' == 'net8.0'" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net462</TargetFrameworks>
<TargetFrameworks>net8.0;net462</TargetFrameworks>
<IsPackable>false</IsPackable>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn),1587,1998,1591,618</NoWarn>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/NJsonSchema.Demo/NJsonSchema.Demo.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
<GenerateProgramFile>true</GenerateProgramFile>
<ApplicationIcon />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net462</TargetFrameworks>
<TargetFrameworks>net8.0;net462</TargetFrameworks>
<IsPackable>false</IsPackable>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<Nullable>disable</Nullable>
Expand Down
2 changes: 1 addition & 1 deletion src/NJsonSchema.Yaml.Tests/NJsonSchema.Yaml.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net462</TargetFrameworks>
<TargetFrameworks>net8.0;net462</TargetFrameworks>
<IsPackable>false</IsPackable>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<Nullable>disable</Nullable>
Expand Down
12 changes: 2 additions & 10 deletions src/NJsonSchema.sln
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NJsonSchema.Yaml.Tests", "N
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "00 Build", "00 Build", "{863B2D88-A0BD-4466-8583-AAD0B8D3F182}"
ProjectSection(SolutionItems) = preProject
Directory.Build.props = Directory.Build.props
Directory.Packages.props = Directory.Packages.props
Directory.Build.props = ..\Directory.Build.props
Directory.Packages.props = ..\Directory.Packages.props
..\README.md = ..\README.md
EndProjectSection
EndProject
Expand Down Expand Up @@ -245,21 +245,13 @@ Global
{990EF464-C967-4E08-8C3D-0568A47B6D2A}.Release|x86.ActiveCfg = Release|Any CPU
{990EF464-C967-4E08-8C3D-0568A47B6D2A}.Release|x86.Build.0 = Release|Any CPU
{8E4E5A64-B5B7-4718-A92F-CB6B08512264}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8E4E5A64-B5B7-4718-A92F-CB6B08512264}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8E4E5A64-B5B7-4718-A92F-CB6B08512264}.Debug|ARM.ActiveCfg = Debug|Any CPU
{8E4E5A64-B5B7-4718-A92F-CB6B08512264}.Debug|ARM.Build.0 = Debug|Any CPU
{8E4E5A64-B5B7-4718-A92F-CB6B08512264}.Debug|x64.ActiveCfg = Debug|Any CPU
{8E4E5A64-B5B7-4718-A92F-CB6B08512264}.Debug|x64.Build.0 = Debug|Any CPU
{8E4E5A64-B5B7-4718-A92F-CB6B08512264}.Debug|x86.ActiveCfg = Debug|Any CPU
{8E4E5A64-B5B7-4718-A92F-CB6B08512264}.Debug|x86.Build.0 = Debug|Any CPU
{8E4E5A64-B5B7-4718-A92F-CB6B08512264}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8E4E5A64-B5B7-4718-A92F-CB6B08512264}.Release|Any CPU.Build.0 = Release|Any CPU
{8E4E5A64-B5B7-4718-A92F-CB6B08512264}.Release|ARM.ActiveCfg = Release|Any CPU
{8E4E5A64-B5B7-4718-A92F-CB6B08512264}.Release|ARM.Build.0 = Release|Any CPU
{8E4E5A64-B5B7-4718-A92F-CB6B08512264}.Release|x64.ActiveCfg = Release|Any CPU
{8E4E5A64-B5B7-4718-A92F-CB6B08512264}.Release|x64.Build.0 = Release|Any CPU
{8E4E5A64-B5B7-4718-A92F-CB6B08512264}.Release|x86.ActiveCfg = Release|Any CPU
{8E4E5A64-B5B7-4718-A92F-CB6B08512264}.Release|x86.Build.0 = Release|Any CPU
{A9C2A9CD-44F6-4A21-9D72-00CF5BE0A36F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A9C2A9CD-44F6-4A21-9D72-00CF5BE0A36F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A9C2A9CD-44F6-4A21-9D72-00CF5BE0A36F}.Debug|ARM.ActiveCfg = Debug|Any CPU
Expand Down

0 comments on commit 62ae640

Please sign in to comment.