Programming in Swift on Linux Programming in Swift on Linux linux linux

Programming in Swift on Linux


You can use the Atom package build. It allows you to create custom build commands and such by using common build providers. You can build with a Makefile or JSON or CSON or YAML or even Javascript. It provides enough flexibility that you can build just about anything. Just make your build file so that it points to all the files to build with the right compiler (probably swiftc in your case). With a Javascript build file, you can even specify a command to run before and after the build, say, to run your newly built program.


There's a great open source project I have been watching called Marathon. It's a package manager and they have been Working on a deployment on linux. I'm not sure how much success they have had, but you can follow along here and maybe help out.

https://github.com/JohnSundell/Marathon/issues/37

Edit: It looks like it does work on linux!

git clone https://github.com/JohnSundell/Marathon.git$ cd Marathon$ swift build -c release$ cp -f .build/release/Marathon /usr/local/bin/marathon


For dependencies, you should use Swift Package Manager.

You can check how Vapor is built - it is prepared for build apps for Ubuntu too.

Also, Vapor toolbox would help you with other projectshttps://docs.vapor.codes/2.0/getting-started/install-on-ubuntu/