-
Notifications
You must be signed in to change notification settings - Fork 127
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
Make MacCatalyst availability information mirror iOS. #962
Make MacCatalyst availability information mirror iOS. #962
Conversation
If a symbol has not defined a explicit availability version for Catalyst, but it has explicit availability for iOS. mirror the iOS version. This is necessary since iOS and Catalyst should always match unless explicitly specified otherwise in the API. rdar://129785705
@swift-ci please test |
1 similar comment
@swift-ci please test |
@swift-ci please test |
@swift-ci please test |
Tests/SwiftDocCTests/Infrastructure/SymbolGraph/SymbolGraphLoaderTests.swift
Outdated
Show resolved
Hide resolved
Tests/SwiftDocCTests/Infrastructure/SymbolGraph/SymbolGraphLoaderTests.swift
Outdated
Show resolved
Hide resolved
Tests/SwiftDocCTests/Infrastructure/SymbolGraph/SymbolGraphLoaderTests.swift
Outdated
Show resolved
Hide resolved
Tests/SwiftDocCTests/Infrastructure/SymbolGraph/SymbolGraphLoaderTests.swift
Outdated
Show resolved
Hide resolved
Sources/SwiftDocC/Infrastructure/Symbol Graph/SymbolGraphLoader.swift
Outdated
Show resolved
Hide resolved
Sources/SwiftDocC/Infrastructure/Symbol Graph/SymbolGraphLoader.swift
Outdated
Show resolved
Hide resolved
Sources/SwiftDocC/Infrastructure/Symbol Graph/SymbolGraphLoader.swift
Outdated
Show resolved
Hide resolved
Sources/SwiftDocC/Infrastructure/Symbol Graph/SymbolGraphLoader.swift
Outdated
Show resolved
Hide resolved
…morales/swift-docc into 129785705/infer-ios-for-catalyst
a074826
to
f82cb12
Compare
@swift-ci please test |
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.
LGTM!
let defaultAvailabilityIntroducedVersion = defaultAvailabilities.first(where: { $0.platformName == fallbackPlatform })?.introducedVersion | ||
else { return } | ||
// Ensure that the availability version is not overwritten if the symbol has an explicit availability annotation for that platform. | ||
if SymbolGraph.SemanticVersion(string: defaultAvailabilityIntroducedVersion) == fallbackAvailabilityIntroducedVersion { |
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.
More of a discussion point than something to tackle in this PR, is there a reason we store DefaultAvailability.introducedVersion
as a string rather than a semantic version type such as SemanticVersion
? I think it would be useful to have one semantic version type which we use everywhere we reference platform build versions, similar to the discussion in #970
@swift-ci please test |
Make MacCatalyst availability information mirror iOS. If a symbol has not defined an explicit availability version for Catalyst, but it has explicit availability for iOS. mirror the iOS version. This is necessary since iOS and Catalyst should always match unless explicitly specified otherwise in the API. rdar://129785705
Make MacCatalyst availability information mirror iOS. If a symbol has not defined an explicit availability version for Catalyst, but it has explicit availability for iOS. mirror the iOS version. This is necessary since iOS and Catalyst should always match unless explicitly specified otherwise in the API. rdar://129785705
Bug/issue #, if applicable: 129785705
Summary
This PR makes a symbol that has not defined a explicit availability version for Catalyst, but it has explicit availability for iOS, mirror the iOS version.
This is necessary since iOS and Catalyst should usually match version information, unless it's explicitly specified otherwise in the API using the available attribute.
Dependencies
N/A
Testing
Steps:
129785705.docc.zip
Checklist
Make sure you check off the following items. If they cannot be completed, provide a reason.
./bin/test
script and it succeeded