JamitLabs / Accio

A dependency manager driven by SwiftPM that works for iOS/tvOS/watchOS/macOS projects.
MIT License
664 stars 32 forks source link

Accio isn't compatible with certain Package.swift formats #79

Closed fredpi closed 5 years ago

fredpi commented 5 years ago

Just recently, Nimble released a new version that references a framework with the following Package.swift: https://github.com/mattgallagher/CwlPreconditionTesting/blob/master/Package.swift

It contains the following: (Note the use of .target(name: "CwlMachBadInstructionHandler") instead of just "CwlMachBadInstructionHandler")

.target(
    name: "CwlPreconditionTesting",
    dependencies: [
    .target(name: "CwlMachBadInstructionHandler"),
    .product(name: "CwlCatchException")
    ]
),

that results in the following json: (when using swift package dump-package)

"dependencies" : [
    {
      "target" : [
        "CwlMachBadInstructionHandler"
      ]
    },
    {
      "product" : [
        "CwlCatchException",
        null
      ]
    }
],

where Accio expects: (Note the difference: byName instead of target / product)

"dependencies" : [
    {
      "byName" : [
        "CwlMachBadInstructionHandler"
      ]
    },
    {
      "byName" : [
        "CwlCatchException",
        null
      ]
    }
],

Accio should be able to also handle such Package.swift configurations. As Nimble is widely used, also as a sub-dependency of popular frameworks like Moya, this should be fixed as soon as possible.