From 5559f38a51954d782d31d95bde3d062ca8206dfd Mon Sep 17 00:00:00 2001 From: Allen Hill Date: Mon, 21 Aug 2023 20:08:04 -0400 Subject: [PATCH] Setup Dev Containers for VS Code (easy toolchain/build setup) --- .devcontainer/devcontainer.json | 29 +++++++++++++++++++++++++++++ scripts/install-toolchain.sh | 1 + 2 files changed, 30 insertions(+) create mode 100644 .devcontainer/devcontainer.json create mode 100644 scripts/install-toolchain.sh diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..bdd2ca2 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,29 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/alpine +{ + "name": "AVR toolchain", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/base:alpine-3.18", + "features": {}, + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "bash scripts/install-toolchain.sh", + // Configure tool-specific properties. + "customizations": { + "vscode": { + "extensions": [ + "ms-vscode.cpptools", + "ms-vscode.cmake-tools", + "ms-vscode.makefile-tools" + ] + } + } + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" + // "runArgs": [ + // "--device='class/86E0D1E0-8089-11D0-9CE4-08003E301F73'" + // ] +} \ No newline at end of file diff --git a/scripts/install-toolchain.sh b/scripts/install-toolchain.sh new file mode 100644 index 0000000..4cc27ad --- /dev/null +++ b/scripts/install-toolchain.sh @@ -0,0 +1 @@ +sudo apk --no-cache add make cmake avrdude avr-libc gcc-avr \ No newline at end of file