77 lines
3.0 KiB
JSON
77 lines
3.0 KiB
JSON
{
|
|
"version": "2.0.0",
|
|
"tasks": [
|
|
{
|
|
"label": "run-build-script",
|
|
"type": "shell",
|
|
"command": "${workspaceFolder}/release/build.sh",
|
|
"problemMatcher": [
|
|
"$gcc"
|
|
],
|
|
"group": {
|
|
"kind": "build",
|
|
"isDefault": true
|
|
}
|
|
},
|
|
{
|
|
"label": "build-arm",
|
|
"type": "shell",
|
|
"command": "${workspaceFolder}/release/build.sh arm",
|
|
"problemMatcher": [
|
|
"$gcc"
|
|
],
|
|
"group": "build"
|
|
},
|
|
{
|
|
"label": "deploy-to-rk",
|
|
"type": "shell",
|
|
"command": "sshpass -p 'root' scp -o StrictHostKeyChecking=no ${workspaceFolder}/release/arm/exe/RTU root@198.120.0.100:/mnt/RTU/ && echo 'Deploy OK' && sshpass -p 'root' ssh -o StrictHostKeyChecking=no root@198.120.0.100 'killall gdbserver 2>/dev/null; killall RTU 2>/dev/null; sleep 1; nohup gdbserver 0.0.0.0:2345 /mnt/RTU/RTU > /tmp/rtu_output.log 2>&1 &' && echo 'gdbserver started on :2345 | RTU output → /tmp/rtu_output.log'",
|
|
"problemMatcher": [],
|
|
"dependsOn": ["build-arm"],
|
|
"group": "build",
|
|
"detail": "Build ARM binary, deploy to RK3568, start gdbserver, RTU output→/tmp/rtu_output.log"
|
|
},
|
|
{
|
|
"label": "start-gdbserver",
|
|
"type": "shell",
|
|
"command": "sshpass -p 'root' ssh -o StrictHostKeyChecking=no root@198.120.0.100 'killall gdbserver 2>/dev/null; killall RTU 2>/dev/null; sleep 1; nohup gdbserver 0.0.0.0:2345 /mnt/RTU/RTU > /tmp/rtu_output.log 2>&1 &' && echo 'gdbserver started on :2345 | RTU output → /tmp/rtu_output.log'",
|
|
"problemMatcher": [],
|
|
"group": "build"
|
|
},
|
|
{
|
|
"label": "tail-rtu-output",
|
|
"type": "shell",
|
|
"command": "sshpass -p 'root' ssh -o StrictHostKeyChecking=no root@198.120.0.100 'tail -f /tmp/rtu_output.log'",
|
|
"problemMatcher": [],
|
|
"group": "build",
|
|
"isBackground": true
|
|
},
|
|
{
|
|
"label": "stop-gdbserver",
|
|
"type": "shell",
|
|
"command": "sshpass -p 'root' ssh -o StrictHostKeyChecking=no root@198.120.0.100 'killall gdbserver 2>/dev/null' && echo 'gdbserver stopped'",
|
|
"problemMatcher": [],
|
|
"group": "build"
|
|
},
|
|
{
|
|
"type": "cppbuild",
|
|
"label": "C/C++: aarch64-linux-gnu-g++ 生成活动文件",
|
|
"command": "/usr/bin/aarch64-linux-gnu-g++",
|
|
"args": [
|
|
"-fdiagnostics-color=always",
|
|
"-g",
|
|
"${file}",
|
|
"-o",
|
|
"${fileDirname}/${fileBasenameNoExtension}"
|
|
],
|
|
"options": {
|
|
"cwd": "${fileDirname}"
|
|
},
|
|
"problemMatcher": [
|
|
"$gcc"
|
|
],
|
|
"group": "build",
|
|
"detail": "编译器: /usr/bin/aarch64-linux-gnu-g++"
|
|
}
|
|
]
|
|
} |