Add dependency between a Tuist project and a `binaryTaget`

Swift Packages supports declaring a .binaryTarget as a type of target in a package definition so Tuist users might wonder how to achieve the same with Tuist projects. Note that Tuist projects translate into Xcode projects, so we are limited by what they are capable of, and they don’t support declaring binaryTarget dependencies.

However, there’s a workaround to the problem using an umbrella local package:

  1. Create a local package (e.g. LocalPackage/Package.swift) (example below)
  2. Adjust your Tuist project’s Package.swift to declare a local dependency with it.
  3. Declare a .external dependency between the project and the transitive binary.
  4. Run tuist install and your project be able to integrate that external transitive binary.
let package = Package(
    name: "MyLibrary",
    products: [
      .library(name: "MyRemoteLibrary", targets: ["MyRemoteLibrary"])
    ],
    targets: [
        .binaryTarget(
            name: "MyRemoteLibrary",
            url: "<https://url/to/some/remote/xcframework.zip>",
            checksum: "The checksum of the ZIP archive that contains the XCFramework."
        )
    ]
)