diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeAOT.targets b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeAOT.targets index 22c17ef17f0..a6b22f41b7d 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeAOT.targets +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeAOT.targets @@ -53,7 +53,7 @@ This file contains the NativeAOT-specific MSBuild logic for .NET for Android. - + _AndroidBeforeIlcCompile; SetupOSSpecificProps; @@ -63,10 +63,22 @@ This file contains the NativeAOT-specific MSBuild logic for .NET for Android. _AndroidComputeIlcCompileInputs; $(IlcCompileDependsOn) + <_AndroidBeforeIlcCompileDependsOn>_PrepareLinking + + + + + _AndroidBeforeIlcCompile; + SetupOSSpecificProps; + ComputeIlcCompileInputs; + _AndroidComputeIlcCompileInputs; + $(IlcCompileDependsOn) + + <_AndroidBeforeIlcCompileDependsOn>_CreatePropertiesCache @@ -125,7 +137,10 @@ This file contains the NativeAOT-specific MSBuild logic for .NET for Android. Since we handle native linking ourselves, LinkerFlavor is not needed. Context: https://github.com/dotnet/runtime/issues/126978 --> + + + true $(_OriginalSuppressTrimAnalysisWarnings) @@ -152,26 +167,32 @@ This file contains the NativeAOT-specific MSBuild logic for .NET for Android. - - <_IlcManagedInputAssemblies Remove="@(_IlcManagedInputAssemblies)" /> - - + + + <_IlcManagedInputAssemblies Remove="@(_IlcManagedInputAssemblies)" /> + + + + - <_AndroidILLinkAssemblies Include="@(ManagedAssemblyToLink->'$(IntermediateLinkDir)%(Filename)%(Extension)')" Condition="Exists('$(IntermediateLinkDir)%(Filename)%(Extension)')" /> - + - - + <_AndroidILLinkAssemblies Include="@(ManagedAssemblyToLink->'$(IntermediateLinkDir)%(Filename)%(Extension)')" Condition="Exists('$(IntermediateLinkDir)%(Filename)%(Extension)')" /> - - + + + @@ -336,9 +357,13 @@ This file contains the NativeAOT-specific MSBuild logic for .NET for Android. Restore the old scheduling so NativeCompile runs after ComputeResolvedFilesToPublishList in the inner per-RID build. --> + + <_AndroidRunNativeCompileDependsOn Condition=" '$(_AndroidTypeMapImplementation)' != 'trimmable' ">_PreTrimmingFixLegacyDesignerUpdateItems;NativeCompile + <_AndroidRunNativeCompileDependsOn Condition=" '$(_AndroidTypeMapImplementation)' == 'trimmable' ">NativeCompile + + DependsOnTargets="$(_AndroidRunNativeCompileDependsOn)" />