-
Notifications
You must be signed in to change notification settings - Fork 128
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
allow arbitrary platform strings in the @Available
directive
#463
allow arbitrary platform strings in the @Available
directive
#463
Conversation
rdar://104224866
@swift-ci Please test |
if platform.rawValue.lowercased() == rawValue.lowercased() { | ||
self = platform | ||
return | ||
} | ||
} | ||
return nil | ||
if rawValue == "*" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this implementation as well, we can mimic Deprecated behavior. it would be so confusing to have @available() with Deprecated information passed to it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean allowing @Available(isDeprecated: true)
once that is implemented? That will need to be handled as part of that implementation.
If you mean allowing @Available(MyPackage, isDeprecated, true)
, that should come for free without any extra work. I could add a test for that if you would like.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant the first part, i.e @available(isDeprecated: true). sorry my response was never posted due to my internet connectivity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, deprecation status isn't available yet; see #441 for information.
@swift-ci Please test |
Bug/issue #, if applicable: rdar://104224866
Summary
In #440, the
@Available
directive was limited to four platforms:iOS
,macOS
,watchOS
,tvOS
. This PR opens up that directive to take arbitrary platform strings, which will be passed along to the rendered page.Dependencies
None
Testing
Use the following metadata for testing:
Steps:
Sources/SwiftDocC/SwiftDocC.docc/SwiftDocC/Directives.md
.bin/preview-docs
Checklist
Make sure you check off the following items. If they cannot be completed, provide a reason.
./bin/test
script and it succeeded