feat: looping over dependencies (#1541)

* feat: support for loops in deps

* chore: tests

* docs: looping over deps
This commit is contained in:
Pete Davison
2024-03-10 17:21:50 +00:00
committed by GitHub
parent 29e91a4137
commit f06f48e225
11 changed files with 384 additions and 78 deletions

View File

@@ -48,17 +48,7 @@
},
"deps": {
"description": "A list of dependencies of this task. Tasks defined here will run in parallel before this task.",
"type": "array",
"items": {
"oneOf": [
{
"type": "string"
},
{
"$ref": "#/definitions/task_call"
}
]
}
"$ref": "#/definitions/deps"
},
"label": {
"description": "Overrides the name of the task in the output when a task is run. Supports variables.",
@@ -216,10 +206,26 @@
"$ref": "#/definitions/defer_call"
},
{
"$ref": "#/definitions/for_call"
"$ref": "#/definitions/for_cmds_call"
}
]
},
"deps": {
"type": "array",
"items": {
"oneOf": [
{
"type": "string"
},
{
"$ref": "#/definitions/task_call"
},
{
"$ref": "#/definitions/for_deps_call"
}
]
}
},
"set": {
"type": "string",
"enum": [
@@ -367,21 +373,11 @@
"additionalProperties": false,
"required": ["defer"]
},
"for_call": {
"for_cmds_call": {
"type": "object",
"properties": {
"for": {
"anyOf": [
{
"$ref": "#/definitions/for_list"
},
{
"$ref": "#/definitions/for_attribute"
},
{
"$ref": "#/definitions/for_var"
}
]
"$ref": "#/definitions/for"
},
"cmd": {
"description": "Command to run",
@@ -407,6 +403,45 @@
"additionalProperties": false,
"required": ["for"]
},
"for_deps_call": {
"type": "object",
"properties": {
"for": {
"$ref": "#/definitions/for"
},
"silent": {
"description": "Silent mode disables echoing of command before Task runs it",
"type": "boolean"
},
"task": {
"description": "Task to run",
"type": "string"
},
"vars": {
"description": "Values passed to the task called",
"$ref": "#/definitions/vars"
}
},
"oneOf": [
{"required": ["cmd"]},
{"required": ["task"]}
],
"additionalProperties": false,
"required": ["for"]
},
"for": {
"anyOf": [
{
"$ref": "#/definitions/for_list"
},
{
"$ref": "#/definitions/for_attribute"
},
{
"$ref": "#/definitions/for_var"
}
]
},
"for_list": {
"description": "A list of values to iterate over",
"type": "array",