Make it impossible to create an invalid BuildSettingCondition#4131
Conversation
| /// - Parameters: | ||
| /// - platforms: The applicable platforms for this build setting condition. | ||
| public static func when(platforms: [Platform]) -> BuildSettingCondition { | ||
| BuildSettingCondition(platforms: platforms, config: nil) |
There was a problem hiding this comment.
nit: use .none instead of nil to make it more semantically clear
| precondition(!(platforms == nil && configuration == nil)) | ||
| return BuildSettingCondition(platforms: platforms, config: configuration) | ||
| public static func when(configuration: BuildConfiguration) -> BuildSettingCondition { | ||
| BuildSettingCondition(platforms: nil, config: configuration) |
There was a problem hiding this comment.
nit: use .none instead of nil to make it more semantically clear
|
@swift-ci please smoke test |
|
thanks @sjavora |
23756a4 to
fbe0d7a
Compare
|
@tomerd Updated to use In the meantime I also found https://github.com/apple/swift-package-manager/blob/2ea136b5703039b5a596c8a61d090e4dc300ee98/Sources/PackageDescription/PackageDescriptionSerialization.swift#L354 ...which seems like it got copy/pasted as there is just one optional parameter. Should I remove that as well? |
|
thanks @sjavora
|
|
@swift-ci please smoke test |
|
This is a public, source‐breaking change to the |
good catch @SDGGiesbrecht did not notice this was in we will update 999.0 to 5.7 when we add that version identifier |
fbe0d7a to
a2bc957
Compare
Instead of a single method that takes two optional values, use multiple methods so that it is impossible for both to be `nil`.
a2bc957 to
60f0253
Compare
|
Oops! I didn't even think about that 🤦 Thank you for noticing - put back the original method and added |
|
thanks @sjavora this looks good now imo. @SDGGiesbrecht wdyt? one last ask, since this is user facing API change in the manifest could you please add an entry in the change log, e.g. #4137 (can be done in a separate PR if you prefer) |
|
👍 Looks good now. |
|
@swift-ci please smoke test |
|
@swift-ci please smoke test |
4 similar comments
|
@swift-ci please smoke test |
|
@swift-ci please smoke test |
|
@swift-ci please smoke test |
|
@swift-ci please smoke test |
|
@swift-ci please smoke test |
1 similar comment
|
@swift-ci please smoke test |
motivation: keep change log up to date changes: document changes from #4131
motivation: keep change log up to date changes: document changes from #4131
Instead of a single
whenmethod that takes two optional values, use multiple methods so that it is impossible for both to benil.