azure-pipelines-task-lib 3.2.1 → 3.4.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/LICENSE +22 -22
- package/README.md +74 -74
- package/Strings/resources.resjson/de-DE/resources.resjson +34 -34
- package/Strings/resources.resjson/es-ES/resources.resjson +34 -34
- package/Strings/resources.resjson/fr-FR/resources.resjson +34 -34
- package/Strings/resources.resjson/ja-JP/resources.resjson +34 -34
- package/ThirdPartyNotice.txt +1114 -1114
- package/internal.d.ts +130 -130
- package/internal.js +885 -885
- package/lib.json +37 -37
- package/mock-answer.d.ts +58 -55
- package/mock-answer.js +41 -41
- package/mock-run.d.ts +44 -44
- package/mock-run.js +92 -92
- package/mock-task.d.ts +112 -111
- package/mock-task.js +451 -447
- package/mock-test.d.ts +28 -28
- package/mock-test.js +298 -298
- package/mock-toolrunner.d.ts +41 -41
- package/mock-toolrunner.js +268 -268
- package/package.json +49 -49
- package/task.d.ts +728 -712
- package/task.js +2023 -1986
- package/taskcommand.d.ts +10 -10
- package/taskcommand.js +103 -103
- package/toolrunner.d.ts +159 -159
- package/toolrunner.js +967 -967
- package/vault.d.ts +10 -10
- package/vault.js +71 -71
package/mock-task.js
CHANGED
|
@@ -1,447 +1,451 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getHttpCertConfiguration = exports.getHttpProxyConfiguration = exports.CodeCoverageEnabler = exports.CodeCoveragePublisher = exports.TestPublisher = exports.legacyFindFiles = exports.findMatch = exports.tool = exports.execSync = exports.exec = exports.mv = exports.rmRF = exports.find = exports.retry = exports.cp = exports.ls = exports.which = exports.resolve = exports.mkdirP = exports.checkPath = exports.popd = exports.pushd = exports.cd = exports.cwd = exports.getPlatform = exports.osType = exports.writeFile = exports.exist = exports.stats = exports.FsStats = exports.loc = exports.setResourcePath = exports.setAnswers = void 0;
|
|
4
|
-
var path = require("path");
|
|
5
|
-
var task = require("./task");
|
|
6
|
-
var tcm = require("./taskcommand");
|
|
7
|
-
var trm = require("./mock-toolrunner");
|
|
8
|
-
var ma = require("./mock-answer");
|
|
9
|
-
var mock = new ma.MockAnswers();
|
|
10
|
-
function setAnswers(answers) {
|
|
11
|
-
mock.initialize(answers);
|
|
12
|
-
trm.setAnswers(answers);
|
|
13
|
-
}
|
|
14
|
-
exports.setAnswers = setAnswers;
|
|
15
|
-
//-----------------------------------------------------
|
|
16
|
-
// Enums
|
|
17
|
-
//-----------------------------------------------------
|
|
18
|
-
module.exports.TaskResult = task.TaskResult;
|
|
19
|
-
module.exports.TaskState = task.TaskState;
|
|
20
|
-
module.exports.IssueType = task.IssueType;
|
|
21
|
-
module.exports.ArtifactType = task.ArtifactType;
|
|
22
|
-
module.exports.FieldType = task.FieldType;
|
|
23
|
-
module.exports.Platform = task.Platform;
|
|
24
|
-
//-----------------------------------------------------
|
|
25
|
-
// Results and Exiting
|
|
26
|
-
//-----------------------------------------------------
|
|
27
|
-
module.exports.setStdStream = task.setStdStream;
|
|
28
|
-
module.exports.setErrStream = task.setErrStream;
|
|
29
|
-
module.exports.setResult = task.setResult;
|
|
30
|
-
//-----------------------------------------------------
|
|
31
|
-
// Loc Helpers
|
|
32
|
-
//-----------------------------------------------------
|
|
33
|
-
function setResourcePath(path) {
|
|
34
|
-
// nothing in mock
|
|
35
|
-
}
|
|
36
|
-
exports.setResourcePath = setResourcePath;
|
|
37
|
-
function loc(key) {
|
|
38
|
-
var args = [];
|
|
39
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
40
|
-
args[_i - 1] = arguments[_i];
|
|
41
|
-
}
|
|
42
|
-
var str = 'loc_mock_' + key;
|
|
43
|
-
if (args.length) {
|
|
44
|
-
str += ' ' + args.join(' ');
|
|
45
|
-
}
|
|
46
|
-
return str;
|
|
47
|
-
}
|
|
48
|
-
exports.loc = loc;
|
|
49
|
-
//-----------------------------------------------------
|
|
50
|
-
// Input Helpers
|
|
51
|
-
//-----------------------------------------------------
|
|
52
|
-
module.exports.assertAgent = task.assertAgent;
|
|
53
|
-
module.exports.getVariable = task.getVariable;
|
|
54
|
-
module.exports.getVariables = task.getVariables;
|
|
55
|
-
module.exports.setVariable = task.setVariable;
|
|
56
|
-
module.exports.setSecret = task.setSecret;
|
|
57
|
-
module.exports.getTaskVariable = task.getTaskVariable;
|
|
58
|
-
module.exports.setTaskVariable = task.setTaskVariable;
|
|
59
|
-
module.exports.getInput = task.getInput;
|
|
60
|
-
module.exports.getInputRequired = task.getInputRequired;
|
|
61
|
-
module.exports.getBoolInput = task.getBoolInput;
|
|
62
|
-
module.exports.getDelimitedInput = task.getDelimitedInput;
|
|
63
|
-
module.exports.filePathSupplied = task.filePathSupplied;
|
|
64
|
-
function getPathInput(name, required, check) {
|
|
65
|
-
var inval = module.exports.getInput(name, required);
|
|
66
|
-
if (inval) {
|
|
67
|
-
if (check) {
|
|
68
|
-
checkPath(inval, name);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
return inval;
|
|
72
|
-
}
|
|
73
|
-
module.exports.getPathInput = getPathInput;
|
|
74
|
-
function getPathInputRequired(name, check) {
|
|
75
|
-
return getPathInput(name, true, check);
|
|
76
|
-
}
|
|
77
|
-
module.exports.getPathInputRequired = getPathInputRequired;
|
|
78
|
-
//-----------------------------------------------------
|
|
79
|
-
// Endpoint Helpers
|
|
80
|
-
//-----------------------------------------------------
|
|
81
|
-
module.exports.getEndpointUrl = task.getEndpointUrl;
|
|
82
|
-
module.exports.getEndpointUrlRequired = task.getEndpointUrlRequired;
|
|
83
|
-
module.exports.getEndpointDataParameter = task.getEndpointDataParameter;
|
|
84
|
-
module.exports.getEndpointDataParameterRequired = task.getEndpointDataParameterRequired;
|
|
85
|
-
module.exports.getEndpointAuthorizationScheme = task.getEndpointAuthorizationScheme;
|
|
86
|
-
module.exports.getEndpointAuthorizationSchemeRequired = task.getEndpointAuthorizationSchemeRequired;
|
|
87
|
-
module.exports.getEndpointAuthorizationParameter = task.getEndpointAuthorizationParameter;
|
|
88
|
-
module.exports.getEndpointAuthorizationParameterRequired = task.getEndpointAuthorizationParameterRequired;
|
|
89
|
-
module.exports.getEndpointAuthorization = task.getEndpointAuthorization;
|
|
90
|
-
//-----------------------------------------------------
|
|
91
|
-
// SecureFile Helpers
|
|
92
|
-
//-----------------------------------------------------
|
|
93
|
-
module.exports.getSecureFileName = task.getSecureFileName;
|
|
94
|
-
module.exports.getSecureFileTicket = task.getSecureFileTicket;
|
|
95
|
-
//-----------------------------------------------------
|
|
96
|
-
// Fs Helpers
|
|
97
|
-
//-----------------------------------------------------
|
|
98
|
-
var FsStats = /** @class */ (function () {
|
|
99
|
-
function FsStats() {
|
|
100
|
-
this.m_isFile = false;
|
|
101
|
-
this.m_isDirectory = false;
|
|
102
|
-
this.m_isBlockDevice = false;
|
|
103
|
-
this.m_isCharacterDevice = false;
|
|
104
|
-
this.m_isSymbolicLink = false;
|
|
105
|
-
this.m_isFIFO = false;
|
|
106
|
-
this.m_isSocket = false;
|
|
107
|
-
this.dev = 0;
|
|
108
|
-
this.ino = 0;
|
|
109
|
-
this.mode = 0;
|
|
110
|
-
this.nlink = 0;
|
|
111
|
-
this.uid = 0;
|
|
112
|
-
this.gid = 0;
|
|
113
|
-
this.rdev = 0;
|
|
114
|
-
this.size = 0;
|
|
115
|
-
this.blksize = 0;
|
|
116
|
-
this.blocks = 0;
|
|
117
|
-
this.atime = new Date();
|
|
118
|
-
this.mtime = new Date();
|
|
119
|
-
this.ctime = new Date();
|
|
120
|
-
this.birthtime = new Date();
|
|
121
|
-
}
|
|
122
|
-
FsStats.prototype.setAnswers = function (mockResponses) {
|
|
123
|
-
this.m_isFile = mockResponses['isFile'] || this.m_isFile;
|
|
124
|
-
this.m_isDirectory = mockResponses['isDirectory'] || this.m_isDirectory;
|
|
125
|
-
this.m_isBlockDevice = mockResponses['isBlockDevice'] || this.m_isBlockDevice;
|
|
126
|
-
this.m_isCharacterDevice = mockResponses['isCharacterDevice'] || this.m_isCharacterDevice;
|
|
127
|
-
this.m_isSymbolicLink = mockResponses['isSymbolicLink'] || this.m_isSymbolicLink;
|
|
128
|
-
this.m_isFIFO = mockResponses['isFIFO'] || this.m_isFIFO;
|
|
129
|
-
this.m_isSocket = mockResponses['isSocket'] || this.m_isSocket;
|
|
130
|
-
this.dev = mockResponses['dev'] || this.dev;
|
|
131
|
-
this.ino = mockResponses['ino'] || this.ino;
|
|
132
|
-
this.mode = mockResponses['mode'] || this.mode;
|
|
133
|
-
this.nlink = mockResponses['nlink'] || this.nlink;
|
|
134
|
-
this.uid = mockResponses['uid'] || this.uid;
|
|
135
|
-
this.gid = mockResponses['gid'] || this.gid;
|
|
136
|
-
this.rdev = mockResponses['rdev'] || this.rdev;
|
|
137
|
-
this.size = mockResponses['size'] || this.size;
|
|
138
|
-
this.blksize = mockResponses['blksize'] || this.blksize;
|
|
139
|
-
this.blocks = mockResponses['blocks'] || this.blocks;
|
|
140
|
-
this.atime = mockResponses['atime'] || this.atime;
|
|
141
|
-
this.mtime = mockResponses['mtime'] || this.mtime;
|
|
142
|
-
this.ctime = mockResponses['ctime'] || this.ctime;
|
|
143
|
-
this.m_isSocket = mockResponses['isSocket'] || this.m_isSocket;
|
|
144
|
-
};
|
|
145
|
-
FsStats.prototype.isFile = function () {
|
|
146
|
-
return this.m_isFile;
|
|
147
|
-
};
|
|
148
|
-
FsStats.prototype.isDirectory = function () {
|
|
149
|
-
return this.m_isDirectory;
|
|
150
|
-
};
|
|
151
|
-
FsStats.prototype.isBlockDevice = function () {
|
|
152
|
-
return this.m_isBlockDevice;
|
|
153
|
-
};
|
|
154
|
-
FsStats.prototype.isCharacterDevice = function () {
|
|
155
|
-
return this.m_isCharacterDevice;
|
|
156
|
-
};
|
|
157
|
-
FsStats.prototype.isSymbolicLink = function () {
|
|
158
|
-
return this.m_isSymbolicLink;
|
|
159
|
-
};
|
|
160
|
-
FsStats.prototype.isFIFO = function () {
|
|
161
|
-
return this.m_isFIFO;
|
|
162
|
-
};
|
|
163
|
-
FsStats.prototype.isSocket = function () {
|
|
164
|
-
return this.m_isSocket;
|
|
165
|
-
};
|
|
166
|
-
return FsStats;
|
|
167
|
-
}());
|
|
168
|
-
exports.FsStats = FsStats;
|
|
169
|
-
function stats(path) {
|
|
170
|
-
var fsStats = new FsStats();
|
|
171
|
-
fsStats.setAnswers(mock.getResponse('stats', path, module.exports.debug) || {});
|
|
172
|
-
return fsStats;
|
|
173
|
-
}
|
|
174
|
-
exports.stats = stats;
|
|
175
|
-
function exist(path) {
|
|
176
|
-
return mock.getResponse('exist', path, module.exports.debug) || false;
|
|
177
|
-
}
|
|
178
|
-
exports.exist = exist;
|
|
179
|
-
function writeFile(file, data, options) {
|
|
180
|
-
//do nothing
|
|
181
|
-
}
|
|
182
|
-
exports.writeFile = writeFile;
|
|
183
|
-
function osType() {
|
|
184
|
-
return mock.getResponse('osType', 'osType', module.exports.debug);
|
|
185
|
-
}
|
|
186
|
-
exports.osType = osType;
|
|
187
|
-
function getPlatform() {
|
|
188
|
-
return mock.getResponse('getPlatform', 'getPlatform', module.exports.debug);
|
|
189
|
-
}
|
|
190
|
-
exports.getPlatform = getPlatform;
|
|
191
|
-
function
|
|
192
|
-
return mock.getResponse('
|
|
193
|
-
}
|
|
194
|
-
exports.
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
exports.
|
|
206
|
-
function
|
|
207
|
-
// do nothing. TODO: keep stack with asserts
|
|
208
|
-
}
|
|
209
|
-
exports.
|
|
210
|
-
function
|
|
211
|
-
// do nothing. TODO: keep stack with asserts
|
|
212
|
-
}
|
|
213
|
-
exports.
|
|
214
|
-
|
|
215
|
-
//
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
//
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
function
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
module.exports.debug(
|
|
266
|
-
}
|
|
267
|
-
exports.
|
|
268
|
-
function
|
|
269
|
-
|
|
270
|
-
}
|
|
271
|
-
exports.
|
|
272
|
-
function
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
exports.
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
return mock.getResponse('
|
|
326
|
-
}
|
|
327
|
-
exports.
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
}
|
|
360
|
-
exports.
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
}
|
|
385
|
-
exports.
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
exports.
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
exports.
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
exports.
|
|
410
|
-
exports.
|
|
411
|
-
exports.
|
|
412
|
-
exports.
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
exports.
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
exports.
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
//-----------------------------------------------------
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
exports.
|
|
428
|
-
//-----------------------------------------------------
|
|
429
|
-
//
|
|
430
|
-
//-----------------------------------------------------
|
|
431
|
-
exports.
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
//-----------------------------------------------------
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getHttpCertConfiguration = exports.getHttpProxyConfiguration = exports.CodeCoverageEnabler = exports.CodeCoveragePublisher = exports.TestPublisher = exports.legacyFindFiles = exports.findMatch = exports.tool = exports.execSync = exports.exec = exports.mv = exports.rmRF = exports.find = exports.retry = exports.cp = exports.ls = exports.which = exports.resolve = exports.mkdirP = exports.checkPath = exports.popd = exports.pushd = exports.cd = exports.cwd = exports.getAgentMode = exports.getPlatform = exports.osType = exports.writeFile = exports.exist = exports.stats = exports.FsStats = exports.loc = exports.setResourcePath = exports.setAnswers = void 0;
|
|
4
|
+
var path = require("path");
|
|
5
|
+
var task = require("./task");
|
|
6
|
+
var tcm = require("./taskcommand");
|
|
7
|
+
var trm = require("./mock-toolrunner");
|
|
8
|
+
var ma = require("./mock-answer");
|
|
9
|
+
var mock = new ma.MockAnswers();
|
|
10
|
+
function setAnswers(answers) {
|
|
11
|
+
mock.initialize(answers);
|
|
12
|
+
trm.setAnswers(answers);
|
|
13
|
+
}
|
|
14
|
+
exports.setAnswers = setAnswers;
|
|
15
|
+
//-----------------------------------------------------
|
|
16
|
+
// Enums
|
|
17
|
+
//-----------------------------------------------------
|
|
18
|
+
module.exports.TaskResult = task.TaskResult;
|
|
19
|
+
module.exports.TaskState = task.TaskState;
|
|
20
|
+
module.exports.IssueType = task.IssueType;
|
|
21
|
+
module.exports.ArtifactType = task.ArtifactType;
|
|
22
|
+
module.exports.FieldType = task.FieldType;
|
|
23
|
+
module.exports.Platform = task.Platform;
|
|
24
|
+
//-----------------------------------------------------
|
|
25
|
+
// Results and Exiting
|
|
26
|
+
//-----------------------------------------------------
|
|
27
|
+
module.exports.setStdStream = task.setStdStream;
|
|
28
|
+
module.exports.setErrStream = task.setErrStream;
|
|
29
|
+
module.exports.setResult = task.setResult;
|
|
30
|
+
//-----------------------------------------------------
|
|
31
|
+
// Loc Helpers
|
|
32
|
+
//-----------------------------------------------------
|
|
33
|
+
function setResourcePath(path) {
|
|
34
|
+
// nothing in mock
|
|
35
|
+
}
|
|
36
|
+
exports.setResourcePath = setResourcePath;
|
|
37
|
+
function loc(key) {
|
|
38
|
+
var args = [];
|
|
39
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
40
|
+
args[_i - 1] = arguments[_i];
|
|
41
|
+
}
|
|
42
|
+
var str = 'loc_mock_' + key;
|
|
43
|
+
if (args.length) {
|
|
44
|
+
str += ' ' + args.join(' ');
|
|
45
|
+
}
|
|
46
|
+
return str;
|
|
47
|
+
}
|
|
48
|
+
exports.loc = loc;
|
|
49
|
+
//-----------------------------------------------------
|
|
50
|
+
// Input Helpers
|
|
51
|
+
//-----------------------------------------------------
|
|
52
|
+
module.exports.assertAgent = task.assertAgent;
|
|
53
|
+
module.exports.getVariable = task.getVariable;
|
|
54
|
+
module.exports.getVariables = task.getVariables;
|
|
55
|
+
module.exports.setVariable = task.setVariable;
|
|
56
|
+
module.exports.setSecret = task.setSecret;
|
|
57
|
+
module.exports.getTaskVariable = task.getTaskVariable;
|
|
58
|
+
module.exports.setTaskVariable = task.setTaskVariable;
|
|
59
|
+
module.exports.getInput = task.getInput;
|
|
60
|
+
module.exports.getInputRequired = task.getInputRequired;
|
|
61
|
+
module.exports.getBoolInput = task.getBoolInput;
|
|
62
|
+
module.exports.getDelimitedInput = task.getDelimitedInput;
|
|
63
|
+
module.exports.filePathSupplied = task.filePathSupplied;
|
|
64
|
+
function getPathInput(name, required, check) {
|
|
65
|
+
var inval = module.exports.getInput(name, required);
|
|
66
|
+
if (inval) {
|
|
67
|
+
if (check) {
|
|
68
|
+
checkPath(inval, name);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return inval;
|
|
72
|
+
}
|
|
73
|
+
module.exports.getPathInput = getPathInput;
|
|
74
|
+
function getPathInputRequired(name, check) {
|
|
75
|
+
return getPathInput(name, true, check);
|
|
76
|
+
}
|
|
77
|
+
module.exports.getPathInputRequired = getPathInputRequired;
|
|
78
|
+
//-----------------------------------------------------
|
|
79
|
+
// Endpoint Helpers
|
|
80
|
+
//-----------------------------------------------------
|
|
81
|
+
module.exports.getEndpointUrl = task.getEndpointUrl;
|
|
82
|
+
module.exports.getEndpointUrlRequired = task.getEndpointUrlRequired;
|
|
83
|
+
module.exports.getEndpointDataParameter = task.getEndpointDataParameter;
|
|
84
|
+
module.exports.getEndpointDataParameterRequired = task.getEndpointDataParameterRequired;
|
|
85
|
+
module.exports.getEndpointAuthorizationScheme = task.getEndpointAuthorizationScheme;
|
|
86
|
+
module.exports.getEndpointAuthorizationSchemeRequired = task.getEndpointAuthorizationSchemeRequired;
|
|
87
|
+
module.exports.getEndpointAuthorizationParameter = task.getEndpointAuthorizationParameter;
|
|
88
|
+
module.exports.getEndpointAuthorizationParameterRequired = task.getEndpointAuthorizationParameterRequired;
|
|
89
|
+
module.exports.getEndpointAuthorization = task.getEndpointAuthorization;
|
|
90
|
+
//-----------------------------------------------------
|
|
91
|
+
// SecureFile Helpers
|
|
92
|
+
//-----------------------------------------------------
|
|
93
|
+
module.exports.getSecureFileName = task.getSecureFileName;
|
|
94
|
+
module.exports.getSecureFileTicket = task.getSecureFileTicket;
|
|
95
|
+
//-----------------------------------------------------
|
|
96
|
+
// Fs Helpers
|
|
97
|
+
//-----------------------------------------------------
|
|
98
|
+
var FsStats = /** @class */ (function () {
|
|
99
|
+
function FsStats() {
|
|
100
|
+
this.m_isFile = false;
|
|
101
|
+
this.m_isDirectory = false;
|
|
102
|
+
this.m_isBlockDevice = false;
|
|
103
|
+
this.m_isCharacterDevice = false;
|
|
104
|
+
this.m_isSymbolicLink = false;
|
|
105
|
+
this.m_isFIFO = false;
|
|
106
|
+
this.m_isSocket = false;
|
|
107
|
+
this.dev = 0;
|
|
108
|
+
this.ino = 0;
|
|
109
|
+
this.mode = 0;
|
|
110
|
+
this.nlink = 0;
|
|
111
|
+
this.uid = 0;
|
|
112
|
+
this.gid = 0;
|
|
113
|
+
this.rdev = 0;
|
|
114
|
+
this.size = 0;
|
|
115
|
+
this.blksize = 0;
|
|
116
|
+
this.blocks = 0;
|
|
117
|
+
this.atime = new Date();
|
|
118
|
+
this.mtime = new Date();
|
|
119
|
+
this.ctime = new Date();
|
|
120
|
+
this.birthtime = new Date();
|
|
121
|
+
}
|
|
122
|
+
FsStats.prototype.setAnswers = function (mockResponses) {
|
|
123
|
+
this.m_isFile = mockResponses['isFile'] || this.m_isFile;
|
|
124
|
+
this.m_isDirectory = mockResponses['isDirectory'] || this.m_isDirectory;
|
|
125
|
+
this.m_isBlockDevice = mockResponses['isBlockDevice'] || this.m_isBlockDevice;
|
|
126
|
+
this.m_isCharacterDevice = mockResponses['isCharacterDevice'] || this.m_isCharacterDevice;
|
|
127
|
+
this.m_isSymbolicLink = mockResponses['isSymbolicLink'] || this.m_isSymbolicLink;
|
|
128
|
+
this.m_isFIFO = mockResponses['isFIFO'] || this.m_isFIFO;
|
|
129
|
+
this.m_isSocket = mockResponses['isSocket'] || this.m_isSocket;
|
|
130
|
+
this.dev = mockResponses['dev'] || this.dev;
|
|
131
|
+
this.ino = mockResponses['ino'] || this.ino;
|
|
132
|
+
this.mode = mockResponses['mode'] || this.mode;
|
|
133
|
+
this.nlink = mockResponses['nlink'] || this.nlink;
|
|
134
|
+
this.uid = mockResponses['uid'] || this.uid;
|
|
135
|
+
this.gid = mockResponses['gid'] || this.gid;
|
|
136
|
+
this.rdev = mockResponses['rdev'] || this.rdev;
|
|
137
|
+
this.size = mockResponses['size'] || this.size;
|
|
138
|
+
this.blksize = mockResponses['blksize'] || this.blksize;
|
|
139
|
+
this.blocks = mockResponses['blocks'] || this.blocks;
|
|
140
|
+
this.atime = mockResponses['atime'] || this.atime;
|
|
141
|
+
this.mtime = mockResponses['mtime'] || this.mtime;
|
|
142
|
+
this.ctime = mockResponses['ctime'] || this.ctime;
|
|
143
|
+
this.m_isSocket = mockResponses['isSocket'] || this.m_isSocket;
|
|
144
|
+
};
|
|
145
|
+
FsStats.prototype.isFile = function () {
|
|
146
|
+
return this.m_isFile;
|
|
147
|
+
};
|
|
148
|
+
FsStats.prototype.isDirectory = function () {
|
|
149
|
+
return this.m_isDirectory;
|
|
150
|
+
};
|
|
151
|
+
FsStats.prototype.isBlockDevice = function () {
|
|
152
|
+
return this.m_isBlockDevice;
|
|
153
|
+
};
|
|
154
|
+
FsStats.prototype.isCharacterDevice = function () {
|
|
155
|
+
return this.m_isCharacterDevice;
|
|
156
|
+
};
|
|
157
|
+
FsStats.prototype.isSymbolicLink = function () {
|
|
158
|
+
return this.m_isSymbolicLink;
|
|
159
|
+
};
|
|
160
|
+
FsStats.prototype.isFIFO = function () {
|
|
161
|
+
return this.m_isFIFO;
|
|
162
|
+
};
|
|
163
|
+
FsStats.prototype.isSocket = function () {
|
|
164
|
+
return this.m_isSocket;
|
|
165
|
+
};
|
|
166
|
+
return FsStats;
|
|
167
|
+
}());
|
|
168
|
+
exports.FsStats = FsStats;
|
|
169
|
+
function stats(path) {
|
|
170
|
+
var fsStats = new FsStats();
|
|
171
|
+
fsStats.setAnswers(mock.getResponse('stats', path, module.exports.debug) || {});
|
|
172
|
+
return fsStats;
|
|
173
|
+
}
|
|
174
|
+
exports.stats = stats;
|
|
175
|
+
function exist(path) {
|
|
176
|
+
return mock.getResponse('exist', path, module.exports.debug) || false;
|
|
177
|
+
}
|
|
178
|
+
exports.exist = exist;
|
|
179
|
+
function writeFile(file, data, options) {
|
|
180
|
+
//do nothing
|
|
181
|
+
}
|
|
182
|
+
exports.writeFile = writeFile;
|
|
183
|
+
function osType() {
|
|
184
|
+
return mock.getResponse('osType', 'osType', module.exports.debug);
|
|
185
|
+
}
|
|
186
|
+
exports.osType = osType;
|
|
187
|
+
function getPlatform() {
|
|
188
|
+
return mock.getResponse('getPlatform', 'getPlatform', module.exports.debug);
|
|
189
|
+
}
|
|
190
|
+
exports.getPlatform = getPlatform;
|
|
191
|
+
function getAgentMode() {
|
|
192
|
+
return mock.getResponse('getAgentMode', 'getAgentMode', module.exports.debug);
|
|
193
|
+
}
|
|
194
|
+
exports.getAgentMode = getAgentMode;
|
|
195
|
+
function cwd() {
|
|
196
|
+
return mock.getResponse('cwd', 'cwd', module.exports.debug);
|
|
197
|
+
}
|
|
198
|
+
exports.cwd = cwd;
|
|
199
|
+
//-----------------------------------------------------
|
|
200
|
+
// Cmd Helpers
|
|
201
|
+
//-----------------------------------------------------
|
|
202
|
+
module.exports.command = task.command;
|
|
203
|
+
module.exports.warning = task.warning;
|
|
204
|
+
module.exports.error = task.error;
|
|
205
|
+
module.exports.debug = task.debug;
|
|
206
|
+
function cd(path) {
|
|
207
|
+
// do nothing. TODO: keep stack with asserts
|
|
208
|
+
}
|
|
209
|
+
exports.cd = cd;
|
|
210
|
+
function pushd(path) {
|
|
211
|
+
// do nothing. TODO: keep stack with asserts
|
|
212
|
+
}
|
|
213
|
+
exports.pushd = pushd;
|
|
214
|
+
function popd() {
|
|
215
|
+
// do nothing. TODO: keep stack with asserts
|
|
216
|
+
}
|
|
217
|
+
exports.popd = popd;
|
|
218
|
+
//------------------------------------------------
|
|
219
|
+
// Validation Helpers
|
|
220
|
+
//------------------------------------------------
|
|
221
|
+
function checkPath(p, name) {
|
|
222
|
+
module.exports.debug('check path : ' + p);
|
|
223
|
+
if (!p || !mock.getResponse('checkPath', p, module.exports.debug)) {
|
|
224
|
+
throw new Error('Not found ' + p);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
exports.checkPath = checkPath;
|
|
228
|
+
//-----------------------------------------------------
|
|
229
|
+
// Shell/File I/O Helpers
|
|
230
|
+
// Abstract these away so we can
|
|
231
|
+
// - default to good error handling
|
|
232
|
+
// - inject system.debug info
|
|
233
|
+
// - have option to switch internal impl (shelljs now)
|
|
234
|
+
//-----------------------------------------------------
|
|
235
|
+
function mkdirP(p) {
|
|
236
|
+
module.exports.debug('creating path: ' + p);
|
|
237
|
+
}
|
|
238
|
+
exports.mkdirP = mkdirP;
|
|
239
|
+
function resolve() {
|
|
240
|
+
// we can't do ...param if we target ES6 and node 5. This is what <=ES5 compiles down to.
|
|
241
|
+
//return the posix implementation in the mock, so paths will be consistent when L0 tests are run on Windows or Mac/Linux
|
|
242
|
+
var absolutePath = path.posix.resolve.apply(this, arguments);
|
|
243
|
+
module.exports.debug('Absolute path for pathSegments: ' + arguments + ' = ' + absolutePath);
|
|
244
|
+
return absolutePath;
|
|
245
|
+
}
|
|
246
|
+
exports.resolve = resolve;
|
|
247
|
+
function which(tool, check) {
|
|
248
|
+
var response = mock.getResponse('which', tool, module.exports.debug);
|
|
249
|
+
if (check) {
|
|
250
|
+
checkPath(response, tool);
|
|
251
|
+
}
|
|
252
|
+
return response;
|
|
253
|
+
}
|
|
254
|
+
exports.which = which;
|
|
255
|
+
function ls(options, paths) {
|
|
256
|
+
var response = mock.getResponse('ls', paths[0], module.exports.debug);
|
|
257
|
+
if (!response) {
|
|
258
|
+
return [];
|
|
259
|
+
}
|
|
260
|
+
return response;
|
|
261
|
+
}
|
|
262
|
+
exports.ls = ls;
|
|
263
|
+
function cp(source, dest) {
|
|
264
|
+
module.exports.debug('###copying###');
|
|
265
|
+
module.exports.debug('copying ' + source + ' to ' + dest);
|
|
266
|
+
}
|
|
267
|
+
exports.cp = cp;
|
|
268
|
+
function retry(func, args, retryOptions) {
|
|
269
|
+
module.exports.debug("trying to execute " + (func === null || func === void 0 ? void 0 : func.name) + "(" + args.toString() + ") with " + retryOptions.retryCount + " retries");
|
|
270
|
+
}
|
|
271
|
+
exports.retry = retry;
|
|
272
|
+
function find(findPath) {
|
|
273
|
+
return mock.getResponse('find', findPath, module.exports.debug);
|
|
274
|
+
}
|
|
275
|
+
exports.find = find;
|
|
276
|
+
function rmRF(path) {
|
|
277
|
+
module.exports.debug('rmRF ' + path);
|
|
278
|
+
var response = mock.getResponse('rmRF', path, module.exports.debug);
|
|
279
|
+
if (!response['success']) {
|
|
280
|
+
module.exports.setResult(1, response['message']);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
exports.rmRF = rmRF;
|
|
284
|
+
function mv(source, dest, force, continueOnError) {
|
|
285
|
+
module.exports.debug('moving ' + source + ' to ' + dest);
|
|
286
|
+
return true;
|
|
287
|
+
}
|
|
288
|
+
exports.mv = mv;
|
|
289
|
+
//-----------------------------------------------------
|
|
290
|
+
// Exec convenience wrapper
|
|
291
|
+
//-----------------------------------------------------
|
|
292
|
+
function exec(tool, args, options) {
|
|
293
|
+
var toolPath = which(tool, true);
|
|
294
|
+
var tr = this.tool(toolPath);
|
|
295
|
+
if (args) {
|
|
296
|
+
tr.arg(args);
|
|
297
|
+
}
|
|
298
|
+
return tr.exec(options);
|
|
299
|
+
}
|
|
300
|
+
exports.exec = exec;
|
|
301
|
+
function execSync(tool, args, options) {
|
|
302
|
+
var toolPath = which(tool, true);
|
|
303
|
+
var tr = this.tool(toolPath);
|
|
304
|
+
if (args) {
|
|
305
|
+
tr.arg(args);
|
|
306
|
+
}
|
|
307
|
+
return tr.execSync(options);
|
|
308
|
+
}
|
|
309
|
+
exports.execSync = execSync;
|
|
310
|
+
function tool(tool) {
|
|
311
|
+
var tr = new trm.ToolRunner(tool);
|
|
312
|
+
tr.on('debug', function (message) {
|
|
313
|
+
module.exports.debug(message);
|
|
314
|
+
});
|
|
315
|
+
return tr;
|
|
316
|
+
}
|
|
317
|
+
exports.tool = tool;
|
|
318
|
+
//-----------------------------------------------------
|
|
319
|
+
// Matching helpers
|
|
320
|
+
//-----------------------------------------------------
|
|
321
|
+
module.exports.filter = task.filter;
|
|
322
|
+
module.exports.match = task.match;
|
|
323
|
+
function findMatch(defaultRoot, patterns) {
|
|
324
|
+
var responseKey = typeof patterns == 'object' ? patterns.join('\n') : patterns;
|
|
325
|
+
return mock.getResponse('findMatch', responseKey, module.exports.debug);
|
|
326
|
+
}
|
|
327
|
+
exports.findMatch = findMatch;
|
|
328
|
+
function legacyFindFiles(rootDirectory, pattern, includeFiles, includeDirectories) {
|
|
329
|
+
return mock.getResponse('legacyFindFiles', pattern, module.exports.debug);
|
|
330
|
+
}
|
|
331
|
+
exports.legacyFindFiles = legacyFindFiles;
|
|
332
|
+
//-----------------------------------------------------
|
|
333
|
+
// Test Publisher
|
|
334
|
+
//-----------------------------------------------------
|
|
335
|
+
var TestPublisher = /** @class */ (function () {
|
|
336
|
+
function TestPublisher(testRunner) {
|
|
337
|
+
this.testRunner = testRunner;
|
|
338
|
+
}
|
|
339
|
+
TestPublisher.prototype.publish = function (resultFiles, mergeResults, platform, config, runTitle, publishRunAttachments) {
|
|
340
|
+
var properties = {};
|
|
341
|
+
properties['type'] = this.testRunner;
|
|
342
|
+
if (mergeResults) {
|
|
343
|
+
properties['mergeResults'] = mergeResults;
|
|
344
|
+
}
|
|
345
|
+
if (platform) {
|
|
346
|
+
properties['platform'] = platform;
|
|
347
|
+
}
|
|
348
|
+
if (config) {
|
|
349
|
+
properties['config'] = config;
|
|
350
|
+
}
|
|
351
|
+
if (runTitle) {
|
|
352
|
+
properties['runTitle'] = runTitle;
|
|
353
|
+
}
|
|
354
|
+
if (publishRunAttachments) {
|
|
355
|
+
properties['publishRunAttachments'] = publishRunAttachments;
|
|
356
|
+
}
|
|
357
|
+
if (resultFiles) {
|
|
358
|
+
properties['resultFiles'] = resultFiles;
|
|
359
|
+
}
|
|
360
|
+
module.exports.command('results.publish', properties, '');
|
|
361
|
+
};
|
|
362
|
+
return TestPublisher;
|
|
363
|
+
}());
|
|
364
|
+
exports.TestPublisher = TestPublisher;
|
|
365
|
+
//-----------------------------------------------------
|
|
366
|
+
// Code Coverage Publisher
|
|
367
|
+
//-----------------------------------------------------
|
|
368
|
+
var CodeCoveragePublisher = /** @class */ (function () {
|
|
369
|
+
function CodeCoveragePublisher() {
|
|
370
|
+
}
|
|
371
|
+
CodeCoveragePublisher.prototype.publish = function (codeCoverageTool, summaryFileLocation, reportDirectory, additionalCodeCoverageFiles) {
|
|
372
|
+
var properties = {};
|
|
373
|
+
if (codeCoverageTool) {
|
|
374
|
+
properties['codecoveragetool'] = codeCoverageTool;
|
|
375
|
+
}
|
|
376
|
+
if (summaryFileLocation) {
|
|
377
|
+
properties['summaryfile'] = summaryFileLocation;
|
|
378
|
+
}
|
|
379
|
+
if (reportDirectory) {
|
|
380
|
+
properties['reportdirectory'] = reportDirectory;
|
|
381
|
+
}
|
|
382
|
+
if (additionalCodeCoverageFiles) {
|
|
383
|
+
properties['additionalcodecoveragefiles'] = additionalCodeCoverageFiles;
|
|
384
|
+
}
|
|
385
|
+
module.exports.command('codecoverage.publish', properties, "");
|
|
386
|
+
};
|
|
387
|
+
return CodeCoveragePublisher;
|
|
388
|
+
}());
|
|
389
|
+
exports.CodeCoveragePublisher = CodeCoveragePublisher;
|
|
390
|
+
//-----------------------------------------------------
|
|
391
|
+
// Code coverage Publisher
|
|
392
|
+
//-----------------------------------------------------
|
|
393
|
+
var CodeCoverageEnabler = /** @class */ (function () {
|
|
394
|
+
function CodeCoverageEnabler(buildTool, ccTool) {
|
|
395
|
+
this.buildTool = buildTool;
|
|
396
|
+
this.ccTool = ccTool;
|
|
397
|
+
}
|
|
398
|
+
CodeCoverageEnabler.prototype.enableCodeCoverage = function (buildProps) {
|
|
399
|
+
buildProps['buildtool'] = this.buildTool;
|
|
400
|
+
buildProps['codecoveragetool'] = this.ccTool;
|
|
401
|
+
module.exports.command('codecoverage.enable', buildProps, "");
|
|
402
|
+
};
|
|
403
|
+
return CodeCoverageEnabler;
|
|
404
|
+
}());
|
|
405
|
+
exports.CodeCoverageEnabler = CodeCoverageEnabler;
|
|
406
|
+
//-----------------------------------------------------
|
|
407
|
+
// Task Logging Commands
|
|
408
|
+
//-----------------------------------------------------
|
|
409
|
+
exports.uploadFile = task.uploadFile;
|
|
410
|
+
exports.prependPath = task.prependPath;
|
|
411
|
+
exports.uploadSummary = task.uploadSummary;
|
|
412
|
+
exports.addAttachment = task.addAttachment;
|
|
413
|
+
exports.setEndpoint = task.setEndpoint;
|
|
414
|
+
exports.setProgress = task.setProgress;
|
|
415
|
+
exports.logDetail = task.logDetail;
|
|
416
|
+
exports.logIssue = task.logIssue;
|
|
417
|
+
//-----------------------------------------------------
|
|
418
|
+
// Artifact Logging Commands
|
|
419
|
+
//-----------------------------------------------------
|
|
420
|
+
exports.uploadArtifact = task.uploadArtifact;
|
|
421
|
+
exports.associateArtifact = task.associateArtifact;
|
|
422
|
+
//-----------------------------------------------------
|
|
423
|
+
// Build Logging Commands
|
|
424
|
+
//-----------------------------------------------------
|
|
425
|
+
exports.uploadBuildLog = task.uploadBuildLog;
|
|
426
|
+
exports.updateBuildNumber = task.updateBuildNumber;
|
|
427
|
+
exports.addBuildTag = task.addBuildTag;
|
|
428
|
+
//-----------------------------------------------------
|
|
429
|
+
// Release Logging Commands
|
|
430
|
+
//-----------------------------------------------------
|
|
431
|
+
exports.updateReleaseName = task.updateReleaseName;
|
|
432
|
+
//-----------------------------------------------------
|
|
433
|
+
// Tools
|
|
434
|
+
//-----------------------------------------------------
|
|
435
|
+
exports.TaskCommand = tcm.TaskCommand;
|
|
436
|
+
exports.commandFromString = tcm.commandFromString;
|
|
437
|
+
exports.ToolRunner = trm.ToolRunner;
|
|
438
|
+
//-----------------------------------------------------
|
|
439
|
+
// Http Proxy Helper
|
|
440
|
+
//-----------------------------------------------------
|
|
441
|
+
function getHttpProxyConfiguration(requestUrl) {
|
|
442
|
+
return null;
|
|
443
|
+
}
|
|
444
|
+
exports.getHttpProxyConfiguration = getHttpProxyConfiguration;
|
|
445
|
+
//-----------------------------------------------------
|
|
446
|
+
// Http Certificate Helper
|
|
447
|
+
//-----------------------------------------------------
|
|
448
|
+
function getHttpCertConfiguration() {
|
|
449
|
+
return null;
|
|
450
|
+
}
|
|
451
|
+
exports.getHttpCertConfiguration = getHttpCertConfiguration;
|