forked from dotnet/maui
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[build] make
TrimMode=full
function like NativeAOT
Context: dotnet/android#8805 Context: xamarin/xamarin-macios#20354 In .NET 9, we want .NET MAUI applications to be able to use the `TrimMode=full` option to remove unused code from the application: <PropertyGroup Condition="'$(Configuration)' == 'Release'"> <TrimMode>full</TrimMode> </PropertyGroup> With all the trimming work done to support NativeAOT, we should toggle the same options when `TrimMode=full` is used: * `MauiStrictXamlCompilation=true` * `MauiXamlRuntimeParsingSupport=false` * `MauiShellSearchResultsRendererDisplayMemberNameSupported=false` * `MauiQueryPropertyAttributeSupport=false` * `MauiImplicitCastOperatorsUsageViaReflectionSupport=false` With these set, the `dotnet new maui` project template *should* have zero trimmer warnings when `TrimMode=full` is used. Developers can also adjust these settings and respond to trimmer warnings in their own code. I also updated `RunOnAndroid` and `RunOniOS` tests to verify that project templates launch successfully with `TrimMode=full`.
- Loading branch information
1 parent
fd6be16
commit 4559dfc
Showing
4 changed files
with
38 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters