|
1 | | -# vscode-swift-devcontainer |
2 | | -Visual Studio Code Development Container for Swift |
| 1 | +# Swift (Community) |
| 2 | + |
| 3 | +## Summary |
| 4 | + |
| 5 | +*Develop Swift based applications. Includes everything you need to get up and running.* |
| 6 | + |
| 7 | +| Metadata | Value | |
| 8 | +|----------|-------| |
| 9 | +| *Contributors* | [0xTim](https://github.com/0xTim), [adam-fowler](https://github.com/adam-fowler), [cloudnull](https://github.com/cloudnull) | |
| 10 | +| *Categories* | Community, Languages | |
| 11 | +| *Definition type* | Dockerfile | |
| 12 | +| *Supported architecture(s)* | x86-64 | |
| 13 | +| *Works in Codespaces* | Yes | |
| 14 | +| *Container host OS support* | Linux, macOS, Windows | |
| 15 | +| *Container OS* | Debian | |
| 16 | +| *Languages, platforms* | Swift | |
| 17 | + |
| 18 | +## Using this definition |
| 19 | + |
| 20 | +While the definition itself works unmodified, you can select the version of Swift the container uses by updating the `VARIANT` arg in the included `devcontainer.json` (and rebuilding if you've already created the container). |
| 21 | + |
| 22 | +```json |
| 23 | +"args": { "VARIANT": "4" } |
| 24 | +``` |
| 25 | + |
| 26 | +Given how frequently web applications use Node.js for front end code, this container also includes an optional install of Node.js. You can enable installation and change the version of Node.js installed or disable its installation by updating the `args` property in `.devcontainer/devcontainer.json`. |
| 27 | + |
| 28 | +```jsonc |
| 29 | +"args": { |
| 30 | + "VARIANT": "4", |
| 31 | + "NODE_VERSION": "14" // Set to "none" to skip Node.js installation |
| 32 | +} |
| 33 | +``` |
| 34 | + |
| 35 | +### Adding the definition to a project or codespace |
| 36 | + |
| 37 | +1. If this is your first time using a development container, please see getting started information on [setting up](https://aka.ms/vscode-remote/containers/getting-started) Remote-Containers or [creating a codespace](https://aka.ms/ghcs-open-codespace) using GitHub Codespaces. |
| 38 | + |
| 39 | +2. Start VS Code and open your project folder or connect to a codespace. |
| 40 | + |
| 41 | +3. Press <kbd>F1</kbd> select and **Add Development Container Configuration Files...** command for **Remote-Containers** or **Codespaces**. |
| 42 | + |
| 43 | + > **Note:** If needed, you can drag-and-drop the `.devcontainer` folder from this sub-folder in a locally cloned copy of this repository into the VS Code file explorer instead of using the command. |
| 44 | +
|
| 45 | +4. Select this definition. You may also need to select **Show All Definitions...** for it to appear. |
| 46 | + |
| 47 | +5. Finally, press <kbd>F1</kbd> and run **Remote-Containers: Reopen Folder in Container** or **Codespaces: Rebuild Container** to start using the definition. |
| 48 | + |
| 49 | +## Testing the definition |
| 50 | + |
| 51 | +This definition includes some test code that will help you verify it is working as expected on your system. Follow these steps: |
| 52 | + |
| 53 | +1. If this is your first time using a development container, please follow the [getting started steps](https://aka.ms/vscode-remote/containers/getting-started) to set up your machine. |
| 54 | +2. Clone this repository. |
| 55 | +3. Start VS Code, press <kbd>F1</kbd>, and select **Remote-Containers: Open Folder in Container...** |
| 56 | +4. Select the `containers/swift` folder. |
| 57 | +5. After the folder has opened in the container, press <kbd>F5</kbd> to start the project. |
| 58 | +6. You should see "Hello, remote world!" in the Debug Console after the program executes. |
| 59 | +7. From here, you can add breakpoints or edit the contents of the `test-project` folder to do further testing. |
| 60 | + |
| 61 | +## License |
| 62 | + |
| 63 | +Copyright (c) Microsoft Corporation. All rights reserved. |
| 64 | + |
| 65 | +Licensed under the MIT License. See [LICENSE](https://github.com/microsoft/vscode-dev-containers/blob/main/LICENSE). |
0 commit comments