A note on the Swift 4 Package Manager Syntax

I ran into some issues setting up a new Swift 4 project from Swift Package Manager. Specifically, my main.swift file couldn’t import the dependencies I specified in my Package.swift file. It turns out, you have to import your dependencies in the root dependencies: section, then refer to them by module name in the targets() portion of the package.

[gist d63d61ffaf8d7a73b174cc1f1801c8eb]

Omitting the declaration in your target means the module won’t be available to your app and your import statements will generate compiler errors for nonexistent modules.