@opensumi/ide-task 2.21.13 → 2.22.0
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/index.js +2 -2
- package/lib/browser/index.js.map +1 -1
- package/lib/browser/parser.js +4 -4
- package/lib/browser/parser.js.map +1 -1
- package/lib/browser/task-config.d.ts +4 -4
- package/lib/browser/task-config.d.ts.map +1 -1
- package/lib/browser/task-config.js +31 -31
- package/lib/browser/task-config.js.map +1 -1
- package/lib/browser/task-executor.d.ts.map +1 -1
- package/lib/browser/task-executor.js +16 -22
- package/lib/browser/task-executor.js.map +1 -1
- package/lib/browser/task-preferences.contribution.js.map +1 -1
- package/lib/browser/task-preferences.provider.d.ts +2 -2
- package/lib/browser/task-preferences.provider.d.ts.map +1 -1
- package/lib/browser/task-preferences.provider.js +2 -2
- package/lib/browser/task-preferences.provider.js.map +1 -1
- package/lib/browser/task.contribution.js.map +1 -1
- package/lib/browser/task.schema.d.ts +2 -2
- package/lib/browser/task.schema.d.ts.map +1 -1
- package/lib/browser/task.schema.js +5 -1
- package/lib/browser/task.schema.js.map +1 -1
- package/lib/browser/task.service.d.ts +3 -1
- package/lib/browser/task.service.d.ts.map +1 -1
- package/lib/browser/task.service.js +10 -5
- package/lib/browser/task.service.js.map +1 -1
- package/lib/browser/terminal-task-system.js +11 -11
- package/lib/browser/terminal-task-system.js.map +1 -1
- package/lib/common/index.d.ts +1 -1
- package/lib/common/index.d.ts.map +1 -1
- package/lib/common/task.d.ts +4 -4
- package/lib/common/task.d.ts.map +1 -1
- package/lib/common/task.js +7 -7
- package/lib/common/task.js.map +1 -1
- package/package.json +15 -14
- package/src/browser/index.ts +33 -0
- package/src/browser/parser.ts +944 -0
- package/src/browser/problem-collector.ts +71 -0
- package/src/browser/problem-line-matcher.ts +461 -0
- package/src/browser/task-config.ts +2302 -0
- package/src/browser/task-executor.ts +296 -0
- package/src/browser/task-preferences.contribution.ts +9 -0
- package/src/browser/task-preferences.provider.ts +23 -0
- package/src/browser/task-preferences.ts +14 -0
- package/src/browser/task.contribution.ts +70 -0
- package/src/browser/task.schema.ts +368 -0
- package/src/browser/task.service.ts +504 -0
- package/src/browser/terminal-task-system.ts +340 -0
- package/src/common/index.ts +165 -0
- package/src/common/task.ts +1174 -0
- package/src/index.ts +1 -0
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
import { CodeSchemaId, IJSONSchema, localize } from '@opensumi/ide-core-browser';
|
|
2
|
+
export const taskSchemaUri = CodeSchemaId.tasks;
|
|
3
|
+
|
|
4
|
+
const osSpecificTaskRunnerConfiguration = {
|
|
5
|
+
$ref: '#/definitions/taskRunnerConfiguration',
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const schema: IJSONSchema = {
|
|
9
|
+
$id: taskSchemaUri,
|
|
10
|
+
type: 'object',
|
|
11
|
+
required: ['version'],
|
|
12
|
+
properties: {
|
|
13
|
+
version: {
|
|
14
|
+
type: 'string',
|
|
15
|
+
enum: ['2.0.0'],
|
|
16
|
+
description: localize('JsonSchema.version', "The config's version number."),
|
|
17
|
+
},
|
|
18
|
+
windows: {
|
|
19
|
+
$ref: '#/definitions/osSpecificTaskRunnerConfiguration',
|
|
20
|
+
description: localize('JsonSchema.windows', 'Windows specific command configuration'),
|
|
21
|
+
},
|
|
22
|
+
osx: {
|
|
23
|
+
$ref: '#/definitions/osSpecificTaskRunnerConfiguration',
|
|
24
|
+
description: localize('JsonSchema.mac', 'Mac specific command configuration'),
|
|
25
|
+
},
|
|
26
|
+
linux: {
|
|
27
|
+
$ref: '#/definitions/osSpecificTaskRunnerConfiguration',
|
|
28
|
+
description: localize('JsonSchema.linux', 'Linux specific command configuration'),
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
definitions: {
|
|
32
|
+
showOutputType: {
|
|
33
|
+
type: 'string',
|
|
34
|
+
enum: ['always', 'silent', 'never'],
|
|
35
|
+
},
|
|
36
|
+
options: {
|
|
37
|
+
type: 'object',
|
|
38
|
+
description: localize('JsonSchema.options', 'Additional command options'),
|
|
39
|
+
properties: {
|
|
40
|
+
cwd: {
|
|
41
|
+
type: 'string',
|
|
42
|
+
description: localize(
|
|
43
|
+
'JsonSchema.options.cwd',
|
|
44
|
+
"The current working directory of the executed program or script. If omitted Code's current workspace root is used.",
|
|
45
|
+
),
|
|
46
|
+
},
|
|
47
|
+
env: {
|
|
48
|
+
type: 'object',
|
|
49
|
+
additionalProperties: {
|
|
50
|
+
type: 'string',
|
|
51
|
+
},
|
|
52
|
+
description: localize(
|
|
53
|
+
'JsonSchema.options.env',
|
|
54
|
+
"The environment of the executed program or shell. If omitted the parent process' environment is used.",
|
|
55
|
+
),
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
additionalProperties: {
|
|
59
|
+
type: ['string', 'array', 'object'],
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
problemMatcherType: {
|
|
63
|
+
oneOf: [
|
|
64
|
+
{
|
|
65
|
+
type: 'string',
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
type: 'array',
|
|
69
|
+
items: {
|
|
70
|
+
anyOf: [
|
|
71
|
+
{
|
|
72
|
+
type: 'string',
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
},
|
|
79
|
+
shellConfiguration: {
|
|
80
|
+
type: 'object',
|
|
81
|
+
additionalProperties: false,
|
|
82
|
+
description: localize('JsonSchema.shellConfiguration', 'Configures the shell to be used.'),
|
|
83
|
+
properties: {
|
|
84
|
+
executable: {
|
|
85
|
+
type: 'string',
|
|
86
|
+
description: localize('JsonSchema.shell.executable', 'The shell to be used.'),
|
|
87
|
+
},
|
|
88
|
+
args: {
|
|
89
|
+
type: 'array',
|
|
90
|
+
description: localize('JsonSchema.shell.args', 'The shell arguments.'),
|
|
91
|
+
items: {
|
|
92
|
+
type: 'string',
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
commandConfiguration: {
|
|
98
|
+
type: 'object',
|
|
99
|
+
additionalProperties: false,
|
|
100
|
+
properties: {
|
|
101
|
+
command: {
|
|
102
|
+
type: 'string',
|
|
103
|
+
description: localize(
|
|
104
|
+
'JsonSchema.command',
|
|
105
|
+
'The command to be executed. Can be an external program or a shell command.',
|
|
106
|
+
),
|
|
107
|
+
},
|
|
108
|
+
args: {
|
|
109
|
+
type: 'array',
|
|
110
|
+
description: localize('JsonSchema.tasks.args', 'Arguments passed to the command when this task is invoked.'),
|
|
111
|
+
items: {
|
|
112
|
+
type: 'string',
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
options: {
|
|
116
|
+
$ref: '#/definitions/options',
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
taskDescription: {
|
|
121
|
+
type: 'object',
|
|
122
|
+
required: ['taskName'],
|
|
123
|
+
additionalProperties: false,
|
|
124
|
+
properties: {
|
|
125
|
+
taskName: {
|
|
126
|
+
type: 'string',
|
|
127
|
+
description: localize('JsonSchema.tasks.taskName', "The task's name"),
|
|
128
|
+
},
|
|
129
|
+
command: {
|
|
130
|
+
type: 'string',
|
|
131
|
+
description: localize(
|
|
132
|
+
'JsonSchema.command',
|
|
133
|
+
'The command to be executed. Can be an external program or a shell command.',
|
|
134
|
+
),
|
|
135
|
+
},
|
|
136
|
+
args: {
|
|
137
|
+
type: 'array',
|
|
138
|
+
description: localize('JsonSchema.tasks.args', 'Arguments passed to the command when this task is invoked.'),
|
|
139
|
+
items: {
|
|
140
|
+
type: 'string',
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
options: {
|
|
144
|
+
$ref: '#/definitions/options',
|
|
145
|
+
},
|
|
146
|
+
windows: {
|
|
147
|
+
anyOf: [
|
|
148
|
+
{
|
|
149
|
+
$ref: '#/definitions/commandConfiguration',
|
|
150
|
+
description: localize('JsonSchema.tasks.windows', 'Windows specific command configuration'),
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
properties: {
|
|
154
|
+
problemMatcher: {
|
|
155
|
+
$ref: '#/definitions/problemMatcherType',
|
|
156
|
+
description: localize(
|
|
157
|
+
'JsonSchema.tasks.matchers',
|
|
158
|
+
'The problem matcher(s) to use. Can either be a string or a problem matcher definition or an array of strings and problem matchers.',
|
|
159
|
+
),
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
],
|
|
164
|
+
},
|
|
165
|
+
osx: {
|
|
166
|
+
anyOf: [
|
|
167
|
+
{
|
|
168
|
+
$ref: '#/definitions/commandConfiguration',
|
|
169
|
+
description: localize('JsonSchema.tasks.mac', 'Mac specific command configuration'),
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
properties: {
|
|
173
|
+
problemMatcher: {
|
|
174
|
+
$ref: '#/definitions/problemMatcherType',
|
|
175
|
+
description: localize(
|
|
176
|
+
'JsonSchema.tasks.matchers',
|
|
177
|
+
'The problem matcher(s) to use. Can either be a string or a problem matcher definition or an array of strings and problem matchers.',
|
|
178
|
+
),
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
},
|
|
182
|
+
],
|
|
183
|
+
},
|
|
184
|
+
linux: {
|
|
185
|
+
anyOf: [
|
|
186
|
+
{
|
|
187
|
+
$ref: '#/definitions/commandConfiguration',
|
|
188
|
+
description: localize('JsonSchema.tasks.linux', 'Linux specific command configuration'),
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
properties: {
|
|
192
|
+
problemMatcher: {
|
|
193
|
+
$ref: '#/definitions/problemMatcherType',
|
|
194
|
+
description: localize(
|
|
195
|
+
'JsonSchema.tasks.matchers',
|
|
196
|
+
'The problem matcher(s) to use. Can either be a string or a problem matcher definition or an array of strings and problem matchers.',
|
|
197
|
+
),
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
],
|
|
202
|
+
},
|
|
203
|
+
suppressTaskName: {
|
|
204
|
+
type: 'boolean',
|
|
205
|
+
description: localize(
|
|
206
|
+
'JsonSchema.tasks.suppressTaskName',
|
|
207
|
+
'Controls whether the task name is added as an argument to the command. If omitted the globally defined value is used.',
|
|
208
|
+
),
|
|
209
|
+
default: true,
|
|
210
|
+
},
|
|
211
|
+
showOutput: {
|
|
212
|
+
$ref: '#/definitions/showOutputType',
|
|
213
|
+
description: localize(
|
|
214
|
+
'JsonSchema.tasks.showOutput',
|
|
215
|
+
'Controls whether the output of the running task is shown or not. If omitted the globally defined value is used.',
|
|
216
|
+
),
|
|
217
|
+
},
|
|
218
|
+
echoCommand: {
|
|
219
|
+
type: 'boolean',
|
|
220
|
+
description: localize(
|
|
221
|
+
'JsonSchema.echoCommand',
|
|
222
|
+
'Controls whether the executed command is echoed to the output. Default is false.',
|
|
223
|
+
),
|
|
224
|
+
default: true,
|
|
225
|
+
},
|
|
226
|
+
isWatching: {
|
|
227
|
+
type: 'boolean',
|
|
228
|
+
deprecationMessage: localize(
|
|
229
|
+
'JsonSchema.tasks.watching.deprecation',
|
|
230
|
+
'Deprecated. Use isBackground instead.',
|
|
231
|
+
),
|
|
232
|
+
description: localize(
|
|
233
|
+
'JsonSchema.tasks.watching',
|
|
234
|
+
'Whether the executed task is kept alive and is watching the file system.',
|
|
235
|
+
),
|
|
236
|
+
default: true,
|
|
237
|
+
},
|
|
238
|
+
isBackground: {
|
|
239
|
+
type: 'boolean',
|
|
240
|
+
description: localize(
|
|
241
|
+
'JsonSchema.tasks.background',
|
|
242
|
+
'Whether the executed task is kept alive and is running in the background.',
|
|
243
|
+
),
|
|
244
|
+
default: true,
|
|
245
|
+
},
|
|
246
|
+
promptOnClose: {
|
|
247
|
+
type: 'boolean',
|
|
248
|
+
description: localize(
|
|
249
|
+
'JsonSchema.tasks.promptOnClose',
|
|
250
|
+
'Whether the user is prompted when VS Code closes with a running task.',
|
|
251
|
+
),
|
|
252
|
+
default: false,
|
|
253
|
+
},
|
|
254
|
+
isBuildCommand: {
|
|
255
|
+
type: 'boolean',
|
|
256
|
+
description: localize('JsonSchema.tasks.build', "Maps this task to Code's default build command."),
|
|
257
|
+
default: true,
|
|
258
|
+
},
|
|
259
|
+
isTestCommand: {
|
|
260
|
+
type: 'boolean',
|
|
261
|
+
description: localize('JsonSchema.tasks.test', "Maps this task to Code's default test command."),
|
|
262
|
+
default: true,
|
|
263
|
+
},
|
|
264
|
+
problemMatcher: {
|
|
265
|
+
$ref: '#/definitions/problemMatcherType',
|
|
266
|
+
description: localize(
|
|
267
|
+
'JsonSchema.tasks.matchers',
|
|
268
|
+
'The problem matcher(s) to use. Can either be a string or a problem matcher definition or an array of strings and problem matchers.',
|
|
269
|
+
),
|
|
270
|
+
},
|
|
271
|
+
},
|
|
272
|
+
},
|
|
273
|
+
taskRunnerConfiguration: {
|
|
274
|
+
type: 'object',
|
|
275
|
+
required: [],
|
|
276
|
+
properties: {
|
|
277
|
+
command: {
|
|
278
|
+
type: 'string',
|
|
279
|
+
description: localize(
|
|
280
|
+
'JsonSchema.command',
|
|
281
|
+
'The command to be executed. Can be an external program or a shell command.',
|
|
282
|
+
),
|
|
283
|
+
},
|
|
284
|
+
args: {
|
|
285
|
+
type: 'array',
|
|
286
|
+
description: localize('JsonSchema.args', 'Additional arguments passed to the command.'),
|
|
287
|
+
items: {
|
|
288
|
+
type: 'string',
|
|
289
|
+
},
|
|
290
|
+
},
|
|
291
|
+
options: {
|
|
292
|
+
$ref: '#/definitions/options',
|
|
293
|
+
},
|
|
294
|
+
showOutput: {
|
|
295
|
+
$ref: '#/definitions/showOutputType',
|
|
296
|
+
description: localize(
|
|
297
|
+
'JsonSchema.showOutput',
|
|
298
|
+
"Controls whether the output of the running task is shown or not. If omitted 'always' is used.",
|
|
299
|
+
),
|
|
300
|
+
},
|
|
301
|
+
isWatching: {
|
|
302
|
+
type: 'boolean',
|
|
303
|
+
deprecationMessage: localize('JsonSchema.watching.deprecation', 'Deprecated. Use isBackground instead.'),
|
|
304
|
+
description: localize(
|
|
305
|
+
'JsonSchema.watching',
|
|
306
|
+
'Whether the executed task is kept alive and is watching the file system.',
|
|
307
|
+
),
|
|
308
|
+
default: true,
|
|
309
|
+
},
|
|
310
|
+
isBackground: {
|
|
311
|
+
type: 'boolean',
|
|
312
|
+
description: localize(
|
|
313
|
+
'JsonSchema.background',
|
|
314
|
+
'Whether the executed task is kept alive and is running in the background.',
|
|
315
|
+
),
|
|
316
|
+
default: true,
|
|
317
|
+
},
|
|
318
|
+
promptOnClose: {
|
|
319
|
+
type: 'boolean',
|
|
320
|
+
description: localize(
|
|
321
|
+
'JsonSchema.promptOnClose',
|
|
322
|
+
'Whether the user is prompted when VS Code closes with a running background task.',
|
|
323
|
+
),
|
|
324
|
+
default: false,
|
|
325
|
+
},
|
|
326
|
+
echoCommand: {
|
|
327
|
+
type: 'boolean',
|
|
328
|
+
description: localize(
|
|
329
|
+
'JsonSchema.echoCommand',
|
|
330
|
+
'Controls whether the executed command is echoed to the output. Default is false.',
|
|
331
|
+
),
|
|
332
|
+
default: true,
|
|
333
|
+
},
|
|
334
|
+
suppressTaskName: {
|
|
335
|
+
type: 'boolean',
|
|
336
|
+
description: localize(
|
|
337
|
+
'JsonSchema.suppressTaskName',
|
|
338
|
+
'Controls whether the task name is added as an argument to the command. Default is false.',
|
|
339
|
+
),
|
|
340
|
+
default: true,
|
|
341
|
+
},
|
|
342
|
+
taskSelector: {
|
|
343
|
+
type: 'string',
|
|
344
|
+
description: localize('JsonSchema.taskSelector', 'Prefix to indicate that an argument is task.'),
|
|
345
|
+
},
|
|
346
|
+
problemMatcher: {
|
|
347
|
+
$ref: '#/definitions/problemMatcherType',
|
|
348
|
+
description: localize(
|
|
349
|
+
'JsonSchema.matchers',
|
|
350
|
+
'The problem matcher(s) to use. Can either be a string or a problem matcher definition or an array of strings and problem matchers.',
|
|
351
|
+
),
|
|
352
|
+
},
|
|
353
|
+
tasks: {
|
|
354
|
+
type: 'array',
|
|
355
|
+
description: localize(
|
|
356
|
+
'JsonSchema.tasks',
|
|
357
|
+
'The task configurations. Usually these are enrichments of task already defined in the external task runner.',
|
|
358
|
+
),
|
|
359
|
+
items: {
|
|
360
|
+
type: 'object',
|
|
361
|
+
$ref: '#/definitions/taskDescription',
|
|
362
|
+
},
|
|
363
|
+
},
|
|
364
|
+
},
|
|
365
|
+
},
|
|
366
|
+
osSpecificTaskRunnerConfiguration,
|
|
367
|
+
},
|
|
368
|
+
};
|