Uploaded image for project: 'Swift'
  1. Swift
  2. SR-14245

Allow `binaryTarget`s to declare `dependencies` in the Swift packages

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Component/s: Package Manager
    • Labels:
      None

      Description

      Description

      Currently the binary target feature in the Swift Package Manager only works for single binary dependencies. The API for `Target` is shaped so that its own static method for returning a `.binaryTarget` does not take a `dependencies` array like the standard `.target` method.

      Setting the `dependencies` property on a `Target` type when that type is `binary` results in a crash to the SPM. 

      There is a workaround for the including dependencies in binary targets but it includes adding a dummy target to your `package.swift` and the result also generates warnings in an integrator's xcode project.

      The desired change to the SPM is to allow `binaryTarget`s to declare `dependencies` in their `package.swift` files.

       

      This thread has good detail on the issue and the known workaround for it: https://forums.swift.org/t/swiftpm-binary-target-with-sub-dependencies/40197/11

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            RonanMc20 Ronan McHugh
            Votes:
            4 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated: