adding support for custom platforms#3742
Merged
Merged
Conversation
'custom' platforms
Contributor
|
@swift-ci please smoke test |
neonichu
approved these changes
Sep 14, 2021
Contributor
|
Looks good; thanks for this change! One more place that would need a change in order to be complete would be in ManifestSourceGeneration.swift, where the line: would change to something like: to emit the right source. |
Contributor
Author
|
@swift-ci please smoke test |
0f1c5ed to
916857d
Compare
Contributor
Author
|
@swift-ci please smoke test |
1 similar comment
Contributor
|
@swift-ci please smoke test |
abertelrud
approved these changes
Sep 15, 2021
Contributor
Author
|
@swift-ci please smoke test |
jakepetroules
approved these changes
Sep 15, 2021
neonichu
added a commit
that referenced
this pull request
Aug 10, 2023
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
neonichu
added a commit
that referenced
this pull request
Aug 11, 2023
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
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.
Allow Package.swift specification of minimum SDK version for unknown platforms by using new "custom" platform with platform name string, and version string.
Motivation:
Currently, platforms in SwiftPM have to always be hard-coded and we should get to a more flexible model here. As a first step, this PR adds the ability to declare custom platform deployment versions in the package manifest, which won’t be handled by SwiftPM’s own build system, but will be part of the package model, so that they can be utilized when using libSwiftPM together with another build system.
Modifications:
Added a new API, custom() to each of Platform and SupportedPlatform. Added fall back while reading manifest to create a custom platform where the platform is not recognized. Tests were added for Package Loading and Building.
Result:
From now on, anyone in the community who wishes to target a new platform for development without having to wait to add to the OSS, can do so in development by simply adding a '.custom("", "new platform version>")' to their Package.swift, and then adding the appropriate changes in their builder to recognize their new platform. They can then add the new platform and supported platform to the OSS for "official" support if the community needs/requires it.