<div dir="ltr">Thanks Daniel, <div><br></div><div>Few comments:</div><div><br></div><div>Error message is very confusing and doesn't provide a hint to what went wrong.</div><div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><div>Thanks for the help, mv'ing the sources into a a "Collection" directory in Sources solved the issue.</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Jan 24, 2017 at 10:00 PM Daniel Dunbar <<a href="mailto:daniel_dunbar@apple.com">daniel_dunbar@apple.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="gmail_msg"><br class="gmail_msg"><div class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg">On Jan 24, 2017, at 11:57 AM, Maxim Veksler via swift-users <<a href="mailto:swift-users@swift.org" class="gmail_msg" target="_blank">swift-users@swift.org</a>> wrote:</div><br class="m_6400825823643174153Apple-interchange-newline gmail_msg"><div class="gmail_msg"><div dir="ltr" class="gmail_msg"><div class="gmail_msg">The most recent change I've done is add the Sources/extensions/Jay.swift, now I'm unable to build the project.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">No idea what could have gone wrong, feedback?</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">➜ Collection git:(master) ✗ find Sources</div><div class="gmail_msg">Sources</div><div class="gmail_msg">Sources/extensions</div><div class="gmail_msg">Sources/extensions/Jay.swift</div><div class="gmail_msg">Sources/main.swift</div></div></div></blockquote><div class="gmail_msg"><br class="gmail_msg"></div></div></div><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg">If you want one module with both sources but some in a subdirectory, you need to write it as:</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><div class="gmail_msg">Sources/Collection/main.swift</div><div class="gmail_msg"><div class="gmail_msg">Sources/Collection/extensions/Jay.swift</div></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><div class="gmail_msg">If you want two modules then you need to lay this out as:</div><div class="gmail_msg"> Sources/extensions/Jay.swift</div><div class="gmail_msg">and</div><div class="gmail_msg"> Sources/Collection/main.swift</div><div class="gmail_msg"><br class="gmail_msg"></div></div><div class="gmail_msg">We know this UX is not very good and are debating how to best resolve this...</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"> - Daniel</div><div class="gmail_msg"><br class="gmail_msg"></div></div><div class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg"></div></blockquote></div></div><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg"><div dir="ltr" class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">➜ Collection git:(master) ✗ cat Package.swift</div><div class="gmail_msg">import PackageDescription</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">let package = Package(</div><div class="gmail_msg"> name: "Collection",</div><div class="gmail_msg"> dependencies: [</div><div class="gmail_msg"> .Package(url: "<a href="https://github.com/GraphQLSwift/GraphQL.git" class="gmail_msg" target="_blank">https://github.com/GraphQLSwift/GraphQL.git</a>", majorVersion: 0),</div><div class="gmail_msg"> .Package(url: "<a href="https://github.com/czechboy0/Jay.git" class="gmail_msg" target="_blank">https://github.com/czechboy0/Jay.git</a>", majorVersion: 1)</div><div class="gmail_msg"> ]</div><div class="gmail_msg">)</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">➜ Collection git:(master) ✗ swift build</div><div class="gmail_msg">error: the package has an unsupported layout, unexpected source file(s) found: /Users/maximveksler/Project/Org/Collection/Sources/main.swift<br class="gmail_msg"></div><div class="gmail_msg">fix: move the file(s) inside a module</div></div></div></blockquote></div></div><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg">
_______________________________________________<br class="gmail_msg">swift-users mailing list<br class="gmail_msg"><a href="mailto:swift-users@swift.org" class="gmail_msg" target="_blank">swift-users@swift.org</a><br class="gmail_msg"><a href="https://lists.swift.org/mailman/listinfo/swift-users" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-users</a><br class="gmail_msg"></div></blockquote></div><br class="gmail_msg"></div></blockquote></div>