2082
2083
constructor(workspaceFolder: IWorkspaceFolder, workspace: IWorkspace | undefined, platform: Platform, problemReporter: IProblemReporter, uuidMap: UUIDMap) {
2085
>
this.workspace = workspace;
2086
>
this.platform = platform;
2087
>
this.problemReporter = problemReporter;
2088
>
this.uuidMap = uuidMap;
2089
>
}
2090
2091
public run(fileConfig: IExternalTaskRunnerConfiguration, source: TaskConfigSource, contextKeyService: IContextKeyService): IParseResult {
2093
>
const schemaVersion = JsonSchemaVersion.from(fileConfig);
2094
>
const context: IParseContext = {
2095
>
workspaceFolder: this.workspaceFolder,
2096
>
workspace: this.workspace,
2097
>
problemReporter: this.problemReporter,
2098
>
uuidMap: this.uuidMap,
2099
>
namedProblemMatchers: {},
2100
>
engine,
2101
>
schemaVersion,
2102
>
platform: this.platform,
2103
>
taskLoadIssues: [],
2104
>
contextKeyService
2105
>
};
2106
>
const taskParseResult = this.createTaskRunnerConfiguration(fileConfig, context, source);
2107
>
return {
2108
>
validationStatus: this.problemReporter.status,
2109
>
custom: taskParseResult.custom,
2110
>
configured: taskParseResult.configured,
2111
>
engine
2112
>
};
2113
>
}
2114
2115
private createTaskRunnerConfiguration(fileConfig: IExternalTaskRunnerConfiguration, context: IParseContext, source: TaskConfigSource): ITaskParseResult {
2117
>
if (this.problemReporter.status.isFatal()) {
2118
return { custom: [], configured: [] };
2119
}
2120
>
context.namedProblemMatchers = ProblemMatcherConverter.namedFrom(fileConfig.declares, context);
taskConfiguration.ts
2121
>
let globalTasks: Tasks.CustomTask[] | undefined = undefined;
2122
>
let externalGlobalTasks: Array<IConfiguringTask | ICustomTask> | undefined = undefined;
2123
>
if (fileConfig.windows && context.platform === Platform.Windows) {
2124
globalTasks = TaskParser.from(fileConfig.windows.tasks, globals, context, source).custom;
2125
externalGlobalTasks = fileConfig.windows.tasks;
2127
globalTasks = TaskParser.from(fileConfig.osx.tasks, globals, context, source).custom;
2128
externalGlobalTasks = fileConfig.osx.tasks;
2130
globalTasks = TaskParser.from(fileConfig.linux.tasks, globals, context, source).custom;
2131
externalGlobalTasks = fileConfig.linux.tasks;
2132
}
2133
>
if (context.schemaVersion === Tasks.JsonSchemaVersion.V2_0_0 && globalTasks && globalTasks.length > 0 && externalGlobalTasks && externalGlobalTasks.length > 0) {
taskConfiguration.ts
2134
const taskContent: string[] = [];
2135
for (const task of externalGlobalTasks) {