[swift-users] error: the package has an unsupported layout, unexpected source file(s) found: /Users/maximveksler/Project/Org/Collection/Sources/main.swift

Daniel Dunbar daniel_dunbar at apple.com
Tue Jan 24 14:00:04 CST 2017


> On Jan 24, 2017, at 11:57 AM, Maxim Veksler via swift-users <swift-users at swift.org> wrote:
> 
> The most recent change I've done is add the Sources/extensions/Jay.swift, now I'm unable to build the project.
> 
> No idea what could have gone wrong, feedback?
> 
> 
> ➜  Collection git:(master) ✗ find Sources
> Sources
> Sources/extensions
> Sources/extensions/Jay.swift
> Sources/main.swift

If you want one module with both sources but some in a subdirectory, you need to write it as:

Sources/Collection/main.swift
Sources/Collection/extensions/Jay.swift

If you want two modules then you need to lay this out as:
  Sources/extensions/Jay.swift
and
  Sources/Collection/main.swift

We know this UX is not very good and are debating how to best resolve this...

 - Daniel

> 
> ➜  Collection git:(master) ✗ cat Package.swift
> import PackageDescription
> 
> let package = Package(
>     name: "Collection",
>     dependencies: [
>       .Package(url: "https://github.com/GraphQLSwift/GraphQL.git <https://github.com/GraphQLSwift/GraphQL.git>", majorVersion: 0),
>       .Package(url: "https://github.com/czechboy0/Jay.git <https://github.com/czechboy0/Jay.git>", majorVersion: 1)
>     ]
> )
> 
> ➜  Collection git:(master) ✗ swift build
> error: the package has an unsupported layout, unexpected source file(s) found: /Users/maximveksler/Project/Org/Collection/Sources/main.swift
> fix: move the file(s) inside a module
> _______________________________________________
> swift-users mailing list
> swift-users at swift.org
> https://lists.swift.org/mailman/listinfo/swift-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20170124/d7c7749d/attachment.html>


More information about the swift-users mailing list