Is there any way for a binary target to declare dependencies so that any transitive dependencies needed by a downstream project are resolved?
If I understood correctly,
binary only states the way the package is going to be deployed/consumed. So the transitive dependencies should be declared, normally, in your
Package.swift. When you add the library dependency to your project, Xcode detects all transitive dependencies, download them and pack them. So just add to your package file your dependency, just like:
dependencies: [ // Dependencies declare other packages that this package depends on. .package(url: "https://github.com/DeclarativeHub/Bond.git", .upToNextMajor(from: "7.4.1")) ]
I have the same question here.
How do we authenticate ourselves when trying to consume a binary dependency stored in an artefact repository other than Github? Is authentication unsupported for "external" binaries?
I guess it depends what authentication we are talking about. I haven't tested it, but a basic auth embedded in the URL should work.
Thanks for the quick reply David. I my case (using Artifactory) I think URL based authentication is not supported on their side. I've noticed there is a PR opened to add netrc support to Swift tools, which would definitely solve my problem. I'll wait for that. For anyone interested: https://github.com/apple/swift-tools-support-core/pull/88