Skip to content

Commit 4e92c54

Browse files
authored
Merge pull request #64 from DeepBlueRobotics/update-codespaces
Update Codespaces
2 parents 8097741 + ca245b8 commit 4e92c54

3 files changed

Lines changed: 34 additions & 54 deletions

File tree

.devcontainer/Dockerfile

Lines changed: 0 additions & 25 deletions
This file was deleted.

.devcontainer/devcontainer.json

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,39 @@
1-
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2-
// https://github.com/microsoft/vscode-dev-containers/tree/v0.192.0/containers/java
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/java
33
{
44
"name": "Java",
5-
"build": {
6-
"dockerfile": "Dockerfile",
7-
"args": {
8-
// Update the VARIANT arg to pick a Java version: 11, 16
9-
"VARIANT": "11",
10-
// Options
11-
"INSTALL_MAVEN": "false",
12-
"INSTALL_GRADLE": "false",
13-
"NODE_VERSION": "none"
14-
}
15-
},
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"image": "mcr.microsoft.com/devcontainers/java:1-17-bookworm",
167

17-
// Set *default* container specific settings.json values on container create.
18-
"settings": {
19-
"java.home": "/docker-java-home"
8+
"features": {
9+
"ghcr.io/devcontainers/features/java:1": {
10+
"version": "none",
11+
"installMaven": "false",
12+
"installGradle": "true"
13+
}
2014
},
21-
22-
// Add the IDs of extensions you want installed when the container is created.
23-
"extensions": [
24-
"redhat.java",
25-
"ms-vscode.cpptools",
26-
"vcjava.vscode-java-debug",
27-
"ms-toolsai.jupyter",
28-
"vcjava.vscode-java-dependency",
29-
"wpilibsuite.vscode-wpilib"
30-
],
3115

3216
// Use 'forwardPorts' to make a list of ports inside the container available locally.
3317
// "forwardPorts": [],
3418

3519
// Use 'postCreateCommand' to run commands after the container is created.
36-
// "postCreateCommand": "java -version",
20+
// "postCreateCommand": "",
21+
22+
// Configure tool-specific properties.
23+
"customizations": {
24+
"vscode": {
25+
"extensions": [
26+
"redhat.java",
27+
"ms-vscode.cpptools",
28+
"vcjava.vscode-java-debug",
29+
"ms-toolsai.jupyter",
30+
"vcjava.vscode-java-dependency"
31+
]
32+
}
33+
},
34+
35+
"postAttachCommand": "./.devcontainer/installWPILibExtension.sh && exit"
3736

38-
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
39-
"remoteUser": "vscode"
37+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
38+
// "remoteUser": "root"
4039
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Modified from ChatGPT suggestions
2+
WPILIB_VSIX_URL=$(curl -s "https://api.github.com/repos/wpilibsuite/vscode-wpilib/releases/latest" | jq -r '.assets[] | select(.name | test(".vsix$")) | .browser_download_url')
3+
INSTALL_LOCATION="/tmp/wpilib-extension/latest.vsix"
4+
echo "$WPILIB_VSIX_URL"
5+
curl --create-dirs -L -o "$INSTALL_LOCATION" "$WPILIB_VSIX_URL"
6+
code --install-extension "$INSTALL_LOCATION"

0 commit comments

Comments
 (0)