提交 09258c5c 编写于 作者: D Dirk Baeumer

Fixes #27616: "No build/test task defined" messages need update

上级 55b5762e
......@@ -741,7 +741,11 @@ class TaskService extends EventEmitter implements ITaskService {
return this.getTaskSets().then((values) => {
let runnable = this.createRunnableTask(values, TaskGroup.Build);
if (!runnable || !runnable.task) {
throw new TaskError(Severity.Info, nls.localize('TaskService.noBuildTask', 'No build task defined. Mark a task with as \'build\' group in the tasks.json file.'), TaskErrors.NoBuildTask);
if (this.getJsonSchemaVersion() === JsonSchemaVersion.V0_1_0) {
throw new TaskError(Severity.Info, nls.localize('TaskService.noBuildTask1', 'No build task defined. Mark a task with \'isBuildCommand\' in the tasks.json file.'), TaskErrors.NoBuildTask);
} else {
throw new TaskError(Severity.Info, nls.localize('TaskService.noBuildTask2', 'No build task defined. Mark a task with as a \'build\' group in the tasks.json file.'), TaskErrors.NoBuildTask);
}
}
return this.executeTask(runnable.task, runnable.resolver);
}).then(value => value, (error) => {
......@@ -762,7 +766,11 @@ class TaskService extends EventEmitter implements ITaskService {
return this.getTaskSets().then((values) => {
let runnable = this.createRunnableTask(values, TaskGroup.Test);
if (!runnable || !runnable.task) {
throw new TaskError(Severity.Info, nls.localize('TaskService.noTestTask', 'No test task defined. Mark a task with \'isTestCommand\' in the tasks.json file.'), TaskErrors.NoTestTask);
if (this.getJsonSchemaVersion() === JsonSchemaVersion.V0_1_0) {
throw new TaskError(Severity.Info, nls.localize('TaskService.noTestTask1', 'No test task defined. Mark a task with \'isTestCommand\' in the tasks.json file.'), TaskErrors.NoTestTask);
} else {
throw new TaskError(Severity.Info, nls.localize('TaskService.noTestTask2', 'No test task defined. Mark a task with as a \'test\' group in the tasks.json file.'), TaskErrors.NoTestTask);
}
}
return this.executeTask(runnable.task, runnable.resolver);
}).then(value => value, (error) => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册