vscode
vscode copied to clipboard
Feature request: Override command at task level
- VSCode Version: 1.1.1
- OS Version: any
Currently tasks.json schema requires a top level command which will be invoked along with task arguments.
Say for example a simple dotnet app, it looks like this.
{
"version": "0.1.0",
"command": "dotnet",
"isShellCommand": true,
"args": [],
"tasks": [
{
"taskName": "build",
"args": [],
"isBuildCommand": true,
"problemMatcher": "$msCompile"
}
]
}
However if i have a build script which builds and deploys the binaries on a docker container. I could solve the issue like this
{
"version": "0.1.0",
"windows" : {
"command": "cmd",
"args" : ["/c"]
},
"suppressTaskName": true,
"tasks": [
{
"taskName": "build",
"args": ["dotnet build"],
"isBuildCommand": true
},
{
"taskName": "buildDocker",
"args": ["dotnetdocker build"],
"isBuildCommand": true
}
]
}
But this requires spinning up an extra shell. It would be better if the task allows fully overriding the command. That would simplify the tasks.json to something like
{
"version": "0.1.0",
"command": "dotnet",
"isShellCommand": true,
"args": [],
"tasks": [
{
"taskName": "build",
"args": [],
"isBuildCommand": true,
"problemMatcher": "$msCompile"
},
{
"overrideCommand": true,
"taskName": "buildDocker",
"command":"dotnetdocker"
"args": ["build"],
"isBuildCommand": true,
"problemMatcher": "$msCompile"
}
]
}
This got implemented for task 0.1.0 and 2.0.0. Each task can define its own command.