diff --git a/Documentation/guides/messages/README.md b/Documentation/guides/messages/README.md index 32f8410f448..65c162779fe 100644 --- a/Documentation/guides/messages/README.md +++ b/Documentation/guides/messages/README.md @@ -129,6 +129,7 @@ or 'Help->Report a Problem' in Visual Studio for Mac. + [XA1025](xa1025.md): The experimental 'Hybrid' value for the 'AndroidAotMode' MSBuild property is not currently compatible with the armeabi-v7a target ABI. + [XA1027](xa1027.md): The 'EnableProguard' MSBuild property is set to 'true' and the 'AndroidLinkTool' MSBuild property is empty, so 'AndroidLinkTool' will default to 'proguard'. + [XA1028](xa1028.md): The 'AndroidEnableProguard' MSBuild property is set to 'true' and the 'AndroidLinkTool' MSBuild property is empty, so 'AndroidLinkTool' will default to 'proguard'. ++ [XA1029](xa1029.md): The 'AotAssemblies' MSBuild property is deprecated. Edit the project file in a text editor to remove this property, and use the 'RunAOTCompilation' MSBuild property instead. ## XA2xxx: Linker diff --git a/Documentation/guides/messages/xa1029.md b/Documentation/guides/messages/xa1029.md new file mode 100644 index 00000000000..8f8a74f0515 --- /dev/null +++ b/Documentation/guides/messages/xa1029.md @@ -0,0 +1,30 @@ +--- +title: Xamarin.Android warning XA1029 +description: XA1029 warning code +ms.date: 09/06/2022 +--- +# Xamarin.Android warning XA1029 + +## Example messages + +``` +warning XA1029: The 'AotAssemblies' MSBuild property is deprecated. Edit the project file in a text editor to remove this property, and use the 'RunAOTCompilation' MSBuild property instead. +``` + +## Solution + +Instead of using: + +```xml + + true + +``` + +Use instead: + +```xml + + true + +``` 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 55284ce2a3a..a1692029bbf 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 @@ -78,6 +78,7 @@ true true false + <_AndroidXA1029 Condition=" '$(AotAssemblies)' != '' ">true $(RunAOTCompilation) true diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx b/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx index 56f2e75b2f0..509fe13fdfc 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx @@ -462,6 +462,10 @@ In this message, the term "binding" means a piece of generated code that makes i The 'AndroidEnableProguard' MSBuild property is set to 'true' and the 'AndroidLinkTool' MSBuild property is empty, so 'AndroidLinkTool' will default to 'proguard'. The following are literal names and should not be translated: 'AndroidEnableProguard', 'true', 'AndroidLinkTool', 'proguard' + + The 'AotAssemblies' MSBuild property is deprecated. Edit the project file in a text editor to remove this property, and use the 'RunAOTCompilation' MSBuild property instead. + The following are literal names and should not be translated: 'AotAssemblies', 'RunAOTCompilation' + Use of AppDomain.CreateDomain() detected in assembly: {0}. .NET 6 and higher will only support a single AppDomain, so this API will no longer be available in Xamarin.Android once .NET 6 is released. The following are literal names and should not be translated: AppDomain.CreateDomain(), AppDomain diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs index 7a75278ac17..f2d51942134 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs @@ -1717,9 +1717,9 @@ public void XA0119Interpreter () { var proj = new XamarinAndroidApplicationProject { IsRelease = true, + AotAssemblies = true, }; proj.SetProperty ("UseInterpreter", "true"); - proj.SetProperty ("AotAssemblies", "true"); using (var builder = CreateApkBuilder ()) { builder.ThrowOnBuildFailure = false; Assert.IsTrue (builder.Build (proj), "Build should have succeeded."); diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Android/KnownProperties.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Android/KnownProperties.cs index 55f90015f86..f59a3c9cc75 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Android/KnownProperties.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Android/KnownProperties.cs @@ -16,6 +16,7 @@ public static class KnownProperties public const string AndroidSupportedAbis = "AndroidSupportedAbis"; public const string RuntimeIdentifier = "RuntimeIdentifier"; public const string RuntimeIdentifiers = "RuntimeIdentifiers"; + public const string RunAOTCompilation = "RunAOTCompilation"; public const string PublishTrimmed = "PublishTrimmed"; public const string SupportedOSPlatformVersion = "SupportedOSPlatformVersion"; diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Android/XamarinAndroidApplicationProject.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Android/XamarinAndroidApplicationProject.cs index d3a4b595b01..7e462f5cc64 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Android/XamarinAndroidApplicationProject.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Android/XamarinAndroidApplicationProject.cs @@ -108,9 +108,11 @@ public bool BundleAssemblies { set { SetProperty (KnownProperties.BundleAssemblies, value.ToString ()); } } + string AotAssembliesPropertyName => Builder.UseDotNet ? KnownProperties.RunAOTCompilation : KnownProperties.AotAssemblies; + public bool AotAssemblies { - get { return string.Equals (GetProperty (KnownProperties.AotAssemblies), "True", StringComparison.OrdinalIgnoreCase); } - set { SetProperty (KnownProperties.AotAssemblies, value.ToString ()); } + get { return string.Equals (GetProperty (AotAssembliesPropertyName), "True", StringComparison.OrdinalIgnoreCase); } + set { SetProperty (AotAssembliesPropertyName, value.ToString ()); } } public bool AndroidEnableProfiledAot { diff --git a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets index 686fb70c67d..0759bf12963 100644 --- a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets +++ b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets @@ -507,6 +507,10 @@ Copyright (C) 2011-2012 Xamarin. All rights reserved. ResourceName="XA1028" Condition=" $(_AndroidXA1028) == 'true' " /> +