Commit 7dfbab6
authored
[generator] Add [SupportedOSPlatform] to bound constant fields (#1038)
Context: #1037
Currently we do not add `[SupportedOSPlatform]` attributes to bound
`const` fields, which can lead to customers using them on platforms
where they are not supported:
namespace Android.Telecom {
public partial class TelecomManager : Java.Lang.Object {
[Register("ACTION_POST_CALL", ApiSince=30)]
public const string ActionPostCall = "android.telecom.action.POST_CALL";
}
}
Update `generator` so that `[SupportedOSPlatform]` is emitted for
such `const` fields:
namespace Android.Telecom {
public partial class TelecomManager : Java.Lang.Object {
[Register("ACTION_POST_CALL", ApiSince=30)]
[global::System.Runtime.Versioning.SupportedOSPlatformAttribute ("android30.0")]
public const string ActionPostCall = "android.telecom.action.POST_CALL";
}
}
Note this does not address the `enum` part of #1037, which will
require a much more involved fix.1 parent 1720628 commit 7dfbab6
File tree
2 files changed
+19
-0
lines changed- tests/generator-Tests/Unit-Tests
- tools/generator/SourceWriters
2 files changed
+19
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
736 | 736 | | |
737 | 737 | | |
738 | 738 | | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
739 | 757 | | |
740 | 758 | | |
741 | 759 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
0 commit comments