Giter VIP home page Giter VIP logo

swish's Introduction

Swish Logo

Swish is a simple script for remote building your Swift projects on a Linux machine. Why is that so cool? You can develop in Xcode on macOS and can use an External Build System to deploy your code on Linux.

The next chapters are all about integrating Swish in Xcode and describes how to build Swift projects on a remote machine right outta Xcode. It targets the early adopters of Server-Side Swift and should minimize the gap between macOS and Linux. It's work in progress, so please report any issues that you're running in.

Prerequisites:

  • A Remote Machine that running Linux and Swift (Here is an installation script for a RaspberryPi 3)
  • SSH KeyPair

Setup SSH Authentication

First you'll need to generate a public/private keypair:

ssh-keygen -t rsa

Follow the prompts. When it asks if you want to protect the key with a passphrase, you should say YES!

Now, assuming your ssh key exists, you can install it on your remote machine by running:

cat ~/.ssh/id_rsa.pub | ssh <username>@<hostname> "mkdir -p ~/.ssh && cat >>  ~/.ssh/authorized_keys"

You can start a new ssh session. You'll have to enter the password, but this should be the last time you need to do this.

ssh <username>@<hostname>

Your good to go 💪

Installation with Homebrew

brew install thomaspaulmann/homebrew-formulae/swish

Now you can run swish in your terminal.

Configure Xcode

  1. Add a new target and select External Build System (in cross-plattform tab) as template.
  2. Set /bin/bash as the build tool of the target.
  3. Select your generated target and set arguments (in info tab) to swish <username> <hostname>
  4. Build your project (with the newly created target) and enjoy your compiled swift code on your remote machine.

Run Project

Open a new terminal window and connect to your remote machine via SSH.

ssh <username>@<hostname>

Navigate to the synced project directory and run your project as usual.

cd ~/Swish/<projectname>
.build/debug/<projectname>

Have fun 🍻

Thanks

License

This project is licensed under the MIT License - see the LICENSE file for details.

swish's People

Contributors

thomaspaulmann avatar zipitn avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.