I would like to prepare the environment for working with Swift on Ubuntu 16.04.
I installed Swift and Atom editor. I installed the Script package, which allows me to run code from the Atom editor.
Generally it is nice when I compile and run one file (Ctrl+Shift+B shortcut). The problem is when I would like to build a project composed of several files. Classes defined in the other files (not the one I compile) are not visible (compilation error).
Is it possible to configure the editor to compile and run the entire project? How to import external library, eg ObjectMapper ?
Go to the Swift website and download the recommended toolchain for your version of Linux. As of this writing, Apple only supports Ubuntu, so the tutorial will use that distribution. This step installs the required dependencies and unpacks the toolchain to ~/swift . This will build and run the project.
Swift on Linux My server is going to be hosted by Linode, but it should work on any computer running Ubuntu 18.04 LTS. Since I'm doing this on Linode, all of the instructions will be for how to install Swift using the command line. Let's get started by accessing your Ubuntu 18.04 LTS instance.
You cannot run Xcode on a Linux machine.
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 projects https://docs.vapor.codes/2.0/getting-started/install-on-ubuntu/
You can build a Swift project using VS Code + Swift Development Environment extension
If steps on the link above are not clear enough, I've put more details in a blog post
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With