<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">SwiftPM is case-insensitive about its conventions in general, so I consider this a bug.<div class=""><br class=""></div><div class="">It’s possible it’ll break existing projects, but well, existing projects are breaking constantly at this time due to language changes, so this is just another thing.</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On May 2, 2016, at 10:33 AM, Natthan Leong via swift-dev <<a href="mailto:swift-dev@swift.org" class="">swift-dev@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="content-type" content="text/html; charset=utf-8" class=""><div dir="auto" class=""><div class=""><span class=""></span></div><div class=""><meta http-equiv="content-type" content="text/html; charset=utf-8" class=""><div class="">Maybe that's why we should introduce the addition of 'Main.swift' before the Swift Package Manager (and Swift 3.0) hits stable?</div><div class=""><br class=""></div><div class="">I've never requested to drop 'main.swift'. I merely prefer the additional support for 'Main.swift'. Library/Frameworks should not have 'Main.swift' imho as it leads to further confusion.</div><div class=""><br class=""></div><div class="">If the compiler and Xcode team find this too difficult <i class="">to add support fo</i>r and not for any other reasons, I'd be okay with sticking with 'main.swift'. Just find it odd for reasons specified throughout this email thread.</div><div class=""><br class="">On May 2, 2016, at 10:20, Jordan Rose <<a href="mailto:jordan_rose@apple.com" class="">jordan_rose@apple.com</a>> wrote:<br class=""><br class=""></div><blockquote type="cite" class=""><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div class="">My concern is not about people who have both main.swift and Main.swift; it's people who have libraries/frameworks (no main.swift) where one of the source files happens to be named Main.swift. This isn't likely, but it is possible.</div><div class=""><br class=""></div><div class="">We're certainly not going to drop "main.swift" in favor of "Main.swift", so the question would just be if we wanted to add "Main.swift". And I don't think we want different rules for Xcode and the package manager, especially not when the package manager can generate simple Xcode projects.</div><div class=""><br class=""></div><div class="">Jordan</div><div class=""><br class=""></div><br class=""><div class=""><blockquote type="cite" class=""><div class="">On May 2, 2016, at 10:09, Natthan Leong <<a href="mailto:kar.joon@icloud.com" class="">kar.joon@icloud.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="content-type" content="text/html; charset=utf-8" class=""><div dir="auto" class=""><div class="">Hi,</div><div class=""><br class=""></div><div class="">Isn't it odd to have both main.swift and Main.swift for a project?</div><div class=""><br class=""></div><div class="">Considering Swift 3 provides source breaking changes, can this be still worth an side effort to pursue with the compiler team as advised by Kostiantyn in the bug report? <span style="background-color: rgba(255, 255, 255, 0);" class="">If so, how'd I approach them regarding this?</span></div><div class=""><br class=""></div><div class="">Isn't the Swift Package Manager a (new) tool in handling Swift code? Is this really the case where a minor change/addition to a convention is so difficult that it shouldn't be done? Can't Xcode support only either Main.swift or main.swift in the future?</div><div class=""><br class=""></div><div class="">The bug report is linked here</div><div class=""><a href="https://bugs.swift.org/browse/SR-1379" class="">https://bugs.swift.org/browse/SR-1379</a></div><div class=""><br class=""></div><div class=""><div class=""></div>On May 2, 2016, at 09:34, Jordan Rose <<a href="mailto:jordan_rose@apple.com" class="">jordan_rose@apple.com</a>> wrote:<br class=""><br class=""></div><blockquote type="cite" class=""><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div class="">[+swift-dev, bcc swift-users] I’d be fine with supporting “Main.swift”. The one downside is that it could change behavior for existing projects relying on “Main.swift” being a library file, and that might mean it’s not worth making a change.</div><div class=""><br class=""></div><div class="">Jordan</div><div class=""><br class=""></div><br class=""><div class=""><blockquote type="cite" class=""><div class="">On May 1, 2016, at 23:34, Kostiantyn Koval via swift-users <<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Hi there,</div><div class=""><br class=""></div><div class=""><b class="">main </b>is common used naming for executables that contains main function. It’s required by Swift compiler and Swift Package Manager can’t do anything about that.</div><div class="">If you create a simple command line tool in Xcode, it will create <b class="">main.swift</b> file. If you try to rename it, it will feil.</div><div class="">I think this is correct behaviour.</div><div class="">If you still think that Swift should support <b class="">Main.swift </b>with upper case letter, than it should be discussed with compiler team.</div><div class=""><br class=""></div><div class="">- Kostiantyn</div><div class=""><br class=""></div>
> Hi there,<br class="">> <br class="">> This is what happened as I was trying out the Swift Package Manager for another project similar to the one shown below:<br class="">> <br class="">> ~ $ mkdir example<br class="">> ~ $ cd example/<br class="">> example $ touch Package.swift<br class="">> example $ mkdir Sources<br class="">> <br class="">> example $ vi Sources/Example.swift<br class="">> example $ cat Sources/Example.swift<br class="">> func printOther() {<br class="">> print("other")<br class="">> }<br class="">> <br class="">> example $ vi Sources/Main.swift<br class="">> example $ cat Sources/Main.swift<br class="">> print("Hello World")<br class="">> printOther()<br class="">> <br class="">> <br class="">> example $ swift build<br class="">> Compile Swift Module 'example' (2 sources)<br class="">> /PATH/example/Sources/Main.swift:1:1: error: expressions are not allowed at the top level<br class="">> print("Hello World")<br class="">> ^<br class="">> /PATH/example/Sources/Main.swift:2:1: error: expressions are not allowed at the top level<br class="">> printOther()<br class="">> ^<br class="">> /PATH/example/Sources/Main.swift:1:1: error: expressions are not allowed at the top level<br class="">> print("Hello World")<br class="">> ^<br class="">> /PATH/example/Sources/Main.swift:2:1: error: expressions are not allowed at the top level<br class="">> printOther()<br class="">> ^<br class="">> <unknown>:0: error: build had 1 command failures<br class="">> error: exit(1): /PATH-SWIFT/usr/bin/swift-build-tool -f /PATH/example/.build/debug.yaml<br class="">> <br class="">> <br class="">> example $ mv Sources/Main.swift Sources/main.swift<br class="">> example $ swift build<br class="">> Compile Swift Module 'example' (2 sources)<br class="">> Linking .build/debug/example<br class="">> example $ .build/debug/example<br class="">> Hello World<br class="">> other<br class="">> example $<br class="">> <br class="">> <br class="">> I had to renameMain.swifttomain.swift. Is there a design decision on why the filename for the main swift file has to be lowercase or is this a bug?<br class="">> <br class="">> If it’s a design decision, why are directory names forsource files allowed to have variations likeSources,Source,srcandsrcsas statedhere(<a href="https://github.com/apple/swift-package-manager/blob/master/Documentation/SourceLayouts.md#other-rules" class="">https://github.com/apple/swift-package-manager/blob/master/Documentation/SourceLayouts.md#other-rules</a>)but not the main swift file?<br class="">> <br class="">> I’d be ok if onlyMain.swiftandmain.swiftare allowed since other files in theSourcesdirectory are commonly UpperCamelCasedue to the Type naming conventions e.g.example-package-playingcard/Sources(<a href="https://github.com/apple/example-package-playingcard/tree/master/Sources" class="">https://github.com/apple/example-package-playingcard/tree/master/Sources</a>).<br class="">> <br class="">> Or maybe I’m just being pedantic?<br class="">> <br class="">> p.s. evenPackage.swiftis capitalized and notpackage.swift<br class="">> <br class="">> $ swift --version<br class="">> Swift version 3.0-dev (LLVM 752e1430fc, Clang 1e6cba3ce3, Swift 56052cfe61)<br class="">> Target: x86_64-unknown-linux-gnu<br class="">> <br class="">> <br class="">> <br class="">> <br class="">><span class="Apple-converted-space"> </span>
</div>_______________________________________________<br class="">swift-users mailing list<br class=""><a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-users" class="">https://lists.swift.org/mailman/listinfo/swift-users</a><br class=""></div></blockquote></div><br class=""></div></blockquote></div></div></blockquote></div><br class=""></div></blockquote></div></div>_______________________________________________<br class="">swift-dev mailing list<br class=""><a href="mailto:swift-dev@swift.org" class="">swift-dev@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-dev<br class=""></div></blockquote></div><br class=""></div></body></html>