【发布时间】:2019-01-07 00:10:48
【问题描述】:
我试图弄清楚如何在 launch.json 文件的 prelaunchtask 中一次运行多个任务。
我在tasks.json中的代码如下:
"version": "2.0.0",
"tasks": [
{
"label": "CleanUp_Client",
"type": "shell",
"command": "rm",
"args": [
"-f",
"Client"
],
},
{
"label": "Client_Build",
"type": "shell",
"command": "g++",
"args": [
"-g",
"client.cpp",
"-o",
"Client",
"-lssl",
"-lcrypto"
],
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": "$gcc"
}
]
在preLaunchTask参数的launch.json中,如果我只把它工作的构建任务,但是我想运行多个任务,在这种情况下是CleanUp_Client和Client_Build。
我尝试添加另一个 preLaunchTask - 但是看起来您只能使用该参数一次,所以我尝试了:
"preLaunchTask": "build" + "clean",
"preLaunchTask": "build"; "clean",
"preLaunchTask": "build" & "clean",
"preLaunchTask": "build" && "clean",
都没有成功,语法不正确。
另外,作为第二部分,我想知道这个组部分是如何工作的,以及它对“isDefault”意味着什么:true。
【问题讨论】:
标签: visual-studio-code vscode-settings vscode-tasks