Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Xamarin.Android.Build.Tasks] skip XA1034 logic in some cases #7680

Merged

Commits on Jan 9, 2023

  1. [Xamarin.Android.Build.Tasks] skip XA1034 logic in some cases

    After profiling a build for a `dotnet new maui` app, I noticed:
    
        193.41ms xamarin.android.build.tasks!Xamarin.Android.Tasks.MonoAndroidHelper.HasResourceDesignerAssemblyReference()
    
    Which equates to:
    
        Top 10 most expensive tasks
        ...
        AppendCustomMetadataToItemGroup = 204 ms
    
    In dc3ccf2, we added this check to emit `XA1034` when
    `$(AndroidUseDesignerAssembly)` is false. And so we don't actually
    need to validate this value when it is `true` (the default).
    
    I moved the logic from the `<AppendCustomMetadataToItemGroup/>`
    MSBuild task to a new `<CheckForInvalidDesignerConfig/>` task. In most
    projects, it will be completely skipped:
    
        Target "_CheckForInvalidDesignerConfig" skipped, due to false condition; ( '$(AndroidUseDesignerAssembly)' != 'True' ) was evaluated as ( 'true' != 'True' ).
    
    After these changes, I get a much better number in projects with
    default settings:
    
        AppendCustomMetadataToItemGroup = 2 ms
    jonathanpeppers committed Jan 9, 2023
    Configuration menu
    Copy the full SHA
    1e33a4e View commit details
    Browse the repository at this point in the history

Commits on Jan 10, 2023

  1. Configuration menu
    Copy the full SHA
    9e16e70 View commit details
    Browse the repository at this point in the history
  2. Add null check

    jonathanpeppers committed Jan 10, 2023
    Configuration menu
    Copy the full SHA
    d03a6a2 View commit details
    Browse the repository at this point in the history