Closed kostiakoval closed 9 years ago
@krzyzanowskim Hi, What do think about that idea?
I think I understand why you doing that. Xcode need a main.swift to compile codes at file scope, I didn't find a way to define natalie.swift as "main" To develop, I choose to create a "command line tool" project with a main.swift, remove the file, and make a symbolic link to /path/of/natalie.swift , so I can develop and launch it Maybe @krzyzanowskim could teach us what workflow he use to develop natalie.swift
I think If we cut files, we can go further and split in more files.
:warning: must not to merge if other PR exists
But the "natalie.swift" contains exit(0)
instruction and it's not available for usage in "command line" target
@kostiakoval you have a failure with exit
or you read it somewhere?
exit(0)
compile and work for me in a main.swift
if there is import Foundation
(or Darwin)
Ohh, import Foundation
that I was missing, thanks
I just added natalie.swift as external file to the sample project so you can easily build the project and edit natalie.swift from the Xcode.
but you will not get any code completion
The other way, I like actually, is quite straightforward (d02a599700b1f13d80ba5c4b9b78f06e73326608):
main.swift
to natalie.swift
so the trick is to compile natalie.swift
as main.swift
Result combined from multiple files as @kostiakoval proposed is more sophisticated, but introduce learning curve for new contributors I'd like to avoid now.
PS.
Side note about make
solution: Xcode have targets of type "external build system", with make. So it would be good to have Xcode project that will generate final file. However... it's not working because Xcode wont parse (no autocompletion) file that is not compiled by the Xcode. Since this is script, so it is not compiled by default.
I've splited Natalie.swift into 2 files:
Also there are 2 ways to merge them.