From 8694e5e6a82a80dbab0b587a12c974824b6f1a48 Mon Sep 17 00:00:00 2001 From: vinzenzm Date: Fri, 8 Nov 2024 23:26:29 +0100 Subject: [PATCH 1/2] Added two tasks to vscode which can be executed in order to run catkin_make inside the container. One of them is more convenient as a list of containers is automatically provided. It however depends on a vscode extension not yet in recomendations. We might need to select one of the two options and remove the other. --- .vscode/extensions.json | 3 ++- .vscode/tasks.json | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 .vscode/tasks.json diff --git a/.vscode/extensions.json b/.vscode/extensions.json index c27bbad5..596e223e 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -12,6 +12,7 @@ "richardkotze.git-mob", "ms-vscode-remote.remote-containers", "valentjn.vscode-ltex", - "ms-python.black-formatter" + "ms-python.black-formatter", + "augustocdias.tasks-shell-input" ] } \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 00000000..e59d7898 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,36 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "Run 'catkin_make' in Docker container. Write container name.", + "type": "shell", + "command": "docker exec -it ${input:container_name} bash -c 'cd ../../catkin_ws && source /opt/ros/noetic/setup.bash && bash devel/setup.bash && catkin_make'", + "problemMatcher": [], + "detail": "Executes 'catkin_make' in built-agent-dev-1 container. The container must be running.", + "dependsOn": [], + }, + { + "label": "Run 'catkin_make' in docker container. Autochoose docker container.", + "type": "shell", + "command": "docker exec -it ${input:container_name_shell} bash -c 'cd ../../catkin_ws && source /opt/ros/noetic/setup.bash && bash devel/setup.bash && catkin_make'", + "problemMatcher": [], + "detail": "Executes 'catkin_make' selected container. Requires Tasks Shell Input Extension.", + } + ], + "inputs": [ + { + "id": "container_name", + "description": "Name of docker container", + "default": "build-agent-dev-1", + "type": "promptString" + }, + { + "id": "container_name_shell", + "type": "command", + "command": "shellCommand.execute", + "args": { + "command": "docker ps --format '{{.Names}}'", + } + } + ] +} \ No newline at end of file From 676073ee2bd6cccd89648bbc6d31b17918e9c3f5 Mon Sep 17 00:00:00 2001 From: vinzenzm Date: Tue, 12 Nov 2024 23:43:57 +0100 Subject: [PATCH 2/2] Removed one version of the catkin_make task. As the addition of a vscode extension is no problem, the cumbersome way of selecting the task via an input field was removed. This now requires the tasksshellinput extension. --- .vscode/tasks.json | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index e59d7898..9f845638 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -2,30 +2,16 @@ "version": "2.0.0", "tasks": [ { - "label": "Run 'catkin_make' in Docker container. Write container name.", + "label": "Run 'catkin_make' in docker container. Choose container from list of running containers.", "type": "shell", "command": "docker exec -it ${input:container_name} bash -c 'cd ../../catkin_ws && source /opt/ros/noetic/setup.bash && bash devel/setup.bash && catkin_make'", "problemMatcher": [], - "detail": "Executes 'catkin_make' in built-agent-dev-1 container. The container must be running.", - "dependsOn": [], - }, - { - "label": "Run 'catkin_make' in docker container. Autochoose docker container.", - "type": "shell", - "command": "docker exec -it ${input:container_name_shell} bash -c 'cd ../../catkin_ws && source /opt/ros/noetic/setup.bash && bash devel/setup.bash && catkin_make'", - "problemMatcher": [], - "detail": "Executes 'catkin_make' selected container. Requires Tasks Shell Input Extension.", + "detail": "Executes 'catkin_make' selected container. Requires Tasks Shell Input Extension, in order to generate the list of containers.", } ], "inputs": [ { "id": "container_name", - "description": "Name of docker container", - "default": "build-agent-dev-1", - "type": "promptString" - }, - { - "id": "container_name_shell", "type": "command", "command": "shellCommand.execute", "args": {