Repository navigation
[System.Runtime.InteropServices] Introduce broader platform definitions. - #27378
migueldeicaza wants to merge 1 commit into
Conversation
Unity, Xamarin and Mono users suffers from a historic problem with platform detection. This patch introduces definitions for all the existing platforms that .NET supports beyond .NET Core via Unity and Xamarin. To cope with the historical setting that OSX has been used in existing code to probe for an Apple OS (iOS, tvOS, watchOS), we introduce new values for all four apple platforms (macOS, iOS, tvOS, watchOS) and also return true when probed for the legacy OSX setting. The same principle is applied to Linux, we will continue to return true, but the more specific versions of Tizen and Android are supported. The list has been expanded to all the platforms currently supported by Mono and Unity.
|
Hey @migueldeicaza! Thanks for the PR. For new public surface area, we follow the process outlined in https://github.com/dotnet/corefx/blob/master/Documentation/project-docs/api-review-process.md, which essentially includes opening an issue proposing the new APIs with rationale and then reviewing that in a weekly API review meeting; once APIs are approved, PRs can be opened to fix that issue by implementing/exposing the members. Mind opening such an issue and closing this in the interim? You can mark the issue as api-ready-for-review so that it appears in the searches done when going through issues in the review meeting. |
| { | ||
| private readonly string _osPlatform; | ||
|
|
||
| public static OSPlatform Android { get; } = new OSPlatform("ANDROID"); |
There was a problem hiding this comment.
For such members to actually be exposed, they'd also need to be added to the .cs file in the ref folder, as that's what influences the reference assembly:
https://github.com/migueldeicaza/corefx/blob/23055b101d38f16a84dfe23a3b0a05807381926c/src/System.Runtime.InteropServices.RuntimeInformation/ref/System.Runtime.InteropServices.RuntimeInformation.cs
| return OSPlatform.Tizen.Equals (name) || | ||
| OSPlatform.Android.Equals (name); | ||
| } | ||
| return false; |
There was a problem hiding this comment.
Nit: indentation here is all wonky
|
cc: @weshaggard, @terrajobst |
|
Pull request to discuss the API change proposal: Closing this in the meantime. |
Unity, Xamarin and Mono users suffers from a historic problem with
platform detection. This patch introduces definitions for all the
existing platforms that .NET supports beyond .NET Core via Unity and
Xamarin.
To cope with the historical setting that OSX has been used in existing
code to probe for an Apple OS (iOS, tvOS, watchOS), we introduce new
values for all four apple platforms (macOS, iOS, tvOS, watchOS) and
also return true when probed for the legacy OSX setting.
The same principle is applied to Linux, we will continue to return
true, but the more specific versions of Tizen and Android are
supported.
The list has been expanded to all the platforms currently supported by
Mono and Unity.