Commit 120d8a7
authored
[generator] Add more [ObsoleteOSPlatform] to prevent CA1422 (#1078)
Context: dotnet/android#7590
Context: dotnet/android@7004467
While building `Mono.Android.dll`, we had 1462 `CA1422` warnings of the
following caused by an interface being marked as `[ObsoleteOSPlatform]`
but the interface invoker class is not similarly annotated:
…\xamarin-android\src\Mono.Android\obj\Debug\net8.0\android-33\mcw\Org.Apache.Commons.Logging.ILog.cs(128,11):
warning CA1422: This call site is reachable on: 'Android' 21.0 and later.
'ILog' is obsoleted on: 'Android' 22.0 and later (This class is obsoleted in this android platform).
There were also 42 `CA1422` warnings caused by interface async
extension classes not having `[ObsoleteOSPlatform]` attributes:
…\xamarin-android\src\Mono.Android\obj\Debug\net8.0\android-33\mcw\Org.Apache.Http.IO.ISessionOutputBuffer.cs(52,58):
warning CA1422: This call site is reachable on: 'Android' 21.0 and later.
'ISessionOutputBuffer.Write(byte[]?, int, int)' is obsoleted on: 'Android' 22.0 and later (This class is obsoleted in this android platform).
These warnings were disabled in dotnet/android@70044670.
Fix these warnings by adding the `[ObsoleteOSPlatform]` attribute to
these types if the source interface is deprecated.1 parent 8a1ae57 commit 120d8a7
File tree
3 files changed
+34
-0
lines changed- tests/generator-Tests/Unit-Tests
- tools/generator/SourceWriters
3 files changed
+34
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
611 | 611 | | |
612 | 612 | | |
613 | 613 | | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
614 | 644 | | |
615 | 645 | | |
616 | 646 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
| |||
0 commit comments