Support custom platforms in conditionals#6794
Merged
Merged
Conversation
In #3742, support for custom platforms was added and I think everyone understood it as supporting custom deployment targets, but it actually also added API for custom platform conditionals. Those never actually worked, though, because any platform that the platform registry doesn't know about was dropped when going from `TargetDescription` to `Target`. This fixes it and adds a unit test. See also RevenueCat/purchases-ios#2998 rdar://113709387
Contributor
Author
|
@swift-ci please smoke test |
Contributor
|
How are these platform names applied when evaluating a condition? Could someone use it to match against an arbitrary target triple? If so, which triple component does it match against? |
Contributor
Author
It's up to the build system to apply them, SwiftPM's build system doesn't do anything with custom conditions, I think (as in, they should always be false). |
tomerd
approved these changes
Aug 11, 2023
NachoSoto
added a commit
to RevenueCat/purchases-ios
that referenced
this pull request
Aug 11, 2023
…sion` Fixes #2998. This is now fixed in SPM: swiftlang/swift-package-manager#6794, but we need a workaround for now. Since `.custom` doesn't work properly, this splits `Package.swift` based on Xcode version.
NachoSoto
added a commit
to RevenueCat/purchases-ios
that referenced
this pull request
Aug 11, 2023
…3005) Fixes #2998. See #2989 for why this is needed in the first place. This is now fixed in SPM: swiftlang/swift-package-manager#6794, but we need a workaround for now. Since `.custom` doesn't work properly (it gets evaluated in Xcode even outside of that platform), this splits `Package.swift` based on Xcode version. Thanks @neonichu for helping with this.
MarkVillacampa
pushed a commit
to RevenueCat/purchases-ios
that referenced
this pull request
Sep 6, 2023
…3005) Fixes #2998. See #2989 for why this is needed in the first place. This is now fixed in SPM: swiftlang/swift-package-manager#6794, but we need a workaround for now. Since `.custom` doesn't work properly (it gets evaluated in Xcode even outside of that platform), this splits `Package.swift` based on Xcode version. Thanks @neonichu for helping with this.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
In #3742, support for custom platforms was added and I think everyone understood it as supporting custom deployment targets, but it actually also added API for custom platform conditionals. Those never actually worked, though, because any platform that the platform registry doesn't know about was dropped when going from
TargetDescriptiontoTarget. This fixes it and adds a unit test.See also RevenueCat/purchases-ios#2998
rdar://113709387