-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Implement SE-208 System Library Targets #1586
Conversation
ec1d0e9
to
43af9f6
Compare
<rdar://problem/39418939> [SR-7434]: Implement SE-208 Package Manager System Library Targets
@swift-ci please smoke test |
.flatMap({ $0.targets }) | ||
.filter({ $0.target.type == .systemModule }) | ||
.filter({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we simplify this to ($0.target as? SystemLibraryTarget)?.isImplicit ?? false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't call one or the other a simplified version, heh.
return nil | ||
} | ||
return SystemLibraryTarget( | ||
name: potentialModule.name, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: indentation
struct SystemPackageProductValidationDiagnostic: DiagnosticData { | ||
static let id = DiagnosticID( | ||
type: SystemPackageProductValidationDiagnostic.self, | ||
name: "org.swift.diags.pkg-builder.sys-pkg-product-validatoin", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: validation
let targets: [String] | ||
} | ||
|
||
struct SystemPackageProductValidationDiagnostic: DiagnosticData { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this diagnostic. Can you explain?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
System library products shouldn't have a type (automatic/static/dynamic) and should contains only one target.
// 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 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comment: I find the double-ifs hard to read (perhaps that's just me).
rdar://problem/39418939 [SR-7434]: Implement SE-208 Package Manager System Library Targets