-
Notifications
You must be signed in to change notification settings - Fork 533
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Xamarin.Android.Build.Tasks] downgrade d8/r8
warning
messages to `…
…info` (#7643) Fixes: dotnet/maui#10901 Context: https://r8.googlesource.com/r8/+/refs/tags/3.3.75/src/main/java/com/android/tools/r8/BaseCompilerCommandParser.java#246 Building a .NET MAUI project such as: dotnet new maui dotnet build -c Release -f net6.0-android -p:AndroidLinkMode=r8 Results in build warnings from R8 such as: R8 : warning : Missing class androidx.window.extensions.WindowExtensions In 92bc705, we already had attempted to silence warnings from R8: R8 : warning : Resource 'META-INF/MANIFEST.MF' already exists. At the time, there was no option to hide warnings, but now there is! --map-diagnostics[:<type>] <from-level> <to-level> # Map diagnostics of <type> (default any) reported as # <from-level> to <to-level> where <from-level> and # <to-level> are one of 'info', 'warning', or 'error' and the # optional <type> is either the simple or fully qualified # Java type name of a diagnostic. If <type> is unspecified, # all diagnostics at <from-level> will be mapped. # Note that fatal compiler errors cannot be mapped. We can pass: --map-diagnostics warning info Which can be done in existing apps via: <AndroidD8ExtraArguments>--map-diagnostics warning info</AndroidD8ExtraArguments> <AndroidR8ExtraArguments>--map-diagnostics warning info</AndroidR8ExtraArguments> To solve this problem, let's create a new `$(AndroidD8IgnoreWarnings)` MSBuild property and make use of one we already have `$(AndroidR8IgnoreWarnings)`: <ItemGroup> <_AndroidD8MapDiagnostics Condition=" '$(AndroidD8IgnoreWarnings)' == 'true' " Include="warning" To="info" /> <_AndroidR8MapDiagnostics Condition=" '$(AndroidR8IgnoreWarnings)' == 'true' " Include="warning" To="info" /> </ItemGroup> We can then use these item groups to pass `--map-diagnostics` as appropriate. Developers can turn off either property to disable this behavior. We can then remove the weird `Regex` code added in 92bc705. The existing tests from 92bc705 should also be sufficient for testing this change.
- Loading branch information
1 parent
22f2001
commit b7138f1
Showing
4 changed files
with
34 additions
and
16 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