Skip to content
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

Merged

Conversation

sofiaromorales
Copy link
Contributor

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:

  1. Preview the attached doccarchive.
  2. Assert that in the symbol Foo, the catalyst version match the iOS version.

129785705.docc.zip

Checklist

Make sure you check off the following items. If they cannot be completed, provide a reason.

  • Added tests
  • Ran the ./bin/test script and it succeeded
  • Updated documentation if necessary

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
@sofiaromorales
Copy link
Contributor Author

@swift-ci please test

1 similar comment
@sofiaromorales
Copy link
Contributor Author

@swift-ci please test

@sofiaromorales
Copy link
Contributor Author

@swift-ci please test

@sofiaromorales
Copy link
Contributor Author

@swift-ci please test

…morales/swift-docc into 129785705/infer-ios-for-catalyst
@sofiaromorales
Copy link
Contributor Author

@swift-ci please test

Copy link
Contributor

@anferbui anferbui left a 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 {
Copy link
Contributor

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

@sofiaromorales
Copy link
Contributor Author

@swift-ci please test

@sofiaromorales sofiaromorales merged commit 7cc4530 into swiftlang:main Jul 8, 2024
2 checks passed
sofiaromorales added a commit to sofiaromorales/swift-docc that referenced this pull request Jul 9, 2024
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
sofiaromorales added a commit that referenced this pull request Jul 10, 2024
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants