Commit 3a4e712
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 a small perf improvement:
* `<FilterAssemblies/>` only needs to look for obsolete attributes in
assemblies that reference `Mono.Android.dll`.
~~ Results ~~
Testing a build with no changes for the SmartHotel360 app:
Before:
60 ms FilterAssemblies 2 calls
After:
49 ms FilterAssemblies 2 calls
I would think there is a small ~11ms performance improvement to all
builds of this app.1 parent 476921a commit 3a4e712
File tree
5 files changed
+14
-54
lines changed- src/Xamarin.Android.Build.Tasks
- MSBuild/Xamarin/Android
- Tasks
- Utilities
5 files changed
+14
-54
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: 8 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | | - | |
| 217 | + | |
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
| 224 | + | |
232 | 225 | | |
233 | | - | |
| 226 | + | |
234 | 227 | | |
235 | 228 | | |
236 | 229 | | |
| |||
272 | 265 | | |
273 | 266 | | |
274 | 267 | | |
275 | | - | |
| 268 | + | |
276 | 269 | | |
277 | | - | |
278 | | - | |
279 | 270 | | |
280 | 271 | | |
281 | 272 | | |
| |||
293 | 284 | | |
294 | 285 | | |
295 | 286 | | |
| 287 | + | |
296 | 288 | | |
297 | 289 | | |
298 | 290 | | |
299 | 291 | | |
300 | | - | |
| 292 | + | |
301 | 293 | | |
302 | 294 | | |
303 | 295 | | |
| |||
368 | 360 | | |
369 | 361 | | |
370 | 362 | | |
371 | | - | |
| 363 | + | |
372 | 364 | | |
373 | 365 | | |
374 | | - | |
| 366 | + | |
375 | 367 | | |
376 | 368 | | |
377 | | - | |
378 | | - | |
379 | 369 | | |
380 | 370 | | |
381 | 371 | | |
| |||
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