247
}
248
}
250
>
251
>
export interface IBaseCommandProperties {
252
>
253
>
/**
254
>
* The command to be executed. Can be an external program or a shell
255
>
* command.
256
>
*/
257
>
command?: CommandString;
258
>
259
>
/**
260
>
* The command options used when the command is executed. Can be omitted.
261
>
*/
262
>
options?: ICommandOptionsConfig;
263
>
264
>
/**
265
>
* The arguments passed to the command or additional arguments passed to the
266
>
* command when using a global command.
267
>
*/
268
>
args?: CommandString[];
269
>
}
270
>
271
>
272
>
export interface ICommandProperties extends IBaseCommandProperties {
273
>
274
>
/**
275
>
* Windows specific command properties
276
>
*/
277
>
windows?: IBaseCommandProperties;
278
>
279
>
/**
280
>
* OSX specific command properties
281
>
*/
282
>
osx?: IBaseCommandProperties;
283
>
284
>
/**
285
>
* linux specific command properties
286
>
*/
287
>
linux?: IBaseCommandProperties;
288
>
}
289
>
290
>
export interface IGroupKind {
291
>
kind?: string;
292
>
isDefault?: boolean | string;
293
>
}
294
>
295
>
export interface IConfigurationProperties {
296
>
/**
297
>
* The task's name
298
>
*/
299
>
taskName?: string;
300
>
301
>
/**
302
>
* The UI label used for the task.
303
>
*/
304
>
label?: string;
305
>
306
>
/**
307
>
* An optional identifier which can be used to reference a task
308
>
* in a dependsOn or other attributes.
309
>
*/
310
>
identifier?: string;
311
>
312
>
/**
313
>
* Whether the executed command is kept alive and runs in the background.
314
>
*/
315
>
isBackground?: boolean;
316
>
317
>
/**
318
>
* Whether the task should prompt on close for confirmation if running.
319
>
*/
320
>
promptOnClose?: boolean;
321
>
322
>
/**
323
>
* Defines the group the task belongs too.
324
>
*/
325
>
group?: string | IGroupKind;
326
>
327
>
/**
328
>
* A description of the task.
329
>
*/
330
>
detail?: string;
331
>
332
>
/**
333
>
* The other tasks the task depend on
334
>
*/
335
>
dependsOn?: string | ITaskIdentifier | Array<string | ITaskIdentifier>;
336
>
337
>
/**
338
>
* The order the dependsOn tasks should be executed in.
339
>
*/
340
>
dependsOrder?: string;
341
>
342
>
/**
343
>
* Controls the behavior of the used terminal
344
>
*/
345
>
presentation?: IPresentationOptionsConfig;
346
>
347
>
/**
348
>
* Controls shell options.
349
>
*/
350
>
options?: ICommandOptionsConfig;
351
>
352
>
/**
353
>
* The problem matcher(s) to use to capture problems in the tasks
354
>
* output.
355
>
*/
356
>
problemMatcher?: ProblemMatcherConfig.ProblemMatcherType;
357
>
358
>
/**
359
>
* Task run options. Control run related properties.
360
>
*/
361
>
runOptions?: IRunOptionsConfig;
362
>
363
>
/**
364
>
* The icon for this task in the terminal tabs list
365
>
*/
366
>
icon?: { id: string; color?: string };
367
>
368
>
/**
369
>
* The icon's color in the terminal tabs list
370
>
*/
371
>
color?: string;
372
>
373
>
/**
374
>
* Do not show this task in the run task quickpick
375
>
*/
376
>
hide?: boolean;
377
>
378
>
/**
379
>
* Show this task in the Agents run action dropdown
380
>
*/
381
>
inAgents?: boolean;
382
>
}
383
>
384
>
export interface ICustomTask extends ICommandProperties, IConfigurationProperties {
385
>
/**
386
>
* Custom tasks have the type CUSTOMIZED_TASK_TYPE
387
>
*/
388
>
type?: string;
389
>
390
>
}
391
>
392
>
export interface IConfiguringTask extends IConfigurationProperties {
393
>
/**
394
>
* The contributed type of the task
395
>
*/
396
>
type?: string;
397
>
}
398
>
399
>
/**
400
>
* The base task runner configuration
401
>
*/
402
>
export interface IBaseTaskRunnerConfiguration {
403
>
404
>
/**
405
>
* The command to be executed. Can be an external program or a shell
406
>
* command.
407
>
*/
408
>
command?: CommandString;
409
>
410
>
/**
411
>
* @deprecated Use type instead
412
>
*
413
>
* Specifies whether the command is a shell command and therefore must
414
>
* be executed in a shell interpreter (e.g. cmd.exe, bash, ...).
415
>
*
416
>
* Defaults to false if omitted.
417
>
*/
418
>
isShellCommand?: boolean;
419
>
420
>
/**
421
>
* The task type
422
>
*/
423
>
type?: string;
424
>
425
>
/**
426
>
* The command options used when the command is executed. Can be omitted.
427
>
*/
428
>
options?: ICommandOptionsConfig;
429
>
430
>
/**
431
>
* The arguments passed to the command. Can be omitted.
432
>
*/
433
>
args?: CommandString[];
434
>
435
>
/**
436
>
* Controls whether the output view of the running tasks is brought to front or not.
437
>
* Valid values are:
438
>
* "always": bring the output window always to front when a task is executed.
439
>
* "silent": only bring it to front if no problem matcher is defined for the task executed.
440
>
* "never": never bring the output window to front.
441
>
*
442
>
* If omitted "always" is used.
443
>
*/
444
>
showOutput?: string;
445
>
446
>
/**
447
>
* Controls whether the executed command is printed to the output windows as well.
448
>
*/
449
>
echoCommand?: boolean;
450
>
451
>
/**
452
>
* The group
453
>
*/
454
>
group?: string | IGroupKind;
455
>
456
>
/**
457
>
* Controls the behavior of the used terminal
458
>
*/
459
>
presentation?: IPresentationOptionsConfig;
460
>
461
>
/**
462
>
* If set to false the task name is added as an additional argument to the
463
>
* command when executed. If set to true the task name is suppressed. If
464
>
* omitted false is used.
465
>
*/
466
>
suppressTaskName?: boolean;
467
>
468
>
/**
469
>
* Some commands require that the task argument is highlighted with a special
470
>
* prefix (e.g. /t: for msbuild). This property can be used to control such
471
>
* a prefix.
472
>
*/
473
>
taskSelector?: string;
474
>
475
>
/**
476
>
* The problem matcher(s) to used if a global command is executed (e.g. no tasks
477
>
* are defined). A tasks.json file can either contain a global problemMatcher
478
>
* property or a tasks property but not both.
479
>
*/
480
>
problemMatcher?: ProblemMatcherConfig.ProblemMatcherType;
481
>
482
>
/**
483
>
* @deprecated Use `isBackground` instead.
484
>
*
485
>
* Specifies whether a global command is a watching the filesystem. A task.json
486
>
* file can either contain a global isWatching property or a tasks property
487
>
* but not both.
488
>
*/
489
>
isWatching?: boolean;
490
>
491
>
/**
492
>
* Specifies whether a global command is a background task.
493
>
*/
494
>
isBackground?: boolean;
495
>
496
>
/**
497
>
* Whether the task should prompt on close for confirmation if running.
498
>
*/
499
>
promptOnClose?: boolean;
500
>
501
>
/**
502
>
* The configuration of the available tasks. A tasks.json file can either
503
>
* contain a global problemMatcher property or a tasks property but not both.
504
>
*/
505
>
tasks?: Array<ICustomTask | IConfiguringTask>;
506
>
507
>
/**
508
>
* Problem matcher declarations.
509
>
*/
510
>
declares?: ProblemMatcherConfig.INamedProblemMatcher[];
511
>
512
>
/**
513
>
* Optional user input variables.
514
>
*/
515
>
inputs?: ConfiguredInput[];
516
>
}
517
>
518
>
/**
519
>
* A configuration of an external build system. BuildConfiguration.buildSystem
520
>
* must be set to 'program'
521
>
*/
522
>
export interface IExternalTaskRunnerConfiguration extends IBaseTaskRunnerConfiguration {
523
>
524
>
_runner?: string;
525
>
526
>
/**
527
>
* Determines the runner to use
528
>
*/
529
>
runner?: string;
530
>
531
>
/**
532
>
* The config's version number
533
>
*/
534
>
version: string;
535
>
536
>
/**
537
>
* Windows specific task configuration
538
>
*/
539
>
windows?: IBaseTaskRunnerConfiguration;
540
>
541
>
/**
542
>
* Mac specific task configuration
543
>
*/
544
>
osx?: IBaseTaskRunnerConfiguration;
545
>
546
>
/**
547
>
* Linux specific task configuration
548
>
*/
549
>
linux?: IBaseTaskRunnerConfiguration;
550
>
}
551
>
552
>
enum ProblemMatcherKind {
553
>
Unknown,
554
>
String,
555
>
ProblemMatcher,
556
>
Array
557
>
}
558
>
559
>
type TaskConfigurationValueWithErrors<T> = {
560
>
value?: T;
561
>
errors?: string[];
562
>
};
563
>
564
>
const EMPTY_ARRAY: never[] = [];
565
>
Object.freeze(EMPTY_ARRAY);
566
>
567
function assignProperty<T, K extends keyof T>(target: T, source: Partial<T>, key: K) {
568
const sourceAtKey = source[key];