-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[PackageBuilder] Fix test target ref in manifest for external packages #620
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -208,15 +208,11 @@ public struct PackageBuilder { | |
/// - includingTestModules: Whether the package's test modules should be loaded. | ||
public func construct(includingTestModules: Bool) throws -> Package { | ||
let modules = try constructModules() | ||
let testModules: [Module] | ||
if includingTestModules { | ||
testModules = try constructTestModules(modules: modules) | ||
} else { | ||
testModules = [] | ||
} | ||
let testModules = try constructTestModules(modules: modules) | ||
try fillDependencies(modules: modules + testModules) | ||
let products = try constructProducts(modules, testModules: testModules) | ||
return Package(manifest: manifest, path: packagePath, modules: modules, testModules: testModules, products: products) | ||
// FIXME: Lift includingTestModules into a higher module. | ||
let products = try constructProducts(modules, testModules: includingTestModules ? testModules : []) | ||
return Package(manifest: manifest, path: packagePath, modules: modules, testModules: includingTestModules ? testModules : [], products: products) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are you sure this won't cause us to start building all tests for all packages by default? Err... I take that back I guess we only ever derive that information from the individual package. It would be nice to hoist this conditional out of the construction and into the build module, perhaps. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah it seems weird here, I'll add a FIXME |
||
} | ||
|
||
// MARK: Utility Predicates | ||
|
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 think it is ok that we construct test modules here, the performance cost should be negligible and I think it is actually better to not have the graph structure change depending on the use case.