-
Notifications
You must be signed in to change notification settings - Fork 565
[src] Add [Un]SupportedSimulator attributes. #25347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
rolfbjarne
wants to merge
6
commits into
main
Choose a base branch
from
dev/rolf/supportedsimulatorattribute
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
27a1db4
[src] Add [Un]SupportedSimulator attributes.
rolfbjarne 6b0a14b
Misc introspection cleanup.
rolfbjarne 3c922d2
Address review comments: extract helper, fix perf/error handling, imp…
rolfbjarne 293abb2
tweak
rolfbjarne 4dfd5eb
Add introspection test for simulator availability attributes
rolfbjarne fc0a48a
fixbuild
rolfbjarne File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
|
|
||
| #nullable enable | ||
|
|
||
| namespace ObjCRuntime { | ||
| /// <summary>Indicates that an API is supported for a specified platform. If a version is specified, the API is available starting in the specified OS version. Multiple attributes can be applied to indicate support on multiple operating systems.</summary> | ||
| /// <remarks> | ||
| /// <para>Contrary to standard availability attributes (such as <see cref="SupportedOSPlatformAttribute" /> attributes), the presence of this attribute for some platforms does not imply any meaning for other platforms.</para> | ||
| /// <para>If there are no <see cref="SupportedSimulatorAttribute" /> or <see cref="UnsupportedSimulatorAttribute" /> attributes on an API, the API is assumed to be available in the simulator.</para> | ||
| /// <para>This attribute will be trimmed away if the app is trimmed.</para> | ||
| /// </remarks> | ||
| [AttributeUsage (AttributeTargets.Class | AttributeTargets.Interface | AttributeTargets.Enum | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Constructor | AttributeTargets.Field, AllowMultiple = true)] | ||
| public sealed class SupportedSimulatorAttribute : Attribute { | ||
| /// <summary>Initializes a new <see cref="SupportedSimulatorAttribute" /> attribute.</summary> | ||
| /// <param name="platformName">The platform where this API is supported in the simulator. | ||
| /// Format: platform name (e.g., "ios", "tvos") optionally followed by a version number (e.g., "ios17.0").</param> | ||
| public SupportedSimulatorAttribute (string platformName) | ||
| { | ||
| PlatformName = platformName; | ||
| } | ||
|
|
||
| /// <summary>The name of the platform.</summary> | ||
| public string PlatformName { get; init; } | ||
| } | ||
|
|
||
| /// <summary>Indicates that an API is not supported in the simulator for the specified platform. Multiple attributes can be applied to indicate lack of support on multiple platforms.</summary> | ||
| /// <remarks> | ||
| /// <para>Contrary to standard availability attributes (such as <see cref="SupportedOSPlatformAttribute" /> attributes), the presence of this attribute for some platforms does not imply any meaning for other platforms.</para> | ||
| /// <para>If there are no <see cref="SupportedSimulatorAttribute" /> or <see cref="UnsupportedSimulatorAttribute" /> attributes on an API, the API is assumed to be available in the simulator.</para> | ||
| /// <para>This attribute will be trimmed away if the app is trimmed.</para> | ||
| /// </remarks> | ||
| [AttributeUsage (AttributeTargets.Class | AttributeTargets.Interface | AttributeTargets.Enum | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Constructor | AttributeTargets.Field, AllowMultiple = true)] | ||
| public sealed class UnsupportedSimulatorAttribute : Attribute { | ||
| /// <summary>Initializes a new <see cref="UnsupportedSimulatorAttribute" /> attribute.</summary> | ||
| /// <param name="platformName">The platform where this API is not supported in the simulator.</param> | ||
| public UnsupportedSimulatorAttribute (string platformName) | ||
| { | ||
| PlatformName = platformName; | ||
| } | ||
|
|
||
| /// <summary>The name of the platform.</summary> | ||
| public string PlatformName { get; init; } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.