[swift-users] Multiple executables

Daniel Dunbar daniel_dunbar at apple.com
Sat Jan 23 22:23:04 CST 2016


Packages can have multiple executable targets. You just need to subdivide your sources appropriately:
Sources/SomeLibrary/...
Sources/server/main.swift
Sourcers/upgrade-tool/main.swift
...

 - Daniel

> On Jan 23, 2016, at 2:54 PM, Jason Lee via swift-users <swift-users at swift.org> wrote:
> 
> Hi all,
> 
> I’m working on a server app and would like to be able to provide a utility executable to create certain things (source files) or do certain things (like migrate a database). My package only creates the one executable and for me to start another package - well, it seems like it would entail a lot more work than I want to do at this point (it’s so early in the dev stage).
> 
> Does anyone have any experience yet doing these sorts of things?
> 
> I was just thinking, I suppose my main could look for env parameters and doing my things if those are present or start the server if they are not. That might be the way to go.
> 
> Any thoughts appreciated, thanks.
> 
> - jason
> _______________________________________________
> swift-users mailing list
> swift-users at swift.org
> https://lists.swift.org/mailman/listinfo/swift-users



More information about the swift-users mailing list