Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 42 additions & 63 deletions schema/mise-task.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,55 +4,6 @@
"title": "mise-task-schema",
"type": "object",
"$defs": {
"run_step": {
"oneOf": [
{
"description": "script to run",
"type": "string"
},
{
"additionalProperties": false,
"properties": {
"task": {
"description": "single task name (with optional args) to run",
"type": "string"
}
},
"required": ["task"],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"tasks": {
"description": "parallel task group to run",
"items": {
"description": "task name and args",
"type": "string"
},
"type": "array"
}
},
"required": ["tasks"],
"type": "object"
}
]
},
"run_field": {
"oneOf": [
{
"description": "script to run",
"type": "string"
},
{
"description": "list of steps mixing scripts and task references",
"items": {
"$ref": "#/$defs/run_step"
},
"type": "array"
}
]
},
"task": {
"oneOf": [
{
Expand Down Expand Up @@ -274,32 +225,26 @@
"run": {
"oneOf": [
{
"description": "script to run",
"type": "string"
"$ref": "#/$defs/task_run_entry"
},
{
"description": "script to run",
"type": "array",
"items": {
"description": "script to run",
"type": "string"
},
"type": "array"
"$ref": "#/$defs/task_run_entry"
}
}
]
},
"run_windows": {
"oneOf": [
{
"description": "script to run on windows",
"type": "string"
"$ref": "#/$defs/task_run_entry"
},
{
"description": "script to run on windows",
"type": "array",
"items": {
"description": "script to run on windows",
"type": "string"
},
"type": "array"
"$ref": "#/$defs/task_run_entry"
}
}
]
},
Expand Down Expand Up @@ -642,6 +587,40 @@
"required": ["paths"]
}
]
},
"task_run_entry": {
"oneOf": [
{
"description": "script to run",
"type": "string"
},
{
"type": "object",
"additionalProperties": false,
"properties": {
"task": {
"description": "single task name (with optional args) to run",
"type": "string"
}
},
"required": ["task"]
},
{
"type": "object",
"additionalProperties": false,
"properties": {
"tasks": {
"description": "parallel task group to run",
"items": {
"description": "task name and args",
"type": "string"
},
"type": "array"
}
},
"required": ["tasks"]
}
]
}
},
"description": "Config file for included mise tasks (https://mise.jdx.dev/tasks/#task-configuration)",
Expand Down
56 changes: 42 additions & 14 deletions schema/mise.json
Original file line number Diff line number Diff line change
Expand Up @@ -1140,6 +1140,40 @@
}
}
},
"task_run_entry": {
"oneOf": [
{
"description": "script to run",
"type": "string"
},
{
"type": "object",
"additionalProperties": false,
"properties": {
"task": {
"description": "single task name (with optional args) to run",
"type": "string"
}
},
"required": ["task"]
},
{
"type": "object",
"additionalProperties": false,
"properties": {
"tasks": {
"description": "parallel task group to run",
"items": {
"description": "task name and args",
"type": "string"
},
"type": "array"
}
},
"required": ["tasks"]
}
]
},
"task": {
"oneOf": [
{
Expand Down Expand Up @@ -1361,32 +1395,26 @@
"run": {
"oneOf": [
{
"description": "script to run",
"type": "string"
"$ref": "#/$defs/task_run_entry"
},
{
"description": "script to run",
"type": "array",
"items": {
"description": "script to run",
"type": "string"
},
"type": "array"
"$ref": "#/$defs/task_run_entry"
}
}
]
},
"run_windows": {
"oneOf": [
{
"description": "script to run on windows",
"type": "string"
"$ref": "#/$defs/task_run_entry"
},
{
"description": "script to run on windows",
"type": "array",
"items": {
"description": "script to run on windows",
"type": "string"
},
"type": "array"
"$ref": "#/$defs/task_run_entry"
}
}
]
},
Expand Down
5 changes: 3 additions & 2 deletions xtasks/render/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,10 @@ fs.unlinkSync("schema/mise.json.tmp");
const taskSchema = JSON.parse(
fs.readFileSync("schema/mise-task.json", "utf-8"),
);
taskSchema["$defs"].task = schema["$defs"].task;
taskSchema["$defs"].env = schema["$defs"].env;
taskSchema["$defs"].env_directive = schema["$defs"].env_directive;
taskSchema["$defs"].env = schema["$defs"].env;
taskSchema["$defs"].task_run_entry = schema["$defs"].task_run_entry;
taskSchema["$defs"].task = schema["$defs"].task;
fs.writeFileSync("schema/mise-task.json.tmp", JSON.stringify(taskSchema));
child_process.execSync(
"jq . < schema/mise-task.json.tmp > schema/mise-task.json",
Expand Down
Loading