-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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 (#22282)
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`. Note: * Skip `maui-blazor` on iOS for now, as it contains trimmer warnings.
- Loading branch information
1 parent
837f579
commit a45f702
Showing
5 changed files
with
51 additions
and
25 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
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