diff --git a/.vscode/launch.json b/.vscode/launch.json index 2ab37b0..f72a88a 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -2,39 +2,47 @@ "configurations": [ { "name": "macOS LLDB (x86_64)", - "type": "cppdbg", + "type": "lldb", "request": "launch", - "program": "${workspaceFolder}/macchina.io/server/bin/Darwin/x86_64/macchina", + "program": "${workspaceFolder}/macchina.io/server/bin/Darwin/x86_64/macchinad", "args": ["--config=${workspaceFolder}/etc/macchina.properties"], - "stopAtEntry": false, + "stopOnEntry": false, "cwd": "${workspaceFolder}", - "environment": [{ "name": "POCO_ENABLE_DEBUGGER", "value": "1" }], - "externalConsole": false, - "MIMode": "lldb" + "env": { + "POCO_ENABLE_DEBUGGER": "1", + "DYLD_LIBRARY_PATH": "${workspaceFolder}/macchina.io/platform/lib/Darwin/x86_64" + }, + "terminal": "external" }, { "name": "Linux GDB (x86_64)", "type": "cppdbg", "request": "launch", - "program": "${workspaceFolder}/macchina.io/server/bin/Linux/x86_64/macchina", + "program": "${workspaceFolder}/macchina.io/server/bin/Linux/x86_64/macchinad", "args": ["--config=${workspaceFolder}/etc/macchina.properties"], "stopAtEntry": false, "cwd": "${workspaceFolder}", - "environment": [{ "name": "POCO_ENABLE_DEBUGGER", "value": "1" }], + "environment": [ + { "name": "POCO_ENABLE_DEBUGGER", "value": "1" }, + { "name": "LD_LIBRARY_PATH", "value": "${workspaceFolder}/macchina.io/platform/lib/Linux/x86_64:${workspaceFolder}/var/cache/bundles" } + ], "externalConsole": false, - "MIMode": "lldb" + "MIMode": "gdb" }, { "name": "Linux GDB (armv7l)", "type": "cppdbg", "request": "launch", - "program": "${workspaceFolder}/macchina.io/server/bin/Linux/armv7l/macchina", + "program": "${workspaceFolder}/macchina.io/server/bin/Linux/armv7l/macchinad", "args": ["--config=${workspaceFolder}/etc/macchina.properties"], "stopAtEntry": false, "cwd": "${workspaceFolder}", - "environment": [{ "name": "POCO_ENABLE_DEBUGGER", "value": "1" }], + "environment": [ + { "name": "POCO_ENABLE_DEBUGGER", "value": "1" }, + { "name": "LD_LIBRARY_PATH", "value": "${workspaceFolder}/macchina.io/platform/lib/Linux/armv7l:${workspaceFolder}/var/cache/bundles" } + ], "externalConsole": false, - "MIMode": "lldb" + "MIMode": "gdb" } ] } diff --git a/.vscode/settings.json b/.vscode/settings.json index d6e5fd0..21f806f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,5 +3,10 @@ "editor.tabSize": 4, "files.associations": { "*.bndlspec": "xml" + }, + "files.exclude": { + "**/.dep": true, + "**/bin": true, + "**/obj": true } } diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 7e3258e..61006ac 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -3,7 +3,7 @@ "tasks": [ { "type": "shell", - "label": "Build workspace", + "label": "Build all", "command": "make", "args": [ "-s" @@ -25,7 +25,7 @@ }, { "type": "shell", - "label": "Clean workspace", + "label": "Clean all", "command": "make", "args": [ "-s", @@ -45,7 +45,7 @@ }, { "type": "shell", - "label": "Build project", + "label": "Build single project", "command": "make", "args": [ "-s" @@ -65,7 +65,7 @@ }, { "type": "shell", - "label": "Clean project", + "label": "Clean single project", "command": "make", "args": [ "-s", diff --git a/README.md b/README.md index 241cac0..13e7e33 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,24 @@ # sample-workspace A sample workspace for a project based on macchina.io IoT Edge Device SDK. -Configuration file for Visual Studio code are included. +This can be used as a template for your own projects. +The workspace includes the macchina.io IoT Edge SDK sources via a Git submodule. +The workspace includes one sample project, a simple implementation of a +temperature sensor based on the Linux Thermal subsystem (`/sys/class/thermal`). + +## Visual Studio Code + +Configuration files for Visual Studio Code are included in the workspace. +The following Visual Studio Code extensions should be installed: + - C/C++ (required) + - C++ Intellisense (highly recommended) + - CodeLLDB (required on macOS for debugging) + +The following tasks have been defined in [tasks.json](.vscode/tasks.json): + - Build all: Builds the entire workspace using the global Makefile. + - Clean all: Cleans the entire workspace. + - Build single project: Builds a single project. The project's Makefile must be selected. + - Clean single project: Cleans a single project. The project's Makefile must be selected. + - RemoteGen: Runs the Remoting code generator. A RemoteGen.xml configuration file must be selected. + +Launch configurations for debugging via gdb (on Linux) and lldb (on macOS) are also included.