-
Notifications
You must be signed in to change notification settings - Fork 538
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Xamarin.Android.Build.Tasks] remove TFI == MonoAndroid checks
In preparation for .NET 5, we think the `$(TargetFrameworkMoniker)` *might* be: .NETCoreApp,Version=5.0,Profile=Xamarin.Android It might also be `Profile=Android`, we don't know for sure yet. The TFM currently is: MonoAndroid,Version=v10.0 I think we can (and should) remove any code during the build that looks at `$(TargetFrameworkIdentifier)`. The places we are currently doing this are for performance: * The `_ResolveLibraryProjectImports` or `_GenerateJavaStubs` targets do not need to run against .NET standard assemblies. We can rely on a reference to `Mono.Android.dll` instead. We are already using System.Reflection.Metadata to see if the assembly actually has this reference. So an example of the condition: Condition="'%(ResolvedUserAssemblies.TargetFrameworkIdentifier)' == 'MonoAndroid' Or '%(ResolvedUserAssemblies.HasMonoAndroidReference)' == 'True'" Can just be: Condition="'%(ResolvedUserAssemblies.HasMonoAndroidReference)' == 'True'" I also took the opportunity for two small perf improvements: * `<FilterAssemblies/>` only needs to look for obsolete attributes in assemblies that reference `Mono.Android.dll`. * `<ResolveAssemblies/>` was collection a dictionary of API levels and then iterating over it later to emit warnings. This now just emits warnings as assemblies are processed. ~~ Results ~~ Testing a build with no changes for the SmartHotel360 app: Before: 60 ms FilterAssemblies 2 calls 318 ms ResolveAssemblies 1 calls After: 49 ms FilterAssemblies 2 calls 317 ms ResolveAssemblies 1 calls I would think there is a small ~12ms performance improvement to all builds of this app.
- Loading branch information
1 parent
476921a
commit 2f06e64
Showing
5 changed files
with
21 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters