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 #316

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
6 changes: 1 addition & 5 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }}
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.0.x
8.0.x
- name: Install dependencies
run: dotnet restore
- name: Build
Expand Down
58 changes: 29 additions & 29 deletions .nuke/build.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
"type": "boolean",
"description": "Indicates to continue a previously failed build attempt"
},
"ForceNugetVersion": {
"type": "string",
"description": "force-nuget-version"
},
"Help": {
"type": "boolean",
"description": "Shows the help text for this build assembly"
Expand Down Expand Up @@ -57,22 +61,6 @@
"type": "string"
}
},
"PublishFramework": {
"type": "string",
"description": "publish-framework"
},
"PublishProject": {
"type": "string",
"description": "publish-project"
},
"PublishRuntime": {
"type": "string",
"description": "publish-runtime"
},
"PublishSelfContained": {
"type": "boolean",
"description": "publish-self-contained"
},
"Root": {
"type": "string",
"description": "Root directory during build execution"
Expand All @@ -83,31 +71,47 @@
"items": {
"type": "string",
"enum": [
"CiAzureLinux",
"CiAzureOSX",
"CiAzureWindows",
"Clean",
"Compile",
"Pack",
"Publish",
"Restore",
"Test"
"CreateNugetPackages",
"Package",
"RunCoreLibsTests",
"RunTests",
"ZipFiles"
]
}
},
"SkipPreviewer": {
"type": "boolean",
"description": "skip-previewer"
},
"SkipTests": {
"type": "boolean",
"description": "skip-tests"
},
"Solution": {
"type": "string",
"description": "Path to a solution file that is automatically loaded"
"description": "Path to a solution file that is automatically loaded. Default is Avalonia.Controls.TreeDataGrid.sln"
},
"Target": {
"type": "array",
"description": "List of targets to be invoked. Default is '{default_target}'",
"items": {
"type": "string",
"enum": [
"CiAzureLinux",
"CiAzureOSX",
"CiAzureWindows",
"Clean",
"Compile",
"Pack",
"Publish",
"Restore",
"Test"
"CreateNugetPackages",
"Package",
"RunCoreLibsTests",
"RunTests",
"ZipFiles"
]
}
},
Expand All @@ -120,10 +124,6 @@
"Quiet",
"Verbose"
]
},
"VersionSuffix": {
"type": "string",
"description": "version-suffix"
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions Avalonia.Controls.TreeDataGrid.sln
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{AE911386-1B6E-4148-AE8F-9D27325349AF}"
ProjectSection(SolutionItems) = preProject
Directory.Build.props = Directory.Build.props
NuGet.config = NuGet.config
global.json = global.json
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "_build", "nukebuild\_build.csproj", "{D45C7B46-A12C-4412-8397-B51B75A09999}"
Expand Down
1 change: 0 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<Nullable>enable</Nullable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsAsErrors>nullable</WarningsAsErrors>
<TargetFramework>net6.0</TargetFramework>
<LangVersion>12</LangVersion>
<!-- https://github.com/dotnet/msbuild/issues/2661 -->
<AddSyntheticProjectReferencesForSolutionDependencies>false</AddSyntheticProjectReferencesForSolutionDependencies>
Expand Down
4 changes: 4 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ pool:
vmImage: ubuntu-latest

steps:
- task: UseDotNet@2
inputs:
useGlobalJson: true

- task: CmdLine@2
displayName: 'Install Nuke'
inputs:
Expand Down
4 changes: 3 additions & 1 deletion nukebuild/_build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<RootNamespace></RootNamespace>
<IsPackable>False</IsPackable>
<NoWarn>CS0649;CS0169</NoWarn>
<NukeTelemetryVersion>1</NukeTelemetryVersion>
<EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion samples/TreeDataGridDemo/TreeDataGridDemo.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>False</IsPackable>
<OutputType>WinExe</OutputType>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFrameworks>net5.0;net6.0;net8.0</TargetFrameworks>
<IsPackable>True</IsPackable>
<RootNamespace>Avalonia.Controls</RootNamespace>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ namespace Avalonia.Controls.Models.TreeDataGrid
internal class AnonymousRow<TModel> : IRow<TModel>, IModelIndexableRow
{
private int _modelIndex;
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring as nullable.
[AllowNull] private TModel _model;
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring as nullable.

public object? Header => _modelIndex;
public TModel Model => _model;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>False</IsPackable>
<RootNamespace>Avalonia.Controls.TreeDataGridTests</RootNamespace>
</PropertyGroup>
Expand Down