Commit 2f06e64
committed
[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.1 parent 476921a commit 2f06e64
File tree
5 files changed
+21
-66
lines changed- src/Xamarin.Android.Build.Tasks
- MSBuild/Xamarin/Android
- Tasks
- Utilities
5 files changed
+21
-66
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
Lines changed: 4 additions & 30 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
| |||
42 | 41 | | |
43 | 42 | | |
44 | 43 | | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
| 44 | + | |
56 | 45 | | |
57 | | - | |
| 46 | + | |
58 | 47 | | |
59 | 48 | | |
60 | 49 | | |
| |||
71 | 60 | | |
72 | 61 | | |
73 | 62 | | |
74 | | - | |
| 63 | + | |
75 | 64 | | |
76 | | - | |
| 65 | + | |
77 | 66 | | |
78 | 67 | | |
79 | 68 | | |
80 | 69 | | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | 70 | | |
96 | 71 | | |
97 | 72 | | |
| |||
102 | 77 | | |
103 | 78 | | |
104 | 79 | | |
105 | | - | |
106 | 80 | | |
107 | 81 | | |
108 | 82 | | |
| |||
Lines changed: 15 additions & 30 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
| 85 | + | |
84 | 86 | | |
85 | 87 | | |
86 | 88 | | |
| |||
123 | 125 | | |
124 | 126 | | |
125 | 127 | | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | 128 | | |
135 | 129 | | |
136 | 130 | | |
| |||
157 | 151 | | |
158 | 152 | | |
159 | 153 | | |
160 | | - | |
| 154 | + | |
161 | 155 | | |
162 | 156 | | |
163 | 157 | | |
| |||
214 | 208 | | |
215 | 209 | | |
216 | 210 | | |
217 | | - | |
| 211 | + | |
218 | 212 | | |
219 | 213 | | |
220 | 214 | | |
221 | 215 | | |
222 | 216 | | |
223 | 217 | | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
| 218 | + | |
232 | 219 | | |
233 | | - | |
| 220 | + | |
234 | 221 | | |
235 | 222 | | |
236 | 223 | | |
| |||
272 | 259 | | |
273 | 260 | | |
274 | 261 | | |
275 | | - | |
| 262 | + | |
276 | 263 | | |
277 | | - | |
278 | | - | |
279 | 264 | | |
280 | 265 | | |
281 | 266 | | |
| |||
293 | 278 | | |
294 | 279 | | |
295 | 280 | | |
| 281 | + | |
296 | 282 | | |
297 | 283 | | |
298 | 284 | | |
299 | 285 | | |
300 | | - | |
| 286 | + | |
301 | 287 | | |
302 | 288 | | |
303 | 289 | | |
304 | 290 | | |
305 | 291 | | |
306 | 292 | | |
307 | 293 | | |
308 | | - | |
| 294 | + | |
309 | 295 | | |
310 | | - | |
311 | | - | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
312 | 299 | | |
313 | 300 | | |
314 | 301 | | |
| |||
368 | 355 | | |
369 | 356 | | |
370 | 357 | | |
371 | | - | |
| 358 | + | |
372 | 359 | | |
373 | 360 | | |
374 | | - | |
| 361 | + | |
375 | 362 | | |
376 | 363 | | |
377 | | - | |
378 | | - | |
379 | 364 | | |
380 | 365 | | |
381 | 366 | | |
| |||
Lines changed: 0 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | 293 | | |
298 | 294 | | |
299 | 295 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2032 | 2032 | | |
2033 | 2033 | | |
2034 | 2034 | | |
2035 | | - | |
| 2035 | + | |
2036 | 2036 | | |
2037 | 2037 | | |
2038 | 2038 | | |
| |||
0 commit comments