@theia/task 1.67.0-next.13 → 1.67.0-next.56
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/README.md +1 -1
- package/package.json +12 -12
- package/lib/browser/index.d.ts +0 -7
- package/lib/browser/index.d.ts.map +0 -1
- package/lib/browser/index.js +0 -25
- package/lib/browser/index.js.map +0 -1
- package/lib/browser/process/process-task-contribution.d.ts +0 -7
- package/lib/browser/process/process-task-contribution.d.ts.map +0 -1
- package/lib/browser/process/process-task-contribution.js +0 -36
- package/lib/browser/process/process-task-contribution.js.map +0 -1
- package/lib/browser/process/process-task-frontend-module.d.ts +0 -3
- package/lib/browser/process/process-task-frontend-module.d.ts.map +0 -1
- package/lib/browser/process/process-task-frontend-module.js +0 -28
- package/lib/browser/process/process-task-frontend-module.js.map +0 -1
- package/lib/browser/process/process-task-resolver.d.ts +0 -18
- package/lib/browser/process/process-task-resolver.d.ts.map +0 -1
- package/lib/browser/process/process-task-resolver.js +0 -94
- package/lib/browser/process/process-task-resolver.js.map +0 -1
- package/lib/browser/provided-task-configurations.d.ts +0 -44
- package/lib/browser/provided-task-configurations.d.ts.map +0 -1
- package/lib/browser/provided-task-configurations.js +0 -206
- package/lib/browser/provided-task-configurations.js.map +0 -1
- package/lib/browser/provided-task-configurations.spec.d.ts +0 -2
- package/lib/browser/provided-task-configurations.spec.d.ts.map +0 -1
- package/lib/browser/provided-task-configurations.spec.js +0 -44
- package/lib/browser/provided-task-configurations.spec.js.map +0 -1
- package/lib/browser/quick-open-task.d.ts +0 -146
- package/lib/browser/quick-open-task.d.ts.map +0 -1
- package/lib/browser/quick-open-task.js +0 -757
- package/lib/browser/quick-open-task.js.map +0 -1
- package/lib/browser/task-configuration-manager.d.ts +0 -63
- package/lib/browser/task-configuration-manager.d.ts.map +0 -1
- package/lib/browser/task-configuration-manager.js +0 -243
- package/lib/browser/task-configuration-manager.js.map +0 -1
- package/lib/browser/task-configuration-model.d.ts +0 -34
- package/lib/browser/task-configuration-model.d.ts.map +0 -1
- package/lib/browser/task-configuration-model.js +0 -83
- package/lib/browser/task-configuration-model.js.map +0 -1
- package/lib/browser/task-configurations.d.ts +0 -128
- package/lib/browser/task-configurations.d.ts.map +0 -1
- package/lib/browser/task-configurations.js +0 -479
- package/lib/browser/task-configurations.js.map +0 -1
- package/lib/browser/task-context-key-service.d.ts +0 -18
- package/lib/browser/task-context-key-service.d.ts.map +0 -1
- package/lib/browser/task-context-key-service.js +0 -72
- package/lib/browser/task-context-key-service.js.map +0 -1
- package/lib/browser/task-contribution.d.ts +0 -183
- package/lib/browser/task-contribution.d.ts.map +0 -1
- package/lib/browser/task-contribution.js +0 -199
- package/lib/browser/task-contribution.js.map +0 -1
- package/lib/browser/task-definition-registry.d.ts +0 -39
- package/lib/browser/task-definition-registry.d.ts.map +0 -1
- package/lib/browser/task-definition-registry.js +0 -130
- package/lib/browser/task-definition-registry.js.map +0 -1
- package/lib/browser/task-definition-registry.spec.d.ts +0 -2
- package/lib/browser/task-definition-registry.spec.d.ts.map +0 -1
- package/lib/browser/task-definition-registry.spec.js +0 -171
- package/lib/browser/task-definition-registry.spec.js.map +0 -1
- package/lib/browser/task-frontend-contribution.d.ts +0 -57
- package/lib/browser/task-frontend-contribution.d.ts.map +0 -1
- package/lib/browser/task-frontend-contribution.js +0 -351
- package/lib/browser/task-frontend-contribution.js.map +0 -1
- package/lib/browser/task-frontend-module.d.ts +0 -6
- package/lib/browser/task-frontend-module.d.ts.map +0 -1
- package/lib/browser/task-frontend-module.js +0 -82
- package/lib/browser/task-frontend-module.js.map +0 -1
- package/lib/browser/task-name-resolver.d.ts +0 -14
- package/lib/browser/task-name-resolver.d.ts.map +0 -1
- package/lib/browser/task-name-resolver.js +0 -60
- package/lib/browser/task-name-resolver.js.map +0 -1
- package/lib/browser/task-node.d.ts +0 -10
- package/lib/browser/task-node.d.ts.map +0 -1
- package/lib/browser/task-node.js +0 -18
- package/lib/browser/task-node.js.map +0 -1
- package/lib/browser/task-problem-matcher-registry.d.ts +0 -41
- package/lib/browser/task-problem-matcher-registry.d.ts.map +0 -1
- package/lib/browser/task-problem-matcher-registry.js +0 -302
- package/lib/browser/task-problem-matcher-registry.js.map +0 -1
- package/lib/browser/task-problem-pattern-registry.d.ts +0 -24
- package/lib/browser/task-problem-pattern-registry.d.ts.map +0 -1
- package/lib/browser/task-problem-pattern-registry.js +0 -203
- package/lib/browser/task-problem-pattern-registry.js.map +0 -1
- package/lib/browser/task-schema-updater.d.ts +0 -58
- package/lib/browser/task-schema-updater.d.ts.map +0 -1
- package/lib/browser/task-schema-updater.js +0 -676
- package/lib/browser/task-schema-updater.js.map +0 -1
- package/lib/browser/task-service.d.ts +0 -282
- package/lib/browser/task-service.d.ts.map +0 -1
- package/lib/browser/task-service.js +0 -1116
- package/lib/browser/task-service.js.map +0 -1
- package/lib/browser/task-source-resolver.d.ts +0 -10
- package/lib/browser/task-source-resolver.d.ts.map +0 -1
- package/lib/browser/task-source-resolver.js +0 -44
- package/lib/browser/task-source-resolver.js.map +0 -1
- package/lib/browser/task-templates.d.ts +0 -14
- package/lib/browser/task-templates.d.ts.map +0 -1
- package/lib/browser/task-templates.js +0 -158
- package/lib/browser/task-templates.js.map +0 -1
- package/lib/browser/task-terminal-widget-manager.d.ts +0 -45
- package/lib/browser/task-terminal-widget-manager.d.ts.map +0 -1
- package/lib/browser/task-terminal-widget-manager.js +0 -222
- package/lib/browser/task-terminal-widget-manager.js.map +0 -1
- package/lib/browser/tasks-monaco-contribution.d.ts +0 -2
- package/lib/browser/tasks-monaco-contribution.d.ts.map +0 -1
- package/lib/browser/tasks-monaco-contribution.js +0 -28
- package/lib/browser/tasks-monaco-contribution.js.map +0 -1
- package/lib/common/index.d.ts +0 -5
- package/lib/common/index.d.ts.map +0 -1
- package/lib/common/index.js +0 -23
- package/lib/common/index.js.map +0 -1
- package/lib/common/problem-matcher-protocol.d.ts +0 -125
- package/lib/common/problem-matcher-protocol.d.ts.map +0 -1
- package/lib/common/problem-matcher-protocol.js +0 -133
- package/lib/common/problem-matcher-protocol.js.map +0 -1
- package/lib/common/process/task-protocol.d.ts +0 -69
- package/lib/common/process/task-protocol.d.ts.map +0 -1
- package/lib/common/process/task-protocol.js +0 -34
- package/lib/common/process/task-protocol.js.map +0 -1
- package/lib/common/task-common-module.d.ts +0 -8
- package/lib/common/task-common-module.d.ts.map +0 -1
- package/lib/common/task-common-module.js +0 -29
- package/lib/common/task-common-module.js.map +0 -1
- package/lib/common/task-preferences.d.ts +0 -6
- package/lib/common/task-preferences.d.ts.map +0 -1
- package/lib/common/task-preferences.js +0 -41
- package/lib/common/task-preferences.js.map +0 -1
- package/lib/common/task-protocol.d.ts +0 -194
- package/lib/common/task-protocol.d.ts.map +0 -1
- package/lib/common/task-protocol.js +0 -138
- package/lib/common/task-protocol.js.map +0 -1
- package/lib/common/task-util.d.ts +0 -23
- package/lib/common/task-util.d.ts.map +0 -1
- package/lib/common/task-util.js +0 -47
- package/lib/common/task-util.js.map +0 -1
- package/lib/common/task-watcher.d.ts +0 -18
- package/lib/common/task-watcher.d.ts.map +0 -1
- package/lib/common/task-watcher.js +0 -82
- package/lib/common/task-watcher.js.map +0 -1
- package/lib/node/custom/custom-task-runner-backend-module.d.ts +0 -3
- package/lib/node/custom/custom-task-runner-backend-module.d.ts.map +0 -1
- package/lib/node/custom/custom-task-runner-backend-module.js +0 -37
- package/lib/node/custom/custom-task-runner-backend-module.js.map +0 -1
- package/lib/node/custom/custom-task-runner-contribution.d.ts +0 -7
- package/lib/node/custom/custom-task-runner-contribution.d.ts.map +0 -1
- package/lib/node/custom/custom-task-runner-contribution.js +0 -35
- package/lib/node/custom/custom-task-runner-contribution.js.map +0 -1
- package/lib/node/custom/custom-task-runner.d.ts +0 -16
- package/lib/node/custom/custom-task-runner.d.ts.map +0 -1
- package/lib/node/custom/custom-task-runner.js +0 -62
- package/lib/node/custom/custom-task-runner.js.map +0 -1
- package/lib/node/custom/custom-task.d.ts +0 -21
- package/lib/node/custom/custom-task.d.ts.map +0 -1
- package/lib/node/custom/custom-task.js +0 -68
- package/lib/node/custom/custom-task.js.map +0 -1
- package/lib/node/index.d.ts +0 -4
- package/lib/node/index.d.ts.map +0 -1
- package/lib/node/index.js +0 -22
- package/lib/node/index.js.map +0 -1
- package/lib/node/process/process-task-runner-backend-module.d.ts +0 -3
- package/lib/node/process/process-task-runner-backend-module.d.ts.map +0 -1
- package/lib/node/process/process-task-runner-backend-module.js +0 -37
- package/lib/node/process/process-task-runner-backend-module.js.map +0 -1
- package/lib/node/process/process-task-runner-contribution.d.ts +0 -7
- package/lib/node/process/process-task-runner-contribution.d.ts.map +0 -1
- package/lib/node/process/process-task-runner-contribution.js +0 -36
- package/lib/node/process/process-task-runner-contribution.js.map +0 -1
- package/lib/node/process/process-task-runner.d.ts +0 -61
- package/lib/node/process/process-task-runner.d.ts.map +0 -1
- package/lib/node/process/process-task-runner.js +0 -348
- package/lib/node/process/process-task-runner.js.map +0 -1
- package/lib/node/process/process-task.d.ts +0 -27
- package/lib/node/process/process-task.d.ts.map +0 -1
- package/lib/node/process/process-task.js +0 -125
- package/lib/node/process/process-task.js.map +0 -1
- package/lib/node/process/process-task.spec.d.ts +0 -2
- package/lib/node/process/process-task.spec.d.ts.map +0 -1
- package/lib/node/process/process-task.spec.js +0 -30
- package/lib/node/process/process-task.spec.js.map +0 -1
- package/lib/node/task-abstract-line-matcher.d.ts +0 -50
- package/lib/node/task-abstract-line-matcher.d.ts.map +0 -1
- package/lib/node/task-abstract-line-matcher.js +0 -274
- package/lib/node/task-abstract-line-matcher.js.map +0 -1
- package/lib/node/task-backend-application-contribution.d.ts +0 -9
- package/lib/node/task-backend-application-contribution.d.ts.map +0 -1
- package/lib/node/task-backend-application-contribution.js +0 -41
- package/lib/node/task-backend-application-contribution.js.map +0 -1
- package/lib/node/task-backend-module.d.ts +0 -4
- package/lib/node/task-backend-module.d.ts.map +0 -1
- package/lib/node/task-backend-module.js +0 -53
- package/lib/node/task-backend-module.js.map +0 -1
- package/lib/node/task-line-matchers.d.ts +0 -28
- package/lib/node/task-line-matchers.d.ts.map +0 -1
- package/lib/node/task-line-matchers.js +0 -122
- package/lib/node/task-line-matchers.js.map +0 -1
- package/lib/node/task-manager.d.ts +0 -56
- package/lib/node/task-manager.d.ts.map +0 -1
- package/lib/node/task-manager.js +0 -125
- package/lib/node/task-manager.js.map +0 -1
- package/lib/node/task-problem-collector.d.ts +0 -11
- package/lib/node/task-problem-collector.d.ts.map +0 -1
- package/lib/node/task-problem-collector.js +0 -58
- package/lib/node/task-problem-collector.js.map +0 -1
- package/lib/node/task-problem-collector.spec.d.ts +0 -2
- package/lib/node/task-problem-collector.spec.d.ts.map +0 -1
- package/lib/node/task-problem-collector.spec.js +0 -311
- package/lib/node/task-problem-collector.spec.js.map +0 -1
- package/lib/node/task-runner-protocol.d.ts +0 -17
- package/lib/node/task-runner-protocol.d.ts.map +0 -1
- package/lib/node/task-runner-protocol.js +0 -20
- package/lib/node/task-runner-protocol.js.map +0 -1
- package/lib/node/task-runner.d.ts +0 -51
- package/lib/node/task-runner.d.ts.map +0 -1
- package/lib/node/task-runner.js +0 -90
- package/lib/node/task-runner.js.map +0 -1
- package/lib/node/task-server.d.ts +0 -40
- package/lib/node/task-server.d.ts.map +0 -1
- package/lib/node/task-server.js +0 -232
- package/lib/node/task-server.js.map +0 -1
- package/lib/node/task-server.slow-spec.d.ts +0 -2
- package/lib/node/task-server.slow-spec.d.ts.map +0 -1
- package/lib/node/task-server.slow-spec.js +0 -395
- package/lib/node/task-server.slow-spec.js.map +0 -1
- package/lib/node/task.d.ts +0 -51
- package/lib/node/task.d.ts.map +0 -1
- package/lib/node/task.js +0 -73
- package/lib/node/task.js.map +0 -1
- package/lib/node/test/task-test-container.d.ts +0 -3
- package/lib/node/test/task-test-container.d.ts.map +0 -1
- package/lib/node/test/task-test-container.js +0 -59
- package/lib/node/test/task-test-container.js.map +0 -1
|
@@ -1,348 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2017-2019 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-only WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.ProcessTaskRunner = void 0;
|
|
19
|
-
const tslib_1 = require("tslib");
|
|
20
|
-
/*---------------------------------------------------------------------------------------------
|
|
21
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
22
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
23
|
-
*--------------------------------------------------------------------------------------------*/
|
|
24
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
25
|
-
const core_1 = require("@theia/core");
|
|
26
|
-
const node_1 = require("@theia/core/lib/node");
|
|
27
|
-
const node_2 = require("@theia/process/lib/node");
|
|
28
|
-
const shell_quoting_1 = require("@theia/process/lib/common/shell-quoting");
|
|
29
|
-
const process_task_1 = require("./process-task");
|
|
30
|
-
const task_protocol_1 = require("../../common/process/task-protocol");
|
|
31
|
-
const fs = require("fs");
|
|
32
|
-
const shell_process_1 = require("@theia/terminal/lib/node/shell-process");
|
|
33
|
-
/**
|
|
34
|
-
* Task runner that runs a task as a process or a command inside a shell.
|
|
35
|
-
*/
|
|
36
|
-
let ProcessTaskRunner = class ProcessTaskRunner {
|
|
37
|
-
/**
|
|
38
|
-
* Runs a task from the given task configuration.
|
|
39
|
-
* @param taskConfig task configuration to run a task from. The provided task configuration must have a shape of `CommandProperties`.
|
|
40
|
-
*/
|
|
41
|
-
async run(taskConfig, ctx) {
|
|
42
|
-
if (!taskConfig.command) {
|
|
43
|
-
throw new Error("Process task config must have 'command' property specified");
|
|
44
|
-
}
|
|
45
|
-
try {
|
|
46
|
-
// Always spawn a task in a pty, the only difference between shell/process tasks is the
|
|
47
|
-
// way the command is passed:
|
|
48
|
-
// - process: directly look for an executable and pass a specific set of arguments/options.
|
|
49
|
-
// - shell: defer the spawning to a shell that will evaluate a command line with our executable.
|
|
50
|
-
const terminalProcessOptions = this.getResolvedCommand(taskConfig);
|
|
51
|
-
const terminal = this.taskTerminalProcessFactory(terminalProcessOptions);
|
|
52
|
-
// Wait for the confirmation that the process is successfully started, or has failed to start.
|
|
53
|
-
await new Promise((resolve, reject) => {
|
|
54
|
-
terminal.onStart(resolve);
|
|
55
|
-
terminal.onError((error) => {
|
|
56
|
-
reject(task_protocol_1.ProcessTaskError.CouldNotRun(error.code));
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
const processType = (taskConfig.executionType || taskConfig.type);
|
|
60
|
-
return this.taskFactory({
|
|
61
|
-
label: taskConfig.label,
|
|
62
|
-
process: terminal,
|
|
63
|
-
processType,
|
|
64
|
-
context: ctx,
|
|
65
|
-
config: taskConfig,
|
|
66
|
-
command: this.getCommand(processType, terminalProcessOptions)
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
catch (error) {
|
|
70
|
-
this.logger.error(`Error occurred while creating task: ${error}`);
|
|
71
|
-
throw error;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
getResolvedCommand(taskConfig) {
|
|
75
|
-
const osSpecificCommand = this.getOsSpecificCommand(taskConfig);
|
|
76
|
-
const options = osSpecificCommand.options;
|
|
77
|
-
// Use task's cwd with spawned process and pass node env object to
|
|
78
|
-
// new process, so e.g. we can re-use the system path
|
|
79
|
-
if (options) {
|
|
80
|
-
options.env = {
|
|
81
|
-
...process.env,
|
|
82
|
-
...(options.env || {})
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
/** Executable to actually spawn. */
|
|
86
|
-
let command;
|
|
87
|
-
/** List of arguments passed to `command`. */
|
|
88
|
-
let args;
|
|
89
|
-
/**
|
|
90
|
-
* Only useful on Windows, has to do with how node-pty handles complex commands.
|
|
91
|
-
* This string should not include the executable, only what comes after it (arguments).
|
|
92
|
-
*/
|
|
93
|
-
let commandLine;
|
|
94
|
-
if ((taskConfig.executionType || taskConfig.type) === 'shell') {
|
|
95
|
-
// When running a shell task, we have to spawn a shell process somehow,
|
|
96
|
-
// and tell it to run the command the user wants to run inside of it.
|
|
97
|
-
//
|
|
98
|
-
// E.g:
|
|
99
|
-
// - Spawning a process:
|
|
100
|
-
// spawn(process_exe, [...args])
|
|
101
|
-
// - Spawning a shell and run a command:
|
|
102
|
-
// spawn(shell_exe, [shell_exec_cmd_flag, command])
|
|
103
|
-
//
|
|
104
|
-
// The fun part is, the `command` to pass as an argument usually has to be
|
|
105
|
-
// what you would type verbatim inside the shell, so escaping rules apply.
|
|
106
|
-
//
|
|
107
|
-
// What's even more funny is that on Windows, node-pty uses a special
|
|
108
|
-
// mechanism to pass complex escaped arguments, via a string.
|
|
109
|
-
//
|
|
110
|
-
// We need to accommodate most shells, so we need to get specific.
|
|
111
|
-
const { shell } = osSpecificCommand.options;
|
|
112
|
-
command = (shell === null || shell === void 0 ? void 0 : shell.executable) || shell_process_1.ShellProcess.getShellExecutablePath();
|
|
113
|
-
const { execArgs, quotingFunctions } = this.getShellSpecificOptions(command);
|
|
114
|
-
// Allow overriding shell options from task configuration.
|
|
115
|
-
args = (shell === null || shell === void 0 ? void 0 : shell.args) ? [...shell.args] : [...execArgs];
|
|
116
|
-
// Check if an argument list is defined or not. Empty is ok.
|
|
117
|
-
/** Shell command to run: */
|
|
118
|
-
const shellCommand = this.buildShellCommand(osSpecificCommand, quotingFunctions);
|
|
119
|
-
if (core_1.isWindows && /cmd(.exe)?$/.test(command)) {
|
|
120
|
-
// Let's take the following command, including an argument containing whitespace:
|
|
121
|
-
// cmd> node -p process.argv 1 2 " 3"
|
|
122
|
-
//
|
|
123
|
-
// We would expect the following output:
|
|
124
|
-
// json> [ '...\\node.exe', '1', '2', ' 3' ]
|
|
125
|
-
//
|
|
126
|
-
// Let's run this command through `cmd.exe` using `child_process`:
|
|
127
|
-
// js> void childprocess.spawn('cmd.exe', ['/s', '/c', 'node -p process.argv 1 2 " 3"']).stderr.on('data', console.log)
|
|
128
|
-
//
|
|
129
|
-
// We get the correct output, but when using node-pty:
|
|
130
|
-
// js> void nodepty.spawn('cmd.exe', ['/s', '/c', 'node -p process.argv 1 2 " 3"']).on('data', console.log)
|
|
131
|
-
//
|
|
132
|
-
// Then the output looks like:
|
|
133
|
-
// json> [ '...\\node.exe', '1', '2', '"', '3"' ]
|
|
134
|
-
//
|
|
135
|
-
// To fix that, we need to use a special node-pty feature and pass arguments as one string:
|
|
136
|
-
// js> nodepty.spawn('cmd.exe', '/s /c "node -p process.argv 1 2 " 3""')
|
|
137
|
-
//
|
|
138
|
-
// Note the extra quotes that need to be added around the whole command.
|
|
139
|
-
commandLine = [...args, `"${shellCommand}"`].join(' ');
|
|
140
|
-
}
|
|
141
|
-
args.push(shellCommand);
|
|
142
|
-
}
|
|
143
|
-
else {
|
|
144
|
-
// When running process tasks, `command` is the executable to run,
|
|
145
|
-
// and `args` are the arguments we want to pass to it.
|
|
146
|
-
command = osSpecificCommand.command;
|
|
147
|
-
if (Array.isArray(osSpecificCommand.args)) {
|
|
148
|
-
// Process task doesn't handle quotation: Normalize arguments from `ShellQuotedString` to raw `string`.
|
|
149
|
-
args = osSpecificCommand.args.map(arg => typeof arg === 'string' ? arg : arg.value);
|
|
150
|
-
}
|
|
151
|
-
else {
|
|
152
|
-
args = [];
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
return { command, args, commandLine, options };
|
|
156
|
-
}
|
|
157
|
-
buildShellCommand(systemSpecificCommand, quotingFunctions) {
|
|
158
|
-
var _a;
|
|
159
|
-
if (Array.isArray(systemSpecificCommand.args)) {
|
|
160
|
-
const commandLineElements = [systemSpecificCommand.command, ...systemSpecificCommand.args].map(arg => {
|
|
161
|
-
// We want to quote arguments only if needed.
|
|
162
|
-
if (quotingFunctions && typeof arg === 'string' && this.argumentNeedsQuotes(arg, quotingFunctions)) {
|
|
163
|
-
return {
|
|
164
|
-
quoting: "strong" /* ShellQuoting.Strong */,
|
|
165
|
-
value: arg,
|
|
166
|
-
};
|
|
167
|
-
}
|
|
168
|
-
else {
|
|
169
|
-
return arg;
|
|
170
|
-
}
|
|
171
|
-
});
|
|
172
|
-
return (0, shell_quoting_1.createShellCommandLine)(commandLineElements, quotingFunctions);
|
|
173
|
-
}
|
|
174
|
-
else {
|
|
175
|
-
// No arguments are provided, so `command` is actually the full command line to execute.
|
|
176
|
-
return (_a = systemSpecificCommand.command) !== null && _a !== void 0 ? _a : '';
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
getShellSpecificOptions(command) {
|
|
180
|
-
if (/bash(.exe)?$/.test(command)) {
|
|
181
|
-
return {
|
|
182
|
-
quotingFunctions: shell_quoting_1.BashQuotingFunctions,
|
|
183
|
-
execArgs: ['-c']
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
else if (/wsl(.exe)?$/.test(command)) {
|
|
187
|
-
return {
|
|
188
|
-
quotingFunctions: shell_quoting_1.BashQuotingFunctions,
|
|
189
|
-
execArgs: ['-e']
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
|
-
else if (/cmd(.exe)?$/.test(command)) {
|
|
193
|
-
return {
|
|
194
|
-
quotingFunctions: shell_quoting_1.CmdQuotingFunctions,
|
|
195
|
-
execArgs: ['/S', '/C']
|
|
196
|
-
};
|
|
197
|
-
}
|
|
198
|
-
else if (/(ps|pwsh|powershell)(.exe)?/.test(command)) {
|
|
199
|
-
return {
|
|
200
|
-
quotingFunctions: shell_quoting_1.PowershellQuotingFunctions,
|
|
201
|
-
execArgs: ['-c']
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
else {
|
|
205
|
-
return {
|
|
206
|
-
quotingFunctions: shell_quoting_1.BashQuotingFunctions,
|
|
207
|
-
execArgs: ['-l', '-c']
|
|
208
|
-
};
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
getOsSpecificCommand(taskConfig) {
|
|
212
|
-
// on windows, windows-specific options, if available, take precedence
|
|
213
|
-
if (core_1.isWindows && taskConfig.windows !== undefined) {
|
|
214
|
-
return this.getSystemSpecificCommand(taskConfig, 'windows');
|
|
215
|
-
}
|
|
216
|
-
else if (core_1.isOSX && taskConfig.osx !== undefined) { // on macOS, mac-specific options, if available, take precedence
|
|
217
|
-
return this.getSystemSpecificCommand(taskConfig, 'osx');
|
|
218
|
-
}
|
|
219
|
-
else if (!core_1.isWindows && !core_1.isOSX && taskConfig.linux !== undefined) { // on linux, linux-specific options, if available, take precedence
|
|
220
|
-
return this.getSystemSpecificCommand(taskConfig, 'linux');
|
|
221
|
-
}
|
|
222
|
-
else { // system-specific options are unavailable, use the default
|
|
223
|
-
return this.getSystemSpecificCommand(taskConfig, undefined);
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
getCommand(processType, terminalProcessOptions) {
|
|
227
|
-
if (terminalProcessOptions.args) {
|
|
228
|
-
if (processType === 'shell') {
|
|
229
|
-
return terminalProcessOptions.args[terminalProcessOptions.args.length - 1];
|
|
230
|
-
}
|
|
231
|
-
else if (processType === 'process') {
|
|
232
|
-
return `${terminalProcessOptions.command} ${terminalProcessOptions.args.join(' ')}`;
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
/**
|
|
237
|
-
* This is task specific, to align with VS Code's behavior.
|
|
238
|
-
*
|
|
239
|
-
* When parsing arguments, VS Code will try to detect if the user already
|
|
240
|
-
* tried to quote things.
|
|
241
|
-
*
|
|
242
|
-
* See: https://github.com/microsoft/vscode/blob/d363b988e1e58cf49963841c498681cdc6cb55a3/src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts#L1101-L1127
|
|
243
|
-
*
|
|
244
|
-
* @param value
|
|
245
|
-
* @param shellQuotingOptions
|
|
246
|
-
*/
|
|
247
|
-
argumentNeedsQuotes(value, shellQuotingOptions) {
|
|
248
|
-
const { characters } = shellQuotingOptions;
|
|
249
|
-
const needQuotes = new Set([' ', ...characters.needQuotes || []]);
|
|
250
|
-
if (!characters) {
|
|
251
|
-
return false;
|
|
252
|
-
}
|
|
253
|
-
if (value.length >= 2) {
|
|
254
|
-
const first = value[0] === characters.strong ? characters.strong : value[0] === characters.weak ? characters.weak : undefined;
|
|
255
|
-
if (first === value[value.length - 1]) {
|
|
256
|
-
return false;
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
let quote;
|
|
260
|
-
for (let i = 0; i < value.length; i++) {
|
|
261
|
-
// We found the end quote.
|
|
262
|
-
const ch = value[i];
|
|
263
|
-
if (ch === quote) {
|
|
264
|
-
quote = undefined;
|
|
265
|
-
}
|
|
266
|
-
else if (quote !== undefined) {
|
|
267
|
-
// skip the character. We are quoted.
|
|
268
|
-
continue;
|
|
269
|
-
}
|
|
270
|
-
else if (ch === characters.escape) {
|
|
271
|
-
// Skip the next character
|
|
272
|
-
i++;
|
|
273
|
-
}
|
|
274
|
-
else if (ch === characters.strong || ch === characters.weak) {
|
|
275
|
-
quote = ch;
|
|
276
|
-
}
|
|
277
|
-
else if (needQuotes.has(ch)) {
|
|
278
|
-
return true;
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
return false;
|
|
282
|
-
}
|
|
283
|
-
getSystemSpecificCommand(taskConfig, system) {
|
|
284
|
-
// initialize with default values from the `taskConfig`
|
|
285
|
-
let command = taskConfig.command;
|
|
286
|
-
let args = taskConfig.args;
|
|
287
|
-
let options = (0, core_1.deepClone)(taskConfig.options) || {};
|
|
288
|
-
if (system) {
|
|
289
|
-
if (taskConfig[system].command) {
|
|
290
|
-
command = taskConfig[system].command;
|
|
291
|
-
}
|
|
292
|
-
if (taskConfig[system].args) {
|
|
293
|
-
args = taskConfig[system].args;
|
|
294
|
-
}
|
|
295
|
-
if (taskConfig[system].options) {
|
|
296
|
-
options = taskConfig[system].options;
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
if (options.cwd) {
|
|
300
|
-
options.cwd = this.asFsPath(options.cwd);
|
|
301
|
-
}
|
|
302
|
-
if (command === undefined) {
|
|
303
|
-
throw new Error('The `command` field of a task cannot be undefined.');
|
|
304
|
-
}
|
|
305
|
-
return { command, args, options };
|
|
306
|
-
}
|
|
307
|
-
asFsPath(uriOrPath) {
|
|
308
|
-
return (uriOrPath.startsWith('file:'))
|
|
309
|
-
? node_1.FileUri.fsPath(uriOrPath)
|
|
310
|
-
: uriOrPath;
|
|
311
|
-
}
|
|
312
|
-
/**
|
|
313
|
-
* @deprecated
|
|
314
|
-
*
|
|
315
|
-
* Remove ProcessTaskRunner.findCommand, introduce process "started" event
|
|
316
|
-
* Checks for the existence of a file, at the provided path, and make sure that
|
|
317
|
-
* it's readable and executable.
|
|
318
|
-
*/
|
|
319
|
-
async executableFileExists(filePath) {
|
|
320
|
-
return new Promise(async (resolve, reject) => {
|
|
321
|
-
fs.access(filePath, fs.constants.F_OK | fs.constants.X_OK, err => {
|
|
322
|
-
resolve(err ? false : true);
|
|
323
|
-
});
|
|
324
|
-
});
|
|
325
|
-
}
|
|
326
|
-
};
|
|
327
|
-
exports.ProcessTaskRunner = ProcessTaskRunner;
|
|
328
|
-
tslib_1.__decorate([
|
|
329
|
-
(0, inversify_1.inject)(core_1.ILogger),
|
|
330
|
-
(0, inversify_1.named)('task'),
|
|
331
|
-
tslib_1.__metadata("design:type", Object)
|
|
332
|
-
], ProcessTaskRunner.prototype, "logger", void 0);
|
|
333
|
-
tslib_1.__decorate([
|
|
334
|
-
(0, inversify_1.inject)(node_2.RawProcessFactory),
|
|
335
|
-
tslib_1.__metadata("design:type", Function)
|
|
336
|
-
], ProcessTaskRunner.prototype, "rawProcessFactory", void 0);
|
|
337
|
-
tslib_1.__decorate([
|
|
338
|
-
(0, inversify_1.inject)(node_2.TaskTerminalProcessFactory),
|
|
339
|
-
tslib_1.__metadata("design:type", Function)
|
|
340
|
-
], ProcessTaskRunner.prototype, "taskTerminalProcessFactory", void 0);
|
|
341
|
-
tslib_1.__decorate([
|
|
342
|
-
(0, inversify_1.inject)(process_task_1.TaskFactory),
|
|
343
|
-
tslib_1.__metadata("design:type", Function)
|
|
344
|
-
], ProcessTaskRunner.prototype, "taskFactory", void 0);
|
|
345
|
-
exports.ProcessTaskRunner = ProcessTaskRunner = tslib_1.__decorate([
|
|
346
|
-
(0, inversify_1.injectable)()
|
|
347
|
-
], ProcessTaskRunner);
|
|
348
|
-
//# sourceMappingURL=process-task-runner.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"process-task-runner.js","sourceRoot":"","sources":["../../../src/node/process/process-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,gFAAgF;AAChF,gFAAgF;;;;AAEhF;;;gGAGgG;AAEhG,4DAAyE;AACzE,sCAAmE;AACnE,+CAA+C;AAC/C,kDAMiC;AACjC,2EAEiD;AACjD,iDAA6C;AAI7C,sEAAsF;AACtF,yBAAyB;AACzB,0EAAsE;AAetE;;GAEG;AAEI,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAc1B;;;OAGG;IACH,KAAK,CAAC,GAAG,CAAC,UAA6B,EAAE,GAAY;QACjD,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;YACtB,MAAM,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iB;QAChC,OAAO,CAAC,SAAS,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;YAClC,CAAC,CAAC,cAAO,CAAC,MAAM,CAAC,SAAS,CAAC;YAC3B,CAAC,CAAC,SAAS,CAAC;IACpB,CAAC;IAED;;;;;;OAMG;IACO,KAAK,CAAC,oBAAoB,CAAC,QAAgB;QACjD,OAAO,IAAI,OAAO,CAAU,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;YAClD,EAAE,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,GAAG,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE;gBAC7D,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YAChC,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;CACJ,CAAA;AAvTY,8CAAiB;AAGP;IADlB,IAAA,kBAAM,EAAC,cAAO,CAAC;IAAE,IAAA,iBAAK,EAAC,MAAM,CAAC;;iDACI;AAGhB;IADlB,IAAA,kBAAM,EAAC,wBAAiB,CAAC;;4DAC8B;AAGrC;IADlB,IAAA,kBAAM,EAAC,iCAA0B,CAAC;;qEACuC;AAGvD;IADlB,IAAA,kBAAM,EAAC,0BAAW,CAAC;;sDACwB;4BAZnC,iBAAiB;IAD7B,IAAA,sBAAU,GAAE;GACA,iBAAiB,CAuT7B"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { ILogger } from '@theia/core/lib/common/';
|
|
2
|
-
import { Process, IProcessExitEvent } from '@theia/process/lib/node';
|
|
3
|
-
import { Task, TaskOptions } from '../task';
|
|
4
|
-
import { TaskManager } from '../task-manager';
|
|
5
|
-
import { ProcessType, ProcessTaskInfo } from '../../common/process/task-protocol';
|
|
6
|
-
import { TaskExitedEvent } from '../../common/task-protocol';
|
|
7
|
-
export declare function removeAnsiEscapeCodes(str: string): string;
|
|
8
|
-
export declare const TaskProcessOptions: unique symbol;
|
|
9
|
-
export interface TaskProcessOptions extends TaskOptions {
|
|
10
|
-
process: Process;
|
|
11
|
-
processType: ProcessType;
|
|
12
|
-
command?: string;
|
|
13
|
-
}
|
|
14
|
-
export declare const TaskFactory: unique symbol;
|
|
15
|
-
export type TaskFactory = (options: TaskProcessOptions) => ProcessTask;
|
|
16
|
-
/** Represents a Task launched as a process by `ProcessTaskRunner`. */
|
|
17
|
-
export declare class ProcessTask extends Task {
|
|
18
|
-
protected readonly options: TaskProcessOptions;
|
|
19
|
-
protected command: string | undefined;
|
|
20
|
-
constructor(taskManager: TaskManager, logger: ILogger, options: TaskProcessOptions);
|
|
21
|
-
kill(): Promise<void>;
|
|
22
|
-
protected getTaskExitedEvent(evt: IProcessExitEvent): Promise<TaskExitedEvent>;
|
|
23
|
-
getRuntimeInfo(): ProcessTaskInfo;
|
|
24
|
-
get process(): Process;
|
|
25
|
-
get processType(): ProcessType;
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=process-task.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"process-task.d.ts","sourceRoot":"","sources":["../../../src/node/process/process-task.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAClF,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAQ7D,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAMzD;AAED,eAAO,MAAM,kBAAkB,eAA+B,CAAC;AAC/D,MAAM,WAAW,kBAAmB,SAAQ,WAAW;IACnD,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,WAAW,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,WAAW,eAAwB,CAAC;AACjD,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,EAAE,kBAAkB,KAAK,WAAW,CAAC;AAEvE,sEAAsE;AACtE,qBACa,WAAY,SAAQ,IAAI;uBAO2B,OAAO,EAAE,kBAAkB;IALvF,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;gBAGb,WAAW,EAAE,WAAW,EACb,MAAM,EAAE,OAAO,EACS,OAAO,EAAE,kBAAkB;IAqCvF,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;cAcL,kBAAkB,CAAC,GAAG,EAAE,iBAAiB,GAAG,OAAO,CAAC,eAAe,CAAC;IAYpF,cAAc,IAAI,eAAe;IAWjC,IAAI,OAAO,IAAI,OAAO,CAErB;IAED,IAAI,WAAW,IAAI,WAAW,CAE7B;CACJ"}
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2017 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-only WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.ProcessTask = exports.TaskFactory = exports.TaskProcessOptions = exports.removeAnsiEscapeCodes = void 0;
|
|
19
|
-
const tslib_1 = require("tslib");
|
|
20
|
-
/*---------------------------------------------------------------------------------------------
|
|
21
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
22
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
23
|
-
*--------------------------------------------------------------------------------------------*/
|
|
24
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
25
|
-
const common_1 = require("@theia/core/lib/common/");
|
|
26
|
-
const task_1 = require("../task");
|
|
27
|
-
const task_manager_1 = require("../task-manager");
|
|
28
|
-
// copied from https://github.com/microsoft/vscode/blob/1.79.0/src/vs/base/common/strings.ts#L736
|
|
29
|
-
const CSI_SEQUENCE = /(:?\x1b\[|\x9B)[=?>!]?[\d;:]*["$#'* ]?[a-zA-Z@^`{}|~]/g;
|
|
30
|
-
// Plus additional markers for custom `\x1b]...\x07` instructions.
|
|
31
|
-
const CSI_CUSTOM_SEQUENCE = /\x1b\].*?\x07/g;
|
|
32
|
-
function removeAnsiEscapeCodes(str) {
|
|
33
|
-
if (str) {
|
|
34
|
-
str = str.replace(CSI_SEQUENCE, '').replace(CSI_CUSTOM_SEQUENCE, '');
|
|
35
|
-
}
|
|
36
|
-
return str.trimEnd();
|
|
37
|
-
}
|
|
38
|
-
exports.removeAnsiEscapeCodes = removeAnsiEscapeCodes;
|
|
39
|
-
exports.TaskProcessOptions = Symbol('TaskProcessOptions');
|
|
40
|
-
exports.TaskFactory = Symbol('TaskFactory');
|
|
41
|
-
/** Represents a Task launched as a process by `ProcessTaskRunner`. */
|
|
42
|
-
let ProcessTask = class ProcessTask extends task_1.Task {
|
|
43
|
-
constructor(taskManager, logger, options) {
|
|
44
|
-
super(taskManager, logger, options);
|
|
45
|
-
this.options = options;
|
|
46
|
-
const toDispose = this.process.onClose(async (event) => {
|
|
47
|
-
toDispose.dispose();
|
|
48
|
-
this.fireTaskExited(await this.getTaskExitedEvent(event));
|
|
49
|
-
});
|
|
50
|
-
// Buffer to accumulate incoming output.
|
|
51
|
-
let dataBuffer = '';
|
|
52
|
-
this.process.outputStream.on('data', (chunk) => {
|
|
53
|
-
dataBuffer += chunk;
|
|
54
|
-
while (1) {
|
|
55
|
-
// Check if we have a complete line.
|
|
56
|
-
const eolIdx = dataBuffer.indexOf('\n');
|
|
57
|
-
if (eolIdx < 0) {
|
|
58
|
-
break;
|
|
59
|
-
}
|
|
60
|
-
// Get and remove the line from the data buffer.
|
|
61
|
-
const lineBuf = dataBuffer.slice(0, eolIdx);
|
|
62
|
-
dataBuffer = dataBuffer.slice(eolIdx + 1);
|
|
63
|
-
const processedLine = removeAnsiEscapeCodes(lineBuf);
|
|
64
|
-
this.fireOutputLine({
|
|
65
|
-
taskId: this.taskId,
|
|
66
|
-
ctx: this.context,
|
|
67
|
-
line: processedLine
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
this.command = this.options.command;
|
|
72
|
-
this.logger.info(`Created new task, id: ${this.id}, process id: ${this.options.process.id}, OS PID: ${this.process.pid}, context: ${this.context}`);
|
|
73
|
-
}
|
|
74
|
-
kill() {
|
|
75
|
-
return new Promise(resolve => {
|
|
76
|
-
if (this.process.killed) {
|
|
77
|
-
resolve();
|
|
78
|
-
}
|
|
79
|
-
else {
|
|
80
|
-
const toDispose = this.process.onClose(event => {
|
|
81
|
-
toDispose.dispose();
|
|
82
|
-
resolve();
|
|
83
|
-
});
|
|
84
|
-
this.process.kill();
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
async getTaskExitedEvent(evt) {
|
|
89
|
-
return {
|
|
90
|
-
taskId: this.taskId,
|
|
91
|
-
ctx: this.context,
|
|
92
|
-
code: evt.code,
|
|
93
|
-
signal: evt.signal,
|
|
94
|
-
config: this.options.config,
|
|
95
|
-
terminalId: this.process.id,
|
|
96
|
-
processId: this.process.id
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
getRuntimeInfo() {
|
|
100
|
-
return {
|
|
101
|
-
taskId: this.id,
|
|
102
|
-
ctx: this.context,
|
|
103
|
-
config: this.options.config,
|
|
104
|
-
terminalId: this.process.id,
|
|
105
|
-
processId: this.process.id,
|
|
106
|
-
command: this.command
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
get process() {
|
|
110
|
-
return this.options.process;
|
|
111
|
-
}
|
|
112
|
-
get processType() {
|
|
113
|
-
return this.options.processType;
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
exports.ProcessTask = ProcessTask;
|
|
117
|
-
exports.ProcessTask = ProcessTask = tslib_1.__decorate([
|
|
118
|
-
(0, inversify_1.injectable)(),
|
|
119
|
-
tslib_1.__param(0, (0, inversify_1.inject)(task_manager_1.TaskManager)),
|
|
120
|
-
tslib_1.__param(1, (0, inversify_1.inject)(common_1.ILogger)),
|
|
121
|
-
tslib_1.__param(1, (0, inversify_1.named)('task')),
|
|
122
|
-
tslib_1.__param(2, (0, inversify_1.inject)(exports.TaskProcessOptions)),
|
|
123
|
-
tslib_1.__metadata("design:paramtypes", [task_manager_1.TaskManager, Object, Object])
|
|
124
|
-
], ProcessTask);
|
|
125
|
-
//# sourceMappingURL=process-task.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"process-task.js","sourceRoot":"","sources":["../../../src/node/process/process-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,gFAAgF;AAChF,gFAAgF;;;;AAEhF;;;+FAG+F;AAE/F,4DAAyE;AACzE,oDAAkD;AAElD,kCAA4C;AAC5C,kDAA8C;AAI9C,iGAAiG;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B,GAAG,EAAE,IAAI,CAAC,OAAO;YACjB,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,MAAM,EAAE,GAAG,CAAC,MAAM;YAClB,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM;YAC3B,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE;YAC3B,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE;SAC7B,CAAC;IACN,CAAC;IAED,cAAc;QACV,OAAO;YACH,MAAM,EAAE,IAAI,CAAC,EAAE;YACf,GAAG,EAAE,IAAI,CAAC,OAAO;YACjB,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM;YAC3B,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE;YAC3B,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE;YAC1B,OAAO,EAAE,IAAI,CAAC,OAAO;SACxB,CAAC;IACN,CAAC;IAED,IAAI,OAAO;QACP,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;IAChC,CAAC;IAED,IAAI,WAAW;QACX,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC;IACpC,CAAC;CACJ,CAAA;AAxFY,kCAAW;sBAAX,WAAW;IADvB,IAAA,sBAAU,GAAE;IAMJ,mBAAA,IAAA,kBAAM,EAAC,0BAAW,CAAC,CAAA;IACnB,mBAAA,IAAA,kBAAM,EAAC,gBAAO,CAAC,CAAA;IAAE,mBAAA,IAAA,iBAAK,EAAC,MAAM,CAAC,CAAA;IAC9B,mBAAA,IAAA,kBAAM,EAAC,0BAAkB,CAAC,CAAA;6CAFO,0BAAW;GALxC,WAAW,CAwFvB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"process-task.spec.d.ts","sourceRoot":"","sources":["../../../src/node/process/process-task.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2019 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-only WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const chai_1 = require("chai");
|
|
19
|
-
const process_task_1 = require("./process-task");
|
|
20
|
-
describe('removeAnsiEscapeCodes function', () => {
|
|
21
|
-
it('should remove all end line and color codes', () => {
|
|
22
|
-
const str1 = ' [2m14:21[22m [33mwarning[39m Missing semicolon [2msemi[22m\r';
|
|
23
|
-
let res = (0, process_task_1.removeAnsiEscapeCodes)(str1);
|
|
24
|
-
(0, chai_1.expect)(res).to.eq(' 14:21 warning Missing semicolon semi');
|
|
25
|
-
const str2 = '[37;40mnpm[0m [0m[31;40mERR![0m [0m[35mcode[0m ELIFECYCLE\r';
|
|
26
|
-
res = (0, process_task_1.removeAnsiEscapeCodes)(str2);
|
|
27
|
-
(0, chai_1.expect)(res).to.eq('npm ERR! code ELIFECYCLE');
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
//# sourceMappingURL=process-task.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"process-task.spec.js","sourceRoot":"","sources":["../../../src/node/process/process-task.spec.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,gFAAgF;AAChF,gFAAgF;;AAEhF,+BAA8B;AAC9B,iDAAuD;AAEvD,QAAQ,CAAC,gCAAgC,EAAE,GAAG,EAAE;IAC5C,EAAE,CAAC,4CAA4C,EAAE,GAAG,EAAE;QAClD,MAAM,IAAI,GAAG,yEAAyE,CAAC;QACvF,IAAI,GAAG,GAAG,IAAA,oCAAqB,EAAC,IAAI,CAAC,CAAC;QACtC,IAAA,aAAM,EAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,2CAA2C,CAAC,CAAC;QAE/D,MAAM,IAAI,GAAG,qEAAqE,CAAC;QACnF,GAAG,GAAG,IAAA,oCAAqB,EAAC,IAAI,CAAC,CAAC;QAClC,IAAA,aAAM,EAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,0BAA0B,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { ProblemMatcher, ProblemPattern, ProblemMatch, ProblemLocationKind } from '../common/problem-matcher-protocol';
|
|
2
|
-
export interface ProblemData {
|
|
3
|
-
kind?: ProblemLocationKind;
|
|
4
|
-
file?: string;
|
|
5
|
-
location?: string;
|
|
6
|
-
line?: string;
|
|
7
|
-
character?: string;
|
|
8
|
-
endLine?: string;
|
|
9
|
-
endCharacter?: string;
|
|
10
|
-
message?: string;
|
|
11
|
-
severity?: string;
|
|
12
|
-
code?: string;
|
|
13
|
-
}
|
|
14
|
-
export declare abstract class AbstractLineMatcher {
|
|
15
|
-
protected matcher: ProblemMatcher;
|
|
16
|
-
protected patterns: ProblemPattern[];
|
|
17
|
-
protected activePatternIndex: number;
|
|
18
|
-
protected activePattern: ProblemPattern | undefined;
|
|
19
|
-
protected cachedProblemData: ProblemData;
|
|
20
|
-
constructor(matcher: ProblemMatcher);
|
|
21
|
-
/**
|
|
22
|
-
* Finds the problem identified by this line matcher.
|
|
23
|
-
*
|
|
24
|
-
* @param line the line of text to find the problem from
|
|
25
|
-
* @return the identified problem. If the problem is not found, `undefined` is returned.
|
|
26
|
-
*/
|
|
27
|
-
abstract match(line: string): ProblemMatch | undefined;
|
|
28
|
-
/**
|
|
29
|
-
* Number of problem patterns that the line matcher uses.
|
|
30
|
-
*/
|
|
31
|
-
get patternCount(): number;
|
|
32
|
-
protected getEmptyProblemData(): ProblemData;
|
|
33
|
-
protected fillProblemData(data: ProblemData | null, pattern: ProblemPattern, matches: RegExpExecArray): data is ProblemData;
|
|
34
|
-
private appendProperty;
|
|
35
|
-
private fillProperty;
|
|
36
|
-
protected getMarkerMatch(data: ProblemData): ProblemMatch | undefined;
|
|
37
|
-
private getLocation;
|
|
38
|
-
private parseLocationInfo;
|
|
39
|
-
private createRange;
|
|
40
|
-
private getZeroBasedRangeIndex;
|
|
41
|
-
private getSeverity;
|
|
42
|
-
private getResource;
|
|
43
|
-
protected resetActivePatternIndex(defaultIndex?: number): void;
|
|
44
|
-
protected nextProblemPattern(): void;
|
|
45
|
-
protected doOneLineMatch(line: string): boolean;
|
|
46
|
-
protected isUsingTheLastPattern(): boolean;
|
|
47
|
-
protected isLastPatternLoop(): boolean;
|
|
48
|
-
protected resetCachedProblemData(): void;
|
|
49
|
-
}
|
|
50
|
-
//# sourceMappingURL=task-abstract-line-matcher.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"task-abstract-line-matcher.d.ts","sourceRoot":"","sources":["../../src/node/task-abstract-line-matcher.ts"],"names":[],"mappings":"AAuBA,OAAO,EACe,cAAc,EAAE,cAAc,EAChD,YAAY,EAAoB,mBAAmB,EACtD,MAAM,oCAAoC,CAAC;AAQ5C,MAAM,WAAW,WAAW;IACxB,IAAI,CAAC,EAAE,mBAAmB,CAAC;IAC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