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] precompile SetVsMonoAndroidRegistryKey (#…
…2130) In `Xamarin.Android.Sdk.props` we have some inline C# code for a MSBuild task named `SetVsMonoAndroidRegistryKey`. Which is understandable, since the code needed is so simple. But thinking about it, MSBuild has to *compile* this code to run it. Which seems inherently slower than if we compiled the code during our build. Currently its entire parent target, `RedirectMonoAndroidSdkPaths`, takes: 157 ms RedirectMonoAndroidSdkPaths 1 calls I moved this task inside `Xamarin.Android.Build.Tasks.dll`, and we appear to get some improvements "for free": 76 ms RedirectMonoAndroidSdkPaths 1 calls I looked at some past logs, and there are some times where the `RedirectMonoAndroidSdkPaths` target was taking over 200ms. I suspect MSBuild might also have some caching functionality for inlined C# code. There might be a cached assembly somewhere? Not sure. What makes this a better fix is that this target runs for all builds--even builds with no changes. General changes: - The `<UsingTask/>` doesn't need a condition, since it will be lazily evaluated anyways. - Used string interpolation where it looked nicer. - Used `LogDebugMessage()` and improved the log message.
- Loading branch information