I have many tasks defined in tasks.json
{
"version": "2.0.0",
"tasks": [
{ "identifier": "tsc-main",
"type": "typescript",
"tsconfig": "tsconfig.json",
"problemMatcher": [
"$tsc"
]
},
{ "identifier": "tsc-other",
"type": "typescript",
"tsconfig": "./other-path/tsconfig.json",
"problemMatcher": [
"$tsc"
]
}
]
}
I want to have a task that runs several tasks together. Run all without stoping one if other has errors.
Something like:
{ "identifier": "joined task",
"type": "task-list", // <= does not exists
"tasks": ["tsc-main","tsc-other"] // <==
}
Other way is running all the commands in the shell, but I don't know how run tasks via the command line
{ "identifier": "joined task",
"type": "shell",
"command": "task tsc-main ; task tsc-other", // <== I don't know how to write "task"
"problemMatcher": [
"$tsc"
]
}
Also I know how to write a list of commands in a shell task, but thats has another problem: the definitions are written in two differente places (the original task and the joined task) and thats violates the rule "each definition must be in only one place". If some one in the team add one option to one task he must remember to add than option to the "joined task".
{ "identifier": "joined task",
"type": "shell",
"command": "tsc ; tsc -p ./other-path/tsconfig.json",
"problemMatcher": [
"$tsc" // <= I am not shure about this
]
}
I think you're looking for dependsOn
:
{
"label": "joined task",
"dependsOn": ["tsc-main", "tsc-other"]
}