How To Test Swift Packages

How To Test Swift Packages

Swift packages are a neat and simple way to bundle up and share code. They remove the overall complexity by not requiring an Xcode project but instead relying on a filesystem-based project layout. That’s all fine and well until your code needs an Entitlement for it to be tested.

[…]

The idea for this article came to me while working on a not-yet-released Swift package called “SwiftRegistry”, a simple Keychain wrapper. As Keychain access requires an Entitlement, it was a good example. That’s why you’ll see “SwiftKeychain” or “swift-keychain” all over the article.

[…]

To actually consume the project as a Swift package and not as a Framework, it still needs a Package.swift file. But you can’t add it to the Xcode project directly!

[…]