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

[SR-13814] Add the allPlatforms property to the Platform struct in PackageDescription #4478

Open
swift-ci opened this issue Nov 3, 2020 · 2 comments · May be fixed by #7084
Open

[SR-13814] Add the allPlatforms property to the Platform struct in PackageDescription #4478

swift-ci opened this issue Nov 3, 2020 · 2 comments · May be fixed by #7084

Comments

@swift-ci
Copy link
Contributor

swift-ci commented Nov 3, 2020

Previous ID SR-13814
Radar rdar://problem/70999127
Original Reporter broadway_lamb (JIRA User)
Type Improvement
Additional Detail from JIRA
Votes 0
Component/s Package Manager
Labels Improvement
Assignee None
Priority Medium

md5: ebd9549c6cdd2fb568d52f0d36c0fe77

Issue Description:

I propose to extend the Platform struct in the PackageDescription API with a property that would return all the platforms that SwiftPM knows about. Something like this:

extension Platform {
    public static let allPlatforms: [Platform] = [
        .macOS,
        .iOS,
        .watchOS,
        .tvOS,
        .linux,
        .android,
        .windows,
        .wasi,
    ]
}

Rationale: see SR-13813.

@typesanitizer
Copy link

@swift-ci create

@neonichu
Copy link
Member

neonichu commented Nov 3, 2020

I think it would make more sense to have a first-class `except` API for the use case from SR-13813, but having this might be independently useful. I believe a `CaseIterable` conformance might be sufficient.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 4, 2022
@Kyle-Ye Kyle-Ye linked a pull request Nov 13, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants