diff --git a/src/Microsoft.Android.Sdk.ILLink/WarnOnPreserveAttribute.cs b/src/Microsoft.Android.Sdk.ILLink/WarnOnPreserveAttribute.cs deleted file mode 100644 index ec845dad5ca..00000000000 --- a/src/Microsoft.Android.Sdk.ILLink/WarnOnPreserveAttribute.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using Mono.Cecil; -using Mono.Linker; -using Mono.Linker.Steps; -using Xamarin.Android.Tasks; - -namespace Microsoft.Android.Sdk.ILLink -{ - /// - /// This step provides warnings when an assembly references the obsolete PresrveAttribute. - /// The PreserveAttribute used to indicate to the linker that a type or member should not be trimmed. - /// It had similar functionality to the newer DynamicDependencyAttribute, but was Android-specific and is now obsolete. - /// - public class WarnOnPreserveAttribute : BaseStep { - protected override void ProcessAssembly (AssemblyDefinition assembly) - { - foreach (var module in assembly.Modules) { - foreach (var tr in module.GetTypeReferences ()) { - if (tr is { - Namespace: "Android.Runtime", - Name: "PreserveAttribute", - }) { - Context.LogMessage (MessageContainer.CreateCustomWarningMessage( - Context, - $"Assembly '{assembly.Name.Name}' contains reference to obsolete attribute 'Android.Runtime.PreserveAttribute'. Members with this attribute may be trimmed. Please use System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute instead", - 6001, - new MessageOrigin (), - WarnVersion.ILLink0)); - return; - } - } - } - } - } -} diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets index 9cc9b0e77b7..b1717d2b0fe 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets @@ -10,6 +10,7 @@ _ResolveAssemblies MSBuild target. + @@ -226,6 +227,10 @@ _ResolveAssemblies MSBuild target. + + + + <_AndroidIncludeSystemGlobalizationNative Condition=" '$(_AndroidIncludeSystemGlobalizationNative)' == '' ">true diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.ILLink.targets b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.ILLink.targets index c0c7ff7de09..d5411d79619 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.ILLink.targets +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.ILLink.targets @@ -39,10 +39,6 @@ This file contains the .NET 5-specific targets to customize ILLink Value="$(_ProguardProjectConfiguration)" /> <_TrimmerCustomData Include="SystemIOHashingAssemblyPath" Value="$(_SystemIOHashingAssemblyPath)" /> - <_TrimmerCustomSteps - Include="$(_AndroidLinkerCustomStepAssembly)" - BeforeStep="MarkStep" - Type="Microsoft.Android.Sdk.ILLink.WarnOnPreserveAttribute" />