➜ 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
➜ 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@swift.org https://lists.swift.org/mailman/listinfo/swift-users
Error message is very confusing and doesn't provide a hint to what went
wrong.
I'd suggest to solve this by assuming default for 1 module, and if
main.swift is present then building an executable. Allowing multiple
modules in same package I think should be discouraged, because at least
intuitively for me a Package translate to a Module in a 1:1 relation.
It's also import the inconsistency between Xcode project produced by swift
package generate-xcodeproj which is able to build the mentioned layout and
the command line swift build that fails.
Thanks for the help, mv'ing the sources into a a "Collection" directory in
Sources solved the issue.
···
On Tue, Jan 24, 2017 at 10:00 PM Daniel Dunbar <daniel_dunbar@apple.com> wrote:
On Jan 24, 2017, at 11:57 AM, Maxim Veksler via swift-users < > swift-users@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.
➜ 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