[swift-build-dev] Draft proposal: Package Manager Product Definitions
Anders Bertelrud
anders at apple.com
Thu Nov 17 15:33:47 CST 2016
Hello Russ,
On 2016-11-17, at 13.01, Russ Bishop <xenadu at gmail.com> wrote:
> Did you consider allowing the specification of dependencies as part of the target dependencies? It would be mostly useful for simple leaf packages. If we included a "default" target concept you could omit the name too.
>
> let package = Package(
> name: "MyClientLib",
> targets: [
> Target(name: "MyUtils"),
> Target(name: "MyClientLib", dependencies: [
> .target(name: "MyUtils"),
> .product(name: "Alamofire", package: "Alamofire", url: "https://github.com/Alamofire/Alamofire", majorVersion: 3)
> ])
> ]
> )
We didn’t consider this, but I can see the appeal for simple leaf packages. I’m not sure that the convenience makes up for the additional complexity of allowing the package reference directly in the target dependency, however. Since we’d still have to support package references on their own, there would be two different ways of referring to a package, which means that if a new way to reference packages is added, we’d have to make that change in two places.
Would there be anything expressible in this way that wouldn’t also be expressible using a separate package reference?
Thanks,
Anders
More information about the swift-build-dev
mailing list