Skip to content

Commit 9457b72

Browse files
committed
Enable AOT/trimming warnings on TreeDataGrid project
1 parent 81b76ad commit 9457b72

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

src/Avalonia.Controls.TreeDataGrid/Avalonia.Controls.TreeDataGrid.csproj

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net5.0</TargetFramework>
3+
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
44
<IsPackable>True</IsPackable>
5-
<LangVersion>10</LangVersion>
65
<RootNamespace>Avalonia.Controls</RootNamespace>
76
</PropertyGroup>
87
<PropertyGroup>
@@ -13,4 +12,19 @@
1312

1413
<PackageReference Include="System.Reactive" Version="6.0.0" />
1514
</ItemGroup>
15+
16+
<!-- Trimming -->
17+
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">
18+
<SuppressTrimAnalysisWarnings>false</SuppressTrimAnalysisWarnings>
19+
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
20+
<TrimmerSingleWarn>false</TrimmerSingleWarn>
21+
<IsTrimmable>true</IsTrimmable>
22+
<ILLinkTreatWarningsAsErrors>true</ILLinkTreatWarningsAsErrors>
23+
</PropertyGroup>
24+
25+
<!-- AOT -->
26+
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">
27+
<IsAotCompatible Condition="'$(IsAotCompatible)' == ''">true</IsAotCompatible>
28+
</PropertyGroup>
29+
1630
</Project>

src/Avalonia.Controls.TreeDataGrid/Models/TreeDataGrid/AnonymousRow.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ namespace Avalonia.Controls.Models.TreeDataGrid
1515
internal class AnonymousRow<TModel> : IRow<TModel>, IModelIndexableRow
1616
{
1717
private int _modelIndex;
18-
[AllowNull] private TModel _model;
18+
private TModel? _model;
1919

2020
public object? Header => _modelIndex;
21-
public TModel Model => _model;
21+
public TModel Model => _model!;
2222
public int ModelIndex => _modelIndex;
2323
public IndexPath ModelIndexPath => _modelIndex;
2424

0 commit comments

Comments
 (0)