Commit 8c24b8f
authored
[Xamarin.Android.Build.Tasks] skip XA1034 logic in some cases (#7680)
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
Just by moving the task around, it is faster in general:
CheckForInvalidDesignerConfig = 11 ms
This is due to less assemblies passed in than before:
Assemblies="@(_MonoAndroidReferencePath);@(_MonoAndroidReferenceDependencyPaths)"
While previously, we were checking *all* assemblies.1 parent c92ae5e commit 8c24b8f
File tree
4 files changed
+58
-36
lines changed- src/Xamarin.Android.Build.Tasks
- MSBuild/Xamarin/Android
- Tasks
- Utilities
4 files changed
+58
-36
lines changedLines changed: 2 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
142 | 143 | | |
143 | 144 | | |
144 | 145 | | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
| 146 | + | |
154 | 147 | | |
155 | 148 | | |
156 | 149 | | |
| |||
Lines changed: 0 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | 38 | | |
44 | 39 | | |
45 | 40 | | |
| |||
Lines changed: 56 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
Lines changed: 0 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
325 | 325 | | |
326 | 326 | | |
327 | 327 | | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | 328 | | |
351 | 329 | | |
352 | 330 | | |
| |||
0 commit comments