Description
Motivation
As it is described well in this swift forum thread, there is currently no straightforward way to define dependencies of a binaryTarget
in a Package.swift
file. This seems to be an obvious feature to have as it is available for other target types and clearly a binary target with some dependencies is a common use-case.
Proposed solution
An obvious solution would be to expose an optional dependencies: [PackageDescription.Package.Dependency]? = nil
parameter when creating a binary target. I might be wrong, but there should not be any significant problems in reusing the implementation that the usual target uses.
Alternatives considered
No response
Additional information
The swift forum thread I've mentioned before contains a description for a workaround:
Considering that a binary target BinaryFramework
has a dependency to SomeOtherFramework
,
it is possible to define an auxiliary non-binary AuxiliaryTarget
that will depend on both BinaryFramework
and SomeOtherFramework
, this way a client can define a dependency to AuxiliaryTarget
so that both the BinaryFramework
and SomeOtherFramework
will be added.