提交 5038a82f 编写于 作者: A Alex Ross

Make tasks schema validate that command is required on process tasks

Related to #68550
上级 bee9570c
...@@ -177,7 +177,7 @@ const group: IJSONSchema = { ...@@ -177,7 +177,7 @@ const group: IJSONSchema = {
const taskType: IJSONSchema = { const taskType: IJSONSchema = {
type: 'string', type: 'string',
enum: ['shell', 'process'], enum: ['shell'],
default: 'shell', default: 'shell',
description: nls.localize('JsonSchema.tasks.type', 'Defines whether the task is run as a process or as a command inside a shell.') description: nls.localize('JsonSchema.tasks.type', 'Defines whether the task is run as a process or as a command inside a shell.')
}; };
...@@ -431,6 +431,17 @@ taskDescriptionProperties.isTestCommand.deprecationMessage = nls.localize( ...@@ -431,6 +431,17 @@ taskDescriptionProperties.isTestCommand.deprecationMessage = nls.localize(
'The property isTestCommand is deprecated. Use the group property instead. See also the 1.14 release notes.' 'The property isTestCommand is deprecated. Use the group property instead. See also the 1.14 release notes.'
); );
// Process tasks are almost identical schema-wise to shell tasks, but they are required to have a command
const processTask = Objects.deepClone(taskDescription);
processTask.properties!.type = {
type: 'string',
enum: ['process'],
default: 'shell',
description: nls.localize('JsonSchema.tasks.type', 'Defines whether the task is run as a process or as a command inside a shell.')
};
processTask.required!.push('command');
taskDefinitions.push(processTask);
taskDefinitions.push({ taskDefinitions.push({
$ref: '#/definitions/taskDescription' $ref: '#/definitions/taskDescription'
...@@ -442,7 +453,6 @@ tasks.items = { ...@@ -442,7 +453,6 @@ tasks.items = {
oneOf: taskDefinitions oneOf: taskDefinitions
}; };
definitionsTaskRunnerConfigurationProperties.inputs = inputsSchema.definitions!.inputs; definitionsTaskRunnerConfigurationProperties.inputs = inputsSchema.definitions!.inputs;
definitions.commandConfiguration.properties!.isShellCommand = Objects.deepClone(shellCommand); definitions.commandConfiguration.properties!.isShellCommand = Objects.deepClone(shellCommand);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册