@theia/task 1.32.0-next.3 → 1.32.0-next.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/task-configurations.js +1 -1
- package/lib/browser/task-configurations.js.map +1 -1
- package/lib/browser/task-service.d.ts +6 -10
- package/lib/browser/task-service.d.ts.map +1 -1
- package/lib/browser/task-service.js +11 -8
- package/lib/browser/task-service.js.map +1 -1
- package/lib/common/problem-matcher-protocol.d.ts +36 -1
- package/lib/common/problem-matcher-protocol.d.ts.map +1 -1
- package/lib/common/problem-matcher-protocol.js.map +1 -1
- package/lib/common/task-protocol.d.ts +17 -36
- package/lib/common/task-protocol.d.ts.map +1 -1
- package/lib/common/task-protocol.js.map +1 -1
- package/lib/node/process/process-task-runner.d.ts +1 -1
- package/lib/node/process/process-task-runner.d.ts.map +1 -1
- package/lib/node/task-manager.d.ts +2 -1
- package/lib/node/task-manager.d.ts.map +1 -1
- package/lib/node/task-manager.js +3 -1
- package/lib/node/task-manager.js.map +1 -1
- package/lib/node/task-runner-protocol.d.ts +17 -0
- package/lib/node/task-runner-protocol.d.ts.map +1 -0
- package/lib/node/task-runner-protocol.js +20 -0
- package/lib/node/task-runner-protocol.js.map +1 -0
- package/lib/node/task-runner.d.ts +2 -16
- package/lib/node/task-runner.d.ts.map +1 -1
- package/lib/node/task-runner.js +3 -2
- package/lib/node/task-runner.js.map +1 -1
- package/lib/node/task.d.ts +4 -5
- package/lib/node/task.d.ts.map +1 -1
- package/lib/node/task.js +1 -2
- package/lib/node/task.js.map +1 -1
- package/package.json +13 -13
- package/src/browser/task-configurations.ts +1 -1
- package/src/browser/task-service.ts +16 -9
- package/src/common/problem-matcher-protocol.ts +43 -1
- package/src/common/task-protocol.ts +18 -40
- package/src/node/process/process-task-runner.ts +1 -1
- package/src/node/task-manager.ts +5 -2
- package/src/node/task-runner-protocol.ts +33 -0
- package/src/node/task-runner.ts +2 -17
- package/src/node/task.ts +3 -4
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Emitter, Event, ILogger } from '@theia/core/lib/common';
|
|
2
2
|
import { BackendApplicationContribution } from '@theia/core/lib/node';
|
|
3
3
|
import { Task } from './task';
|
|
4
|
+
import { ManagedTaskManager } from '../common';
|
|
4
5
|
/**
|
|
5
6
|
* The {@link TaskManager} is the common component responsible for managing running tasks.
|
|
6
7
|
*/
|
|
7
|
-
export declare class TaskManager implements BackendApplicationContribution {
|
|
8
|
+
export declare class TaskManager implements BackendApplicationContribution, ManagedTaskManager<Task> {
|
|
8
9
|
protected readonly logger: ILogger;
|
|
9
10
|
/** contains all running tasks */
|
|
10
11
|
protected readonly tasks: Map<number, Task>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-manager.d.ts","sourceRoot":"","sources":["../../src/node/task-manager.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,8BAA8B,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"task-manager.d.ts","sourceRoot":"","sources":["../../src/node/task-manager.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,8BAA8B,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAI/C;;GAEG;AACH,qBACa,WAAY,YAAW,8BAA8B,EAAE,kBAAkB,CAAC,IAAI,CAAC;IAcpD,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO;IAZtE,iCAAiC;IACjC,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAa;IACxD,yCAAyC;IACzC,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAa;IAChE,2DAA2D;IAC3D,SAAS,CAAC,EAAE,EAAE,MAAM,CAAM;IAC1B;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,aAAa,kBAAyB;gBAGF,MAAM,EAAE,OAAO;IAGtE;;;;;;;OAOG;IACH,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM;IAgB1C;;;;;OAKG;IACH,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS;IAIjC;;;;;;OAMG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,EAAE,GAAG,SAAS;IAU1C;;;OAGG;IACH,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI;IAgBxB,IAAI,QAAQ,IAAI,KAAK,CAAC,MAAM,CAAC,CAE5B;IAED;;OAEG;IACH,MAAM,IAAI,IAAI;CAMjB"}
|
package/lib/node/task-manager.js
CHANGED
|
@@ -106,7 +106,9 @@ let TaskManager = class TaskManager {
|
|
|
106
106
|
const tasksForWS = this.tasksPerCtx.get(ctx);
|
|
107
107
|
if (tasksForWS !== undefined) {
|
|
108
108
|
const idx = tasksForWS.indexOf(task);
|
|
109
|
-
|
|
109
|
+
if (idx !== -1) {
|
|
110
|
+
tasksForWS.splice(idx, 1);
|
|
111
|
+
}
|
|
110
112
|
}
|
|
111
113
|
}
|
|
112
114
|
this.deleteEmitter.fire(task.id);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-manager.js","sourceRoot":"","sources":["../../src/node/task-manager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gFAAgF;AAChF,0CAA0C;AAC1C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAw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aAAa,CAAC,KAAK,CAAC;IACpC,CAAC;IAED;;OAEG;IACH,MAAM;QACF,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAU,EAAE,EAAU,EAAE,EAAE;YAC1C,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,yDAAyD,EAAE,EAAE,CAAC,CAAC;YACjF,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACtB,CAAC,CAAC,CAAC;IACP,CAAC;CACJ,CAAA;AArGY,WAAW;IADvB,IAAA,sBAAU,GAAE;IAeJ,WAAA,IAAA,kBAAM,EAAC,gBAAO,CAAC,CAAA;IAAE,WAAA,IAAA,iBAAK,EAAC,MAAM,CAAC,CAAA;;GAd1B,WAAW,CAqGvB;AArGY,kCAAW"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { TaskConfiguration } from '../common';
|
|
2
|
+
import { Task } from './task';
|
|
3
|
+
export declare const TaskRunner: unique symbol;
|
|
4
|
+
/**
|
|
5
|
+
* A {@link TaskRunner} knows how to run a task configuration of a particular type.
|
|
6
|
+
*/
|
|
7
|
+
export interface TaskRunner {
|
|
8
|
+
/**
|
|
9
|
+
* Runs a task based on the given `TaskConfiguration`.
|
|
10
|
+
* @param taskConfig the task configuration that should be executed.
|
|
11
|
+
* @param ctx the execution context.
|
|
12
|
+
*
|
|
13
|
+
* @returns a promise of the (currently running) {@link Task}.
|
|
14
|
+
*/
|
|
15
|
+
run(tskConfig: TaskConfiguration, ctx?: string): Promise<Task>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=task-runner-protocol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-runner-protocol.d.ts","sourceRoot":"","sources":["../../src/node/task-runner-protocol.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,eAAO,MAAM,UAAU,eAAuB,CAAC;AAC/C;;GAEG;AACH,MAAM,WAAW,UAAU;IACvB;;;;;;OAMG;IACH,GAAG,CAAC,SAAS,EAAE,iBAAiB,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAClE"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2022 Ericsson and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.TaskRunner = void 0;
|
|
19
|
+
exports.TaskRunner = Symbol('TaskRunner');
|
|
20
|
+
//# sourceMappingURL=task-runner-protocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-runner-protocol.js","sourceRoot":"","sources":["../../src/node/task-runner-protocol.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,0CAA0C;AAC1C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;;;AAKnE,QAAA,UAAU,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Disposable } from '@theia/core/lib/common/disposable';
|
|
2
2
|
import { ProcessTaskRunner } from './process/process-task-runner';
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import { TaskRunner } from './task-runner-protocol';
|
|
4
|
+
export { TaskRunner };
|
|
5
5
|
export declare const TaskRunnerContribution: unique symbol;
|
|
6
6
|
/** The {@link TaskRunnerContribution} can be used to contribute custom {@link TaskRunner}s. */
|
|
7
7
|
export interface TaskRunnerContribution {
|
|
@@ -11,20 +11,6 @@ export interface TaskRunnerContribution {
|
|
|
11
11
|
*/
|
|
12
12
|
registerRunner(runners: TaskRunnerRegistry): void;
|
|
13
13
|
}
|
|
14
|
-
export declare const TaskRunner: unique symbol;
|
|
15
|
-
/**
|
|
16
|
-
* A {@link TaskRunner} knows how to run a task configuration of a particular type.
|
|
17
|
-
*/
|
|
18
|
-
export interface TaskRunner {
|
|
19
|
-
/**
|
|
20
|
-
* Runs a task based on the given `TaskConfiguration`.
|
|
21
|
-
* @param taskConfig the task configuration that should be executed.
|
|
22
|
-
* @param ctx the execution context.
|
|
23
|
-
*
|
|
24
|
-
* @returns a promise of the (currently running) {@link Task}.
|
|
25
|
-
*/
|
|
26
|
-
run(tskConfig: TaskConfiguration, ctx?: string): Promise<Task>;
|
|
27
|
-
}
|
|
28
14
|
/**
|
|
29
15
|
* The {@link TaskRunnerRegistry} is the common component for the registration and provisioning of
|
|
30
16
|
* {@link TaskRunner}s. Theia will collect all {@link TaskRunner}s and invoke {@link TaskRunnerContribution#registerRunner}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-runner.d.ts","sourceRoot":"","sources":["../../src/node/task-runner.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"task-runner.d.ts","sourceRoot":"","sources":["../../src/node/task-runner.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,CAAC;AAEtB,eAAO,MAAM,sBAAsB,eAAmC,CAAC;AAEvE,+FAA+F;AAC/F,MAAM,WAAW,sBAAsB;IACnC;;;OAGG;IACH,cAAc,CAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI,CAAC;CACrD;AAED;;;;;GAKG;AACH,qBACa,kBAAkB;IAE3B,SAAS,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAC3C,yFAAyF;IACzF,SAAS,CAAC,aAAa,EAAE,UAAU,CAAC;IAGpC,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAGxD,SAAS,CAAC,IAAI,IAAI,IAAI;IAItB;;;;;;;;OAQG;IACH,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,UAAU;IAO5D;;;;;;OAMG;IACH,SAAS,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,UAAU;IAUzC;;;;OAIG;IACH,cAAc,IAAI,MAAM,EAAE;CAG7B"}
|
package/lib/node/task-runner.js
CHANGED
|
@@ -24,11 +24,12 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
24
24
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
25
|
};
|
|
26
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
exports.TaskRunnerRegistry = exports.
|
|
27
|
+
exports.TaskRunnerRegistry = exports.TaskRunnerContribution = exports.TaskRunner = void 0;
|
|
28
28
|
const inversify_1 = require("@theia/core/shared/inversify");
|
|
29
29
|
const process_task_runner_1 = require("./process/process-task-runner");
|
|
30
|
+
const task_runner_protocol_1 = require("./task-runner-protocol");
|
|
31
|
+
Object.defineProperty(exports, "TaskRunner", { enumerable: true, get: function () { return task_runner_protocol_1.TaskRunner; } });
|
|
30
32
|
exports.TaskRunnerContribution = Symbol('TaskRunnerContribution');
|
|
31
|
-
exports.TaskRunner = Symbol('TaskRunner');
|
|
32
33
|
/**
|
|
33
34
|
* The {@link TaskRunnerRegistry} is the common component for the registration and provisioning of
|
|
34
35
|
* {@link TaskRunner}s. Theia will collect all {@link TaskRunner}s and invoke {@link TaskRunnerContribution#registerRunner}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-runner.js","sourceRoot":"","sources":["../../src/node/task-runner.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;;;;;;;;;;;;AAEhF,4DAAiF;AAEjF,uEAAkE;
|
|
1
|
+
{"version":3,"file":"task-runner.js","sourceRoot":"","sources":["../../src/node/task-runner.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;;;;;;;;;;;;AAEhF,4DAAiF;AAEjF,uEAAkE;AAClE,iEAAoD;AAC3C,2FADA,iCAAU,OACA;AAEN,QAAA,sBAAsB,GAAG,MAAM,CAAC,wBAAwB,CAAC,CAAC;AAWvE;;;;;GAKG;AAEH,IAAa,kBAAkB,GAA/B,MAAa,kBAAkB;IAUjB,IAAI;QACV,IAAI,CAAC,OAAO,GAAG,IAAI,GAAG,EAAE,CAAC;QACzB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,iBAAiB,CAAC;IAChD,CAAC;IACD;;;;;;;;OAQG;IACH,cAAc,CAAC,IAAY,EAAE,MAAkB;QAC3C,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC/B,OAAO;YACH,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC;SAC3C,CAAC;IACN,CAAC;IAED;;;;;;OAMG;IACH,SAAS,CAAC,GAAG,KAAe;QACxB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;YACtB,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YACtC,IAAI,MAAM,EAAE;gBACR,OAAO,MAAM,CAAC;aACjB;SACJ;QACD,OAAO,IAAI,CAAC,aAAa,CAAC;IAC9B,CAAC;IAED;;;;OAIG;IACH,cAAc;QACV,OAAO,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;IACpC,CAAC;CACJ,CAAA;AAhDG;IADC,IAAA,kBAAM,EAAC,uCAAiB,CAAC;8BACY,uCAAiB;6DAAC;AAGxD;IADC,IAAA,yBAAa,GAAE;;;;8CAIf;AAbQ,kBAAkB;IAD9B,IAAA,sBAAU,GAAE;GACA,kBAAkB,CAuD9B;AAvDY,gDAAkB"}
|
package/lib/node/task.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ILogger, Disposable, DisposableCollection, Emitter, Event, MaybePromise } from '@theia/core/lib/common/';
|
|
2
|
-
import {
|
|
3
|
-
import { TaskInfo, TaskExitedEvent, TaskConfiguration, TaskOutputEvent } from '../common/task-protocol';
|
|
2
|
+
import { TaskInfo, TaskExitedEvent, TaskConfiguration, TaskOutputEvent, ManagedTask, ManagedTaskManager } from '../common/task-protocol';
|
|
4
3
|
/**
|
|
5
4
|
* Represents the options used for running a task.
|
|
6
5
|
*/
|
|
@@ -17,15 +16,15 @@ export interface TaskOptions {
|
|
|
17
16
|
* Implementing classes have to call the {@link Task#fireOutputLine} function
|
|
18
17
|
* whenever a new output occurs during the execution.
|
|
19
18
|
*/
|
|
20
|
-
export declare abstract class Task implements Disposable {
|
|
21
|
-
protected readonly taskManager:
|
|
19
|
+
export declare abstract class Task implements Disposable, ManagedTask {
|
|
20
|
+
protected readonly taskManager: ManagedTaskManager<Task>;
|
|
22
21
|
protected readonly logger: ILogger;
|
|
23
22
|
protected readonly options: TaskOptions;
|
|
24
23
|
protected taskId: number;
|
|
25
24
|
protected readonly toDispose: DisposableCollection;
|
|
26
25
|
readonly exitEmitter: Emitter<TaskExitedEvent>;
|
|
27
26
|
readonly outputEmitter: Emitter<TaskOutputEvent>;
|
|
28
|
-
constructor(taskManager:
|
|
27
|
+
constructor(taskManager: ManagedTaskManager<Task>, logger: ILogger, options: TaskOptions);
|
|
29
28
|
/**
|
|
30
29
|
* Terminate this task.
|
|
31
30
|
*
|
package/lib/node/task.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task.d.ts","sourceRoot":"","sources":["../../src/node/task.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAClH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"task.d.ts","sourceRoot":"","sources":["../../src/node/task.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,y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AC,QAAQ,CAAC;IAEjD,IAAI,EAAE,IAAI,MAAM,CAEf;IAED,IAAI,OAAO,IAAI,MAAM,GAAG,SAAS,CAEhC;IAED,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,OAAO,IAAI,IAAI;CAGlB"}
|
package/lib/node/task.js
CHANGED
|
@@ -27,7 +27,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
27
27
|
exports.Task = void 0;
|
|
28
28
|
const inversify_1 = require("@theia/core/shared/inversify");
|
|
29
29
|
const common_1 = require("@theia/core/lib/common/");
|
|
30
|
-
const task_manager_1 = require("./task-manager");
|
|
31
30
|
/**
|
|
32
31
|
* A {@link Task} represents the execution state of a `TaskConfiguration`.
|
|
33
32
|
* Implementing classes have to call the {@link Task#fireOutputLine} function
|
|
@@ -73,7 +72,7 @@ let Task = class Task {
|
|
|
73
72
|
};
|
|
74
73
|
Task = __decorate([
|
|
75
74
|
(0, inversify_1.injectable)(),
|
|
76
|
-
__metadata("design:paramtypes", [
|
|
75
|
+
__metadata("design:paramtypes", [Object, Object, Object])
|
|
77
76
|
], Task);
|
|
78
77
|
exports.Task = Task;
|
|
79
78
|
//# sourceMappingURL=task.js.map
|
package/lib/node/task.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task.js","sourceRoot":"","sources":["../../src/node/task.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,0CAA0C;AAC1C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;;;;;;;;;;;;AAEhF,4DAA0D;AAC1D,oDAAkH;
|
|
1
|
+
{"version":3,"file":"task.js","sourceRoot":"","sources":["../../src/node/task.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,0CAA0C;AAC1C,EAAE;AAC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AO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IAED,IAAI,OAAO;QACP,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;IAChC,CAAC;IAED,IAAI,KAAK;QACL,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;IAC9B,CAAC;IAED,OAAO;QACH,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;IAC7B,CAAC;CACJ,CAAA;AAjEqB,IAAI;IADzB,IAAA,sBAAU,GAAE;;GACS,IAAI,CAiEzB;AAjEqB,oBAAI"}
|
package/package.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/task",
|
|
3
|
-
"version": "1.32.0-next.
|
|
3
|
+
"version": "1.32.0-next.32+3ac912faf",
|
|
4
4
|
"description": "Theia - Task extension. This extension adds support for executing raw or terminal processes in the backend.",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@theia/core": "1.32.0-next.
|
|
7
|
-
"@theia/editor": "1.32.0-next.
|
|
8
|
-
"@theia/filesystem": "1.32.0-next.
|
|
9
|
-
"@theia/markers": "1.32.0-next.
|
|
10
|
-
"@theia/monaco": "1.32.0-next.
|
|
11
|
-
"@theia/monaco-editor-core": "1.
|
|
12
|
-
"@theia/process": "1.32.0-next.
|
|
13
|
-
"@theia/terminal": "1.32.0-next.
|
|
14
|
-
"@theia/userstorage": "1.32.0-next.
|
|
15
|
-
"@theia/variable-resolver": "1.32.0-next.
|
|
16
|
-
"@theia/workspace": "1.32.0-next.
|
|
6
|
+
"@theia/core": "1.32.0-next.32+3ac912faf",
|
|
7
|
+
"@theia/editor": "1.32.0-next.32+3ac912faf",
|
|
8
|
+
"@theia/filesystem": "1.32.0-next.32+3ac912faf",
|
|
9
|
+
"@theia/markers": "1.32.0-next.32+3ac912faf",
|
|
10
|
+
"@theia/monaco": "1.32.0-next.32+3ac912faf",
|
|
11
|
+
"@theia/monaco-editor-core": "1.72.3",
|
|
12
|
+
"@theia/process": "1.32.0-next.32+3ac912faf",
|
|
13
|
+
"@theia/terminal": "1.32.0-next.32+3ac912faf",
|
|
14
|
+
"@theia/userstorage": "1.32.0-next.32+3ac912faf",
|
|
15
|
+
"@theia/variable-resolver": "1.32.0-next.32+3ac912faf",
|
|
16
|
+
"@theia/workspace": "1.32.0-next.32+3ac912faf",
|
|
17
17
|
"async-mutex": "^0.3.1",
|
|
18
18
|
"jsonc-parser": "^2.2.0",
|
|
19
19
|
"p-debounce": "^2.1.0"
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"nyc": {
|
|
58
58
|
"extends": "../../configs/nyc.json"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "3ac912faf25c298c4af4578311562d23dde257c0"
|
|
61
61
|
}
|
|
@@ -328,7 +328,7 @@ export class TaskConfigurations implements Disposable {
|
|
|
328
328
|
console.error('Detected / Contributed tasks should have a task definition.');
|
|
329
329
|
return;
|
|
330
330
|
}
|
|
331
|
-
const customization: TaskCustomization = { type: task.type };
|
|
331
|
+
const customization: TaskCustomization = { type: task.type, runOptions: task.runOptions };
|
|
332
332
|
definition.properties.all.forEach(p => {
|
|
333
333
|
if (task[p] !== undefined) {
|
|
334
334
|
customization[p] = task[p];
|
|
@@ -87,13 +87,18 @@ export interface TaskEndedInfo {
|
|
|
87
87
|
value: number | boolean | undefined
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
+
export interface LastRunTaskInfo {
|
|
91
|
+
resolvedTask?: TaskConfiguration;
|
|
92
|
+
option?: RunTaskOption
|
|
93
|
+
}
|
|
94
|
+
|
|
90
95
|
@injectable()
|
|
91
96
|
export class TaskService implements TaskConfigurationClient {
|
|
92
97
|
|
|
93
98
|
/**
|
|
94
99
|
* The last executed task.
|
|
95
100
|
*/
|
|
96
|
-
protected lastTask:
|
|
101
|
+
protected lastTask: LastRunTaskInfo = {resolvedTask: undefined, option: undefined};
|
|
97
102
|
protected cachedRecentTasks: TaskConfiguration[] = [];
|
|
98
103
|
protected runningTasks = new Map<number, {
|
|
99
104
|
exitCode: Deferred<number | undefined>,
|
|
@@ -470,7 +475,7 @@ export class TaskService implements TaskConfigurationClient {
|
|
|
470
475
|
*
|
|
471
476
|
* @returns the last executed task or `undefined`.
|
|
472
477
|
*/
|
|
473
|
-
getLastTask():
|
|
478
|
+
getLastTask(): LastRunTaskInfo {
|
|
474
479
|
return this.lastTask;
|
|
475
480
|
}
|
|
476
481
|
|
|
@@ -496,11 +501,14 @@ export class TaskService implements TaskConfigurationClient {
|
|
|
496
501
|
* @param token The cache token for the user interaction in progress
|
|
497
502
|
*/
|
|
498
503
|
async runLastTask(token: number): Promise<TaskInfo | undefined> {
|
|
499
|
-
if (!this.lastTask) {
|
|
504
|
+
if (!this.lastTask?.resolvedTask) {
|
|
500
505
|
return;
|
|
501
506
|
}
|
|
502
|
-
|
|
503
|
-
|
|
507
|
+
if (!this.lastTask.resolvedTask.runOptions?.reevaluateOnRerun) {
|
|
508
|
+
return this.runResolvedTask(this.lastTask.resolvedTask, this.lastTask.option);
|
|
509
|
+
}
|
|
510
|
+
const { _source, label, _scope } = this.lastTask.resolvedTask;
|
|
511
|
+
return this.run(token, _source, label, _scope);
|
|
504
512
|
}
|
|
505
513
|
|
|
506
514
|
/**
|
|
@@ -737,7 +745,7 @@ export class TaskService implements TaskConfigurationClient {
|
|
|
737
745
|
try {
|
|
738
746
|
// resolve problemMatchers
|
|
739
747
|
if (!option && task.problemMatcher) {
|
|
740
|
-
const customizationObject: TaskCustomization = { type: task.taskType, problemMatcher: task.problemMatcher };
|
|
748
|
+
const customizationObject: TaskCustomization = { type: task.taskType, problemMatcher: task.problemMatcher, runOptions: task.runOptions };
|
|
741
749
|
const resolvedMatchers = await this.resolveProblemMatchers(task, customizationObject);
|
|
742
750
|
option = {
|
|
743
751
|
customization: { ...customizationObject, ...{ problemMatcher: resolvedMatchers } }
|
|
@@ -949,7 +957,7 @@ export class TaskService implements TaskConfigurationClient {
|
|
|
949
957
|
}
|
|
950
958
|
|
|
951
959
|
protected async getTaskCustomization(task: TaskConfiguration): Promise<TaskCustomization> {
|
|
952
|
-
const customizationObject: TaskCustomization = { type: '', _scope: task._scope };
|
|
960
|
+
const customizationObject: TaskCustomization = { type: '', _scope: task._scope, runOptions: task.runOptions };
|
|
953
961
|
const customizationFound = this.taskConfigurations.getCustomizationForTask(task);
|
|
954
962
|
if (customizationFound) {
|
|
955
963
|
Object.assign(customizationObject, customizationFound);
|
|
@@ -982,12 +990,11 @@ export class TaskService implements TaskConfigurationClient {
|
|
|
982
990
|
* @param option options to run the resolved task
|
|
983
991
|
*/
|
|
984
992
|
protected async runResolvedTask(resolvedTask: TaskConfiguration, option?: RunTaskOption): Promise<TaskInfo | undefined> {
|
|
985
|
-
const source = resolvedTask._source;
|
|
986
993
|
const taskLabel = resolvedTask.label;
|
|
987
994
|
let taskInfo: TaskInfo | undefined;
|
|
988
995
|
try {
|
|
989
996
|
taskInfo = await this.taskServer.run(resolvedTask, this.getContext(), option);
|
|
990
|
-
this.lastTask = {
|
|
997
|
+
this.lastTask = {resolvedTask, option };
|
|
991
998
|
this.logger.debug(`Task created. Task id: ${taskInfo.taskId}`);
|
|
992
999
|
|
|
993
1000
|
/**
|
|
@@ -25,7 +25,6 @@ import { Severity } from '@theia/core/lib/common/severity';
|
|
|
25
25
|
import { Diagnostic } from '@theia/core/shared/vscode-languageserver-protocol';
|
|
26
26
|
// TODO use URI from `@theia/core` instead
|
|
27
27
|
import { URI } from '@theia/core/shared/vscode-uri';
|
|
28
|
-
import { ProblemPatternContribution, WatchingMatcherContribution } from './task-protocol';
|
|
29
28
|
|
|
30
29
|
export enum ApplyToKind {
|
|
31
30
|
allDocuments,
|
|
@@ -191,3 +190,46 @@ export namespace ProblemMatchData {
|
|
|
191
190
|
return 'marker' in data;
|
|
192
191
|
}
|
|
193
192
|
}
|
|
193
|
+
|
|
194
|
+
export interface WatchingMatcherContribution {
|
|
195
|
+
// If set to true the background monitor is in active mode when the task starts.
|
|
196
|
+
// This is equals of issuing a line that matches the beginPattern
|
|
197
|
+
activeOnStart?: boolean;
|
|
198
|
+
beginsPattern: string | WatchingPattern;
|
|
199
|
+
endsPattern: string | WatchingPattern;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export interface ProblemMatcherContribution {
|
|
203
|
+
base?: string;
|
|
204
|
+
name?: string;
|
|
205
|
+
label: string;
|
|
206
|
+
deprecated?: boolean;
|
|
207
|
+
|
|
208
|
+
owner: string;
|
|
209
|
+
source?: string;
|
|
210
|
+
applyTo?: string;
|
|
211
|
+
fileLocation?: 'absolute' | 'relative' | string[];
|
|
212
|
+
pattern: string | ProblemPatternContribution | ProblemPatternContribution[];
|
|
213
|
+
severity?: string;
|
|
214
|
+
watching?: WatchingMatcherContribution; // deprecated. Use `background`.
|
|
215
|
+
background?: WatchingMatcherContribution;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
export interface ProblemPatternContribution {
|
|
219
|
+
name?: string;
|
|
220
|
+
regexp: string;
|
|
221
|
+
|
|
222
|
+
kind?: string;
|
|
223
|
+
file?: number;
|
|
224
|
+
message?: number;
|
|
225
|
+
location?: number;
|
|
226
|
+
line?: number;
|
|
227
|
+
character?: number;
|
|
228
|
+
column?: number;
|
|
229
|
+
endLine?: number;
|
|
230
|
+
endCharacter?: number;
|
|
231
|
+
endColumn?: number;
|
|
232
|
+
code?: number;
|
|
233
|
+
severity?: number;
|
|
234
|
+
loop?: boolean;
|
|
235
|
+
}
|
|
@@ -14,9 +14,11 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
+
import { Event } from '@theia/core';
|
|
17
18
|
import { JsonRpcServer } from '@theia/core/lib/common/messaging/proxy-factory';
|
|
18
19
|
import { IJSONSchema } from '@theia/core/lib/common/json-schema';
|
|
19
|
-
import { ProblemMatcher, ProblemMatch,
|
|
20
|
+
import { ProblemMatcher, ProblemMatch, WatchingMatcherContribution, ProblemMatcherContribution, ProblemPatternContribution } from './problem-matcher-protocol';
|
|
21
|
+
export { WatchingMatcherContribution, ProblemMatcherContribution, ProblemPatternContribution };
|
|
20
22
|
|
|
21
23
|
export const taskPath = '/services/task';
|
|
22
24
|
|
|
@@ -127,6 +129,8 @@ export interface TaskCustomization {
|
|
|
127
129
|
/** The order the dependsOn tasks should be executed in. */
|
|
128
130
|
dependsOrder?: DependsOrder;
|
|
129
131
|
|
|
132
|
+
runOptions?: RunOptions;
|
|
133
|
+
|
|
130
134
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
131
135
|
[name: string]: any;
|
|
132
136
|
}
|
|
@@ -228,6 +232,10 @@ export interface RunTaskOption {
|
|
|
228
232
|
customization?: TaskCustomizationData;
|
|
229
233
|
}
|
|
230
234
|
|
|
235
|
+
export interface RunOptions {
|
|
236
|
+
reevaluateOnRerun?: boolean;
|
|
237
|
+
}
|
|
238
|
+
|
|
231
239
|
/** Event sent when a task has concluded its execution */
|
|
232
240
|
export interface TaskExitedEvent {
|
|
233
241
|
readonly taskId: number;
|
|
@@ -284,45 +292,15 @@ export interface TaskDefinition {
|
|
|
284
292
|
}
|
|
285
293
|
}
|
|
286
294
|
|
|
287
|
-
export interface
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
activeOnStart?: boolean;
|
|
291
|
-
beginsPattern: string | WatchingPattern;
|
|
292
|
-
endsPattern: string | WatchingPattern;
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
export interface ProblemMatcherContribution {
|
|
296
|
-
base?: string;
|
|
297
|
-
name?: string;
|
|
298
|
-
label: string;
|
|
299
|
-
deprecated?: boolean;
|
|
300
|
-
|
|
301
|
-
owner: string;
|
|
302
|
-
source?: string;
|
|
303
|
-
applyTo?: string;
|
|
304
|
-
fileLocation?: 'absolute' | 'relative' | string[];
|
|
305
|
-
pattern: string | ProblemPatternContribution | ProblemPatternContribution[];
|
|
306
|
-
severity?: string;
|
|
307
|
-
watching?: WatchingMatcherContribution; // deprecated. Use `background`.
|
|
308
|
-
background?: WatchingMatcherContribution;
|
|
295
|
+
export interface ManagedTask {
|
|
296
|
+
id: number;
|
|
297
|
+
context?: string;
|
|
309
298
|
}
|
|
310
299
|
|
|
311
|
-
export interface
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
message?: number;
|
|
318
|
-
location?: number;
|
|
319
|
-
line?: number;
|
|
320
|
-
character?: number;
|
|
321
|
-
column?: number;
|
|
322
|
-
endLine?: number;
|
|
323
|
-
endCharacter?: number;
|
|
324
|
-
endColumn?: number;
|
|
325
|
-
code?: number;
|
|
326
|
-
severity?: number;
|
|
327
|
-
loop?: boolean;
|
|
300
|
+
export interface ManagedTaskManager<T extends ManagedTask> {
|
|
301
|
+
onDelete: Event<number>;
|
|
302
|
+
register(task: T, context?: string): number;
|
|
303
|
+
get(id: number): T | undefined;
|
|
304
|
+
getTasks(context?: string): T[] | undefined;
|
|
305
|
+
delete(task: T): void;
|
|
328
306
|
}
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
ShellQuotedString, ShellQuotingFunctions, BashQuotingFunctions, CmdQuotingFunctions, PowershellQuotingFunctions, createShellCommandLine, ShellQuoting,
|
|
34
34
|
} from '@theia/process/lib/common/shell-quoting';
|
|
35
35
|
import { TaskFactory } from './process-task';
|
|
36
|
-
import { TaskRunner } from '../task-runner';
|
|
36
|
+
import { TaskRunner } from '../task-runner-protocol';
|
|
37
37
|
import { Task } from '../task';
|
|
38
38
|
import { TaskConfiguration } from '../../common/task-protocol';
|
|
39
39
|
import { ProcessTaskError, CommandOptions } from '../../common/process/task-protocol';
|
package/src/node/task-manager.ts
CHANGED
|
@@ -17,6 +17,7 @@ import { inject, injectable, named } from '@theia/core/shared/inversify';
|
|
|
17
17
|
import { Emitter, Event, ILogger } from '@theia/core/lib/common';
|
|
18
18
|
import { BackendApplicationContribution } from '@theia/core/lib/node';
|
|
19
19
|
import { Task } from './task';
|
|
20
|
+
import { ManagedTaskManager } from '../common';
|
|
20
21
|
|
|
21
22
|
// inspired by process-manager.ts
|
|
22
23
|
|
|
@@ -24,7 +25,7 @@ import { Task } from './task';
|
|
|
24
25
|
* The {@link TaskManager} is the common component responsible for managing running tasks.
|
|
25
26
|
*/
|
|
26
27
|
@injectable()
|
|
27
|
-
export class TaskManager implements BackendApplicationContribution {
|
|
28
|
+
export class TaskManager implements BackendApplicationContribution, ManagedTaskManager<Task> {
|
|
28
29
|
|
|
29
30
|
/** contains all running tasks */
|
|
30
31
|
protected readonly tasks: Map<number, Task> = new Map();
|
|
@@ -104,7 +105,9 @@ export class TaskManager implements BackendApplicationContribution {
|
|
|
104
105
|
const tasksForWS = this.tasksPerCtx.get(ctx);
|
|
105
106
|
if (tasksForWS !== undefined) {
|
|
106
107
|
const idx = tasksForWS.indexOf(task);
|
|
107
|
-
|
|
108
|
+
if (idx !== -1) {
|
|
109
|
+
tasksForWS.splice(idx, 1);
|
|
110
|
+
}
|
|
108
111
|
}
|
|
109
112
|
}
|
|
110
113
|
this.deleteEmitter.fire(task.id);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2022 Ericsson and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
import { TaskConfiguration } from '../common';
|
|
18
|
+
import { Task } from './task';
|
|
19
|
+
|
|
20
|
+
export const TaskRunner = Symbol('TaskRunner');
|
|
21
|
+
/**
|
|
22
|
+
* A {@link TaskRunner} knows how to run a task configuration of a particular type.
|
|
23
|
+
*/
|
|
24
|
+
export interface TaskRunner {
|
|
25
|
+
/**
|
|
26
|
+
* Runs a task based on the given `TaskConfiguration`.
|
|
27
|
+
* @param taskConfig the task configuration that should be executed.
|
|
28
|
+
* @param ctx the execution context.
|
|
29
|
+
*
|
|
30
|
+
* @returns a promise of the (currently running) {@link Task}.
|
|
31
|
+
*/
|
|
32
|
+
run(tskConfig: TaskConfiguration, ctx?: string): Promise<Task>;
|
|
33
|
+
}
|
package/src/node/task-runner.ts
CHANGED
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
import { injectable, inject, postConstruct } from '@theia/core/shared/inversify';
|
|
18
18
|
import { Disposable } from '@theia/core/lib/common/disposable';
|
|
19
19
|
import { ProcessTaskRunner } from './process/process-task-runner';
|
|
20
|
-
import {
|
|
21
|
-
|
|
20
|
+
import { TaskRunner } from './task-runner-protocol';
|
|
21
|
+
export { TaskRunner };
|
|
22
22
|
|
|
23
23
|
export const TaskRunnerContribution = Symbol('TaskRunnerContribution');
|
|
24
24
|
|
|
@@ -31,21 +31,6 @@ export interface TaskRunnerContribution {
|
|
|
31
31
|
registerRunner(runners: TaskRunnerRegistry): void;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
export const TaskRunner = Symbol('TaskRunner');
|
|
35
|
-
/**
|
|
36
|
-
* A {@link TaskRunner} knows how to run a task configuration of a particular type.
|
|
37
|
-
*/
|
|
38
|
-
export interface TaskRunner {
|
|
39
|
-
/**
|
|
40
|
-
* Runs a task based on the given `TaskConfiguration`.
|
|
41
|
-
* @param taskConfig the task configuration that should be executed.
|
|
42
|
-
* @param ctx the execution context.
|
|
43
|
-
*
|
|
44
|
-
* @returns a promise of the (currently running) {@link Task}.
|
|
45
|
-
*/
|
|
46
|
-
run(tskConfig: TaskConfiguration, ctx?: string): Promise<Task>;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
34
|
/**
|
|
50
35
|
* The {@link TaskRunnerRegistry} is the common component for the registration and provisioning of
|
|
51
36
|
* {@link TaskRunner}s. Theia will collect all {@link TaskRunner}s and invoke {@link TaskRunnerContribution#registerRunner}
|
package/src/node/task.ts
CHANGED
|
@@ -16,8 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
import { injectable } from '@theia/core/shared/inversify';
|
|
18
18
|
import { ILogger, Disposable, DisposableCollection, Emitter, Event, MaybePromise } from '@theia/core/lib/common/';
|
|
19
|
-
import {
|
|
20
|
-
import { TaskInfo, TaskExitedEvent, TaskConfiguration, TaskOutputEvent } from '../common/task-protocol';
|
|
19
|
+
import { TaskInfo, TaskExitedEvent, TaskConfiguration, TaskOutputEvent, ManagedTask, ManagedTaskManager } from '../common/task-protocol';
|
|
21
20
|
/**
|
|
22
21
|
* Represents the options used for running a task.
|
|
23
22
|
*/
|
|
@@ -36,7 +35,7 @@ export interface TaskOptions {
|
|
|
36
35
|
* whenever a new output occurs during the execution.
|
|
37
36
|
*/
|
|
38
37
|
@injectable()
|
|
39
|
-
export abstract class Task implements Disposable {
|
|
38
|
+
export abstract class Task implements Disposable, ManagedTask {
|
|
40
39
|
|
|
41
40
|
protected taskId: number;
|
|
42
41
|
protected readonly toDispose: DisposableCollection = new DisposableCollection();
|
|
@@ -44,7 +43,7 @@ export abstract class Task implements Disposable {
|
|
|
44
43
|
readonly outputEmitter: Emitter<TaskOutputEvent>;
|
|
45
44
|
|
|
46
45
|
constructor(
|
|
47
|
-
protected readonly taskManager:
|
|
46
|
+
protected readonly taskManager: ManagedTaskManager<Task>,
|
|
48
47
|
protected readonly logger: ILogger,
|
|
49
48
|
protected readonly options: TaskOptions
|
|
50
49
|
) {
|