/codespace-demo

Example of how to use Swift in a GitHub Codespace.

Primary LanguageDockerfile

Codespace Swift Demo

This repository shows how to use the Swift for VS Code Extension inside a GitHub Codespace. To use the extension, Swift needs to be installed. In a Codespace, this can be achieved by deploying a custom dev container based on a official Swift Docker Image in that Codespace.

Configuration

  1. Create a .devcontainer directory inside your workspace
  2. Place the devcontainer.json file as well as your Dockerfile inside the .devcontainer directory
    1. Dockerfiles for different versions of Swift are available here: https://github.com/apple/swift-docker
    2. See .devcontainer for an example configuration
  3. Rebuild your Codespace using this container configuration
  4. Install and enable the Swift for VS Code Extension in your Codespace

More information on deploying a custom dev container: Codespace docs