I have the following package description:
let package = Package( products: [ ... ], dependencies: [ .package(url: ...), // X ], targets: [ .target(name: "A"), .target( name: "B", dependencies: ["A", .product(name: "X", package: "X")] ), .testTarget( name: "BTests", dependencies: ["B"] // does this need to include "A" and "X"? ), ] )
Do I need to specify
X explicitly as dependencies for
It's no problem obviously to do that, but it feels like noise and I'd like to keep my package description as free of clutter as it can be.
BTests, I also
import A and
import X and use some minimal functionality from each of them (the
B target itself is a kind of unofficial cross-import overlay, gluing
X together). Can I rely on SwiftPM to recognise the dependency and make those modules available to import within
BTests? It does seem to work, but I'm not sure if it's guaranteed to work.