diff --git a/Documentation/docs-mobile/building-apps/build-properties.md b/Documentation/docs-mobile/building-apps/build-properties.md index 41efdfafdae..7d41ce429f7 100644 --- a/Documentation/docs-mobile/building-apps/build-properties.md +++ b/Documentation/docs-mobile/building-apps/build-properties.md @@ -1245,7 +1245,7 @@ This means that in Release configuration builds -- in which This can result in increased app sizes. This behavior can be overridden by explicitly setting `$(AndroidEnableProfiledAot)` to `true` within your project file. -Support for this property was added in .NET 8. +Experimental support for this property was added in .NET 8, removed in .NET 10. ## AndroidSupportedAbis diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.Aot.targets b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.Aot.targets index 17d7009cc86..d80be84d01c 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.Aot.targets +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.Aot.targets @@ -137,50 +137,14 @@ They run in a context of an inner build with a single $(RuntimeIdentifier). LLVMPath="$(_LLVMPath)" LdName="$(_LdName)" LdFlags="$(_LdFlags)" - CollectTrimmingEligibleMethods="$(AndroidStripILAfterAOT)" + CollectTrimmingEligibleMethods="$(_AndroidCollectTrimmingEligibleMethods)" TrimmingEligibleMethodsOutputDirectory="$(IntermediateOutputPath)tokens" WorkingDirectory="$(MSBuildProjectDirectory)" AotArguments="$(AndroidAotAdditionalArguments)"> - - - - - - <_UpdateStamp Include="@(_ILStripUpdatedAssemblies)" Condition=" '$(AndroidStripILAfterAOT)' == 'true' and '%(_ILStripUpdatedAssemblies.ILStripped)' == 'true' " /> - - - - - <_StampDir>$(_AndroidStampDirectory)\..\..\stamp - - - true <_AndroidXA1030 Condition=" '$(RunAOTCompilation)' == 'true' and '$(PublishTrimmed)' == 'false' ">true $(RunAOTCompilation) - true + true diff --git a/tests/MSBuildDeviceIntegration/Tests/InstallAndRunTests.cs b/tests/MSBuildDeviceIntegration/Tests/InstallAndRunTests.cs index d179740e994..d4e1cb54878 100644 --- a/tests/MSBuildDeviceIntegration/Tests/InstallAndRunTests.cs +++ b/tests/MSBuildDeviceIntegration/Tests/InstallAndRunTests.cs @@ -1087,44 +1087,6 @@ public void FastDeployEnvironmentFiles (bool isRelease, bool embedAssembliesInto } } - [Test] - public void EnableAndroidStripILAfterAOT ([Values (false, true)] bool profiledAOT) - { - var proj = new XamarinAndroidApplicationProject { - ProjectName = nameof (EnableAndroidStripILAfterAOT), - RootNamespace = nameof (EnableAndroidStripILAfterAOT), - IsRelease = true, - EnableDefaultItems = true, - }; - proj.SetProperty("AndroidStripILAfterAOT", "true"); - proj.SetProperty("AndroidEnableProfiledAot", profiledAOT.ToString ()); - // So we can use Mono.Cecil to open assemblies directly - proj.SetProperty ("AndroidEnableAssemblyCompression", "false"); - - var builder = CreateApkBuilder (); - Assert.IsTrue (builder.Build (proj), "`dotnet build` should succeed"); - - var apk = Path.Combine (Root, builder.ProjectDirectory, proj.OutputPath, $"{proj.PackageName}-Signed.apk"); - FileAssert.Exists (apk); - var helper = new ArchiveAssemblyHelper (apk); - Assert.IsTrue (helper.Exists ($"assemblies/{proj.ProjectName}.dll"), $"{proj.ProjectName}.dll should exist in apk!"); - using (var stream = helper.ReadEntry ($"assemblies/{proj.ProjectName}.dll")) { - stream.Position = 0; - using var assembly = AssemblyDefinition.ReadAssembly (stream); - var type = assembly.MainModule.GetType ($"{proj.RootNamespace}.MainActivity"); - var method = type.Methods.FirstOrDefault (p => p.Name == "OnCreate"); - Assert.IsNotNull (method, $"{proj.RootNamespace}.MainActivity.OnCreate should exist!"); - Assert.IsTrue (!method.HasBody || method.Body.Instructions.Count == 0, $"{proj.RootNamespace}.MainActivity.OnCreate should have no body!"); - } - - RunProjectAndAssert (proj, builder); - - WaitForPermissionActivity (Path.Combine (Root, builder.ProjectDirectory, "permission-logcat.log")); - bool didLaunch = WaitForActivityToStart (proj.PackageName, "MainActivity", - Path.Combine (Root, builder.ProjectDirectory, "logcat.log"), 30); - Assert.IsTrue(didLaunch, "Activity should have started."); - } - [Test] public void FixLegacyResourceDesignerStep ([Values (true, false)] bool isRelease) {