Implement SE-208 System Library Targets#1586
Merged
Merged
Conversation
ec1d0e9 to
43af9f6
Compare
<rdar://problem/39418939> [SR-7434]: Implement SE-208 Package Manager System Library Targets
Contributor
Author
|
@swift-ci please smoke test |
hartbit
reviewed
Jun 16, 2018
| let implicitSystemTargetDeps = packageBuilder.dependencies | ||
| .flatMap({ $0.targets }) | ||
| .filter({ $0.target.type == .systemModule }) | ||
| .filter({ |
Contributor
There was a problem hiding this comment.
Could we simplify this to ($0.target as? SystemLibraryTarget)?.isImplicit ?? false
Contributor
Author
There was a problem hiding this comment.
I wouldn't call one or the other a simplified version, heh.
hartbit
reviewed
Jun 16, 2018
| return nil | ||
| } | ||
| return SystemLibraryTarget( | ||
| name: potentialModule.name, |
hartbit
reviewed
Jun 16, 2018
| struct SystemPackageProductValidationDiagnostic: DiagnosticData { | ||
| static let id = DiagnosticID( | ||
| type: SystemPackageProductValidationDiagnostic.self, | ||
| name: "org.swift.diags.pkg-builder.sys-pkg-product-validatoin", |
hartbit
reviewed
Jun 16, 2018
| let targets: [String] | ||
| } | ||
|
|
||
| struct SystemPackageProductValidationDiagnostic: DiagnosticData { |
Contributor
There was a problem hiding this comment.
I don't understand this diagnostic. Can you explain?
Contributor
Author
There was a problem hiding this comment.
System library products shouldn't have a type (automatic/static/dynamic) and should contains only one target.
hartbit
reviewed
Jun 16, 2018
| // Peform special validations if this product is exporting | ||
| // a system library target. | ||
| if targets.contains(where: { $0 is SystemLibraryTarget }) { | ||
| if type != .library(.automatic) || targets.count != 1 { |
Contributor
There was a problem hiding this comment.
Minor comment: I find the double-ifs hard to read (perhaps that's just me).
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.
rdar://problem/39418939 [SR-7434]: Implement SE-208 Package Manager System Library Targets