How to add local Swift Package as dependency?

I admit some detailed how-to would be appreciated. I've been fiddling with Xcode, drag&dropping all that I could reasonably think of, added my local package to the "Link Binary with Libraries" build phase, etc, without any success so far.

My setup:

  • xCodeProject.xcodeproj
  • xCodeProject
    • AppDelegate.swift
    • ...
  • Package
    • Package.swift
    • Sources
      • Product
        • ...

The goal: be able to import Product from AppDelegate.swift without "No such module 'Product'" error.

Why? I'm trying to reduce a bug in Xcode 11.2 beta 2, and I'm testing the hypothesis that the bug only happens when some code is imported from a swift package.

Thanks

Edit: see solution in the next message.

2 Likes