Skip to content

Why is AnyPromise not available with SPM? #1192

@DG0BAB

Description

@DG0BAB
  • Please specify the PromiseKit major version you are using
    6

  • Please specify how you installed PromiseKit, ie. Carthage, CocoaPods, SwiftPM or other. If other provide DETAILED information about how you are integrating PromiseKit.
    CocoaPods and indirectly with SPM (see text)

AnyPromise is not available when using Swift PackageManager. But why?
I read in another issue that this is documented but I can't find anything regarding this fact.

My Problem:

I'm using PromiseKit in a mixed Swift/ObjC project. I'm including PromiseKit using CocoaPods but trying to successively switch to SPM. Since I need AnyPromise, I wasn't able to move PromiseKit from CocoaPods to SPM so far.

But now I ran into another Problem: I'm using a SwiftPackage, which itself has a dependency to PromiseKit. Now my main project is complaining that AnyPromise isn't available, because the SPM (internal) dependency to PromiseKit is "overriding" the CocoaPods dependency. As far as I know, there is no way, to create something like a "private" dependency within a Swift Package. All dependencies are automatically "re-exported" and visible to the main project.

I was searching through the Swift Forums already but there currently seems to be no way to avoid re-exporting SPM package dependencies. Maybe if I understand why AnyPromise isn't available when using SPM I might be able to find a workaround.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions