From 3137b6deb90da6123066aff649f03a121f61e201 Mon Sep 17 00:00:00 2001 From: Jonathan Peppers Date: Thu, 25 Mar 2021 22:28:43 -0500 Subject: [PATCH] [One .NET] default $(SuppressTrimAnalysisWarnings) to true (#5781) Fixes: https://github.com/xamarin/xamarin-android/issues/5751 After bumping to .NET 6 Preview 3, we get hundreds of ILLINK warnings. This is because of: https://github.com/dotnet/sdk/pull/16327 We need to default `$(SuppressTrimAnalysisWarnings)` to ignore these warnings for now. We should continue to use `TrimMode=link`, as that is the behavior Xamarin developers get today. --- .../targets/Microsoft.Android.Sdk.DefaultProperties.targets | 1 + .../Tests/Xamarin.Android.Build.Tests/XASdkTests.cs | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.DefaultProperties.targets b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.DefaultProperties.targets index 43ec903fdcd..463b639a7c2 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.DefaultProperties.targets +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.DefaultProperties.targets @@ -52,6 +52,7 @@ link SdkOnly None + true android-arm64;android-x86 diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/XASdkTests.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/XASdkTests.cs index db9074d682c..6f8b305dc9d 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/XASdkTests.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/XASdkTests.cs @@ -393,10 +393,7 @@ public void DotNetBuild (string runtimeIdentifiers, bool isRelease) var dotnet = CreateDotNetBuilder (proj); Assert.IsTrue (dotnet.Build (), "`dotnet build` should succeed"); - // TODO: run for release once illink warnings are gone - // context: https://github.com/xamarin/xamarin-android/issues/4708 - if (!isRelease) - Assert.IsTrue (StringAssertEx.ContainsText (dotnet.LastBuildOutput, " 0 Warning(s)"), "Should have no MSBuild warnings."); + Assert.IsTrue (StringAssertEx.ContainsText (dotnet.LastBuildOutput, " 0 Warning(s)"), "Should have no MSBuild warnings."); var outputPath = Path.Combine (FullProjectDirectory, proj.OutputPath); var intermediateOutputPath = Path.Combine (FullProjectDirectory, proj.IntermediateOutputPath);