Commit b90c559
authored
[trimmer] pass
Fixes: #9399
An alternative to: #9411
The .NET trimmer will inline cast statements such as:
var d = Application.Context.Resources.GetDrawable (resId);
Assert.IsNotNull (d as NinePatchDrawable);
If `NinePatchDrawable` is not "instantiated" anywhere via `new()`,
then the above statements are rewritten/inlined to:
var d = Application.Context.Resources.GetDrawable (resId);
Assert.IsNotNull (null); // BOOM!
We can solve this by passing `--disable-opt unusedtypechecks`, with
`$(_AndroidEnableUnusedTypeChecks)` as a private MSBuild property to
opt out if needed.
Since Java can create these objects, this feels like the reasonable
fix for .NET 9 GA.
I also fixed the `$(RuntimeIdentifiers)` in `TestApks.targets` to
check if someone passed `-r android-arm64`, for example.--disable-opt unusedtypechecks (#9435)1 parent 7516d54 commit b90c559
File tree
3 files changed
+2
-3
lines changed- build-tools/scripts
- src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets
- tests/Mono.Android-Tests/Android.Graphics
3 files changed
+2
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.ILLink.targets
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
Lines changed: 0 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | 28 | | |
30 | 29 | | |
31 | 30 | | |
| |||
34 | 33 | | |
35 | 34 | | |
36 | 35 | | |
37 | | - | |
38 | 36 | | |
39 | 37 | | |
40 | 38 | | |
| |||
0 commit comments