forked from microsoft/ApplicationInsights-JS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gruntfile.js
709 lines (621 loc) · 30.8 KB
/
gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
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
266
267
268
269
270
271
272
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
314
315
316
317
318
319
320
321
322
323
324
325
326
327
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
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
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
module.exports = function (grunt) {
const versionPlaceholder = '"#version#"';
const aiCoreDefaultNameReplacements = [
];
const aiDefaultNameReplacements = [
];
const aiInternalConstants = [
"./src/InternalConstants.ts"
];
function _encodeStr(str) {
return str.replace(/\\/g, '\\\\').
replace(/"/g, '\\"').
replace(/'/g, '\\\'').
replace(/\u0008/g, '\\b').
replace(/\r/g, '\\r').
replace(/\t/g, '\\t').
replace(/\n/g, '\\n').
replace(/\f/g, '\\f');
}
function generateNewSnippet() {
var snippetBuffer = grunt.file.read("./AISKU/snippet/snippet.min.js");
var snippetStr = _encodeStr(snippetBuffer.toString());
var expectedStr = "##replaceSnippet##";
var srcPath = "./tools/applicationinsights-web-snippet/src";
return {
files: [{
expand: true,
cwd: srcPath,
dest: "./tools/applicationinsights-web-snippet/dest",
src: 'applicationinsights-web-snippet.ts'
}],
options: {
replacements: [{
pattern: expectedStr,
replacement: snippetStr
}]
}
};
}
function _createRegEx(str) {
// Converts a string into a global regex, escaping any special characters
return new RegExp(str.replace(/([.+?^=!:${}()|\[\]\/\\])/g, '\\$1'), 'g');
}
function setVersionNumber(path, packageVersion) {
var expectedVersion = _createRegEx(versionPlaceholder);
var replaceVersion = "'" + packageVersion + "'";
var srcPath = path + '/src';
// This is the grunt string-replace configuration to replace version placeholder with the actual version number
return {
files: [{
expand: true,
cwd: srcPath,
dest: srcPath,
src: '**/*.ts'
}],
options: {
replacements: [{
pattern: expectedVersion,
replacement: replaceVersion
}]
}
};
}
function restoreVersionPlaceholder(path, packageVersion) {
var expectedVersion1 = _createRegEx("'" + packageVersion + "'");
var expectedVersion2 = _createRegEx('"' + packageVersion + '"');
var srcPath = path + '/src';
// This is the grunt string-replace configuration to replace the actual version number with the version placeholder
return {
files: [{
expand: true,
cwd: srcPath,
dest: srcPath,
src: '**/*.ts'
}],
options: {
replacements: [{
pattern: expectedVersion1,
replacement: versionPlaceholder
},{
pattern: expectedVersion2,
replacement: versionPlaceholder
}]
}
};
}
function deepMerge(target, src) {
try {
var newValue = Object.assign({}, target, src);
if (target && src) {
Object.keys(target).forEach((key) => {
// Any existing src[key] value would have been assigned over the target[key] version
if (src[key] !== undefined) {
if (Array.isArray(newValue[key])) {
target[key].forEach((value) => {
newValue[key].push(value);
});
} else if (typeof newValue[key] === "object") {
// Make sure we merge all properties
newValue[key] = deepMerge(newValue[key], target[key]);
}
}
});
}
return newValue;
} catch (e) {
console.error("stack: '" + e.stack + "', message: '" + e.message + "', name: '" + e.name + "'");
}
}
// const perfTestVersions = ["2.0.0","2.0.1","2.1.0","2.2.0","2.2.1","2.2.2","2.3.0","2.3.1",
// "2.4.1","2.4.3","2.4.4","2.5.2","2.5.3","2.5.4","2.5.5","2.5.6","2.5.7","2.5.8","2.5.9","2.5.10","2.5.11",
// "2.6.0","2.6.1","2.6.2","2.6.3","2.6.4","2.6.5","2.7.0"];
const perfTestVersions=["2.8.1"];
function buildConfig(modules) {
var buildCmds = {
ts: {
options: {
comments: true
}
},
"eslint-ts": {
options: {
debug: true
}
},
"ai-minify": {
options: {
debug: true,
//testOnly: true,
}
},
"qunit" : {
all: {
options: {
}
}
},
connect: {
server: {
options: {
port: 9001,
base: '.'
}
}
},
"string-replace": {
}
};
for (var key in modules) {
if (modules.hasOwnProperty(key)) {
var modulePath = modules[key].path;
var moduleCfg = modules[key].cfg;
var packageJsonFile = modulePath + '/package.json';
if (grunt.file.exists(packageJsonFile)) {
// Read the actual module version from the package.json
var pkg = grunt.file.readJSON(modulePath + '/package.json');
var addMinifyTasks = modules[key].autoMinify !== false;
if (addMinifyTasks) {
var nameMaps = aiDefaultNameReplacements;
var internalConstants = aiInternalConstants;
if (pkg['name'] === "@microsoft/applicationinsights-core-js") {
nameMaps = aiCoreDefaultNameReplacements;
internalConstants = [ "./src/JavaScriptSDK/InternalConstants.ts" ];
}
var aiMinify = buildCmds["ai-minify"];
aiMinify[key] = {
options: {
projectRoot: modulePath,
src: "./src/**/*.ts",
nameMaps: nameMaps,
internalConstants: internalConstants
}
};
aiMinify[key + "-reverse"] = {
options: {
projectRoot: modulePath,
src: "./src/**/*.ts",
restore: true,
nameMaps: nameMaps,
internalConstants: internalConstants
}
};
}
var addStringReplace = modules[key].stringReplace !== false;
if (addStringReplace) {
var replaceCmds = buildCmds['string-replace'];
// Read the actual module version from the package.json
var packageVersion = pkg['version'];
replaceCmds[key] = setVersionNumber(modulePath, packageVersion);
replaceCmds[key + '-reverse'] = restoreVersionPlaceholder(modulePath, packageVersion);
}
}
if (grunt.file.exists(modulePath + '/src/tsconfig.json')) {
// Use the src tsconfig (if available)
buildCmds.ts[key] = {
'tsconfig': modulePath + "/src/tsconfig.json",
};
} else if (grunt.file.exists(modulePath + '/tsconfig.json')) {
// Otherwise fall back to the root tsconfig (if available)
buildCmds.ts[key] = {
'tsconfig': modulePath + "/tsconfig.json",
};
} else {
throw new Error("TSConfig not found for [" + key + "]");
}
if (moduleCfg) {
buildCmds.ts[key] = Object.assign(buildCmds.ts[key], moduleCfg);
}
// If the tests have their own tsconfig, add that as a new target
var addQunit = false;
var testRoot = "";
if (modules[key].testHttp !== false) {
testRoot = "http://localhost:9001/";
}
var testUrl = testRoot + modulePath + "/test/UnitTests.html";
if (grunt.file.exists(modulePath + '/test/tsconfig.json')) {
addQunit = true;
buildCmds.ts[key + '-tests'] = {
tsconfig: modulePath + "/test/tsconfig.json",
src: [
modulePath + "/test/Unit/src/**/*.ts"
],
out: modulePath + "/test/Unit/dist/" + (modules[key].unitTestName || key + ".tests.js")
};
} else if (grunt.file.exists(modulePath + '/Tests/tsconfig.json')) {
addQunit = true;
testUrl = testRoot + modulePath + "/Tests/UnitTests.html";
buildCmds.ts[key + '-tests'] = {
tsconfig: modulePath + "/Tests/tsconfig.json",
src: [
modulePath + "/Tests/Unit/src/**/*.ts"
],
out: modulePath + "/Tests/Unit/dist/" + (modules[key].unitTestName || key + ".tests.js")
};
}
if (addQunit) {
buildCmds.qunit[key] = {
options: {
urls: [ testUrl ],
timeout: 300 * 1000, // 5 min
console: true,
summaryOnly: false,
'--web-security': 'false' // we need this to allow CORS requests in PhantomJS
}
};
}
// If the tests have their own tsconfig, add that as a new target
addQunit = false;
var testUrl = testRoot + modulePath + "/test/PerfTests.html";
if (grunt.file.exists(modulePath + '/test/PerfTests.html')) {
addQunit = true;
buildCmds.ts[key + '-perftest'] = {
tsconfig: modulePath + "/test/tsconfig.json",
src: [
modulePath + "/test/Perf/src/**/*.ts"
],
out: modulePath + "/test/Perf/dist/" + (modules[key].perfTestName || key + ".perf.tests.js")
};
} else if (grunt.file.exists(modulePath + '/Tests/PerfTests.html')) {
addQunit = true;
testUrl = testRoot + modulePath + "/Tests/PerfTests.html";
buildCmds.ts[key + '-perftest'] = {
tsconfig: modulePath + "/Tests/tsconfig.json",
src: [
modulePath + "/Tests/Perf/src/**/*.ts"
],
out: modulePath + "/Tests/Perf/dist/" + (modules[key].perfTestName || key + ".perf.tests.js")
};
}
if (addQunit) {
var testUrls = [ testUrl ];
if (key === "aisku") {
testUrls = perfTestVersions.map((version) => {
return testUrl + `?version=${version}`;
});
}
buildCmds.qunit[key + "-perf"] = {
options: {
urls: testUrls,
timeout: 300 * 1000, // 5 min
console: true,
summaryOnly: false,
puppeteer: { headless: true, args:['--enable-precise-memory-info','--expose-internals-for-testing'] },
'--web-security': 'false' // we need this to allow CORS requests in PhantomJS
}
};
}
let esLintCmd = buildCmds["eslint-ts"];
esLintCmd[key + '-lint'] = {
options: {
tsconfig: modulePath + '/tsconfig.json'
}
};
if (moduleCfg) {
esLintCmd[key + '-lint'] = Object.assign(buildCmds.ts[key], moduleCfg);
}
esLintCmd[key + '-lint-fix'] = deepMerge({ options: { fix: true } }, esLintCmd[key + '-lint']);
}
}
return buildCmds;
}
try {
var theBuildConfig = deepMerge(buildConfig({
// Shared
"core": {
path: "./shared/AppInsightsCore",
unitTestName: "aicoreunit.tests.js",
perfTestName: "aicoreperf.tests.js"
},
"common": {
path: "./shared/AppInsightsCommon",
unitTestName: "aicommon.tests.js"
},
// SKUs
"aisku": {
path: "./AISKU",
cfg: {
src: [
"AISKU/src/*.ts"
]
},
unitTestName: "aiskuunittests.tests.js",
perfTestName: "aiskuperftests.tests.js"
},
"aiskulite": {
path: "./AISKULight",
cfg: {
src: [
"AISKULight/src/*.ts"
]
},
unitTestName: "aiskuliteunittests.tests.js"
},
// Channels
"aichannel": { path: "./channels/applicationinsights-channel-js" },
// Extensions
"appinsights": {
path: "./extensions/applicationinsights-analytics-js",
unitTestName: "appinsights-analytics.tests.js"
},
"clickanalytics": {
path: "./extensions/applicationinsights-clickanalytics-js",
unitTestName: "appinsights-clickanalytics.tests.js"
},
"debugplugin": { path: "./extensions/applicationinsights-debugplugin-js" },
"deps": {
path: "./extensions/applicationinsights-dependencies-js",
unitTestName: "dependencies.tests.js"
},
"perfmarkmeasure": {
path: "./extensions/applicationinsights-perfmarkmeasure-js",
unitTestName: "appinsights-perfmarkmeasure.tests.js"
},
"properties": {
path: "./extensions/applicationinsights-properties-js",
unitTestName: "prop.tests.js"
},
// Tools
"rollupuglify": {
autoMinify: false,
path: "./tools/rollup-plugin-uglify3-js",
cfg: {
src: [
"./tools/rollup-plugin-uglify3-js/src/*.ts",
"!node_modules/**"
],
out: './tools/rollup-plugin-uglify3-js/out/src/uglify3-js.js'
},
testHttp: false
},
"rollupes3": {
autoMinify: false,
path: "./tools/rollup-es3",
unitTestName: "es3rolluptests.js",
testHttp: false
},
"shims": {
autoMinify: false,
path: "./tools/shims",
cfg: {
src: [
"./tools/shims/src/*.ts"
]
},
unitTestName: "shimstests.js",
testHttp: false
},
"chrome-debug-extension": {
autoMinify: false,
path: "./tools/chrome-debug-extension",
cfg: {
src: [
"./tools/chrome-debug-extension/src/**/*.tsx",
"./tools/chrome-debug-extension/src/**/*.ts",
]
}
},
"applicationinsights-web-snippet": {
autoMinify: false,
path: "./tools/applicationinsights-web-snippet",
cfg: {
src: [
"./tools/applicationinsights-web-snippet/dest/*.ts"
]
}
},
// Common
"tst-framework": {
autoMinify: false,
path: "./common/Tests/Framework",
cfg: {
src: [
"./common/Tests/Framework/src/*.ts"
]
}
}
}));
function tsBuildActions(name, addTests, replaceName) {
var actions = [
"eslint-ts:" + name + "-lint-fix"
];
var aiMinifyConfig = theBuildConfig["ai-minify"] || {};
var gruntTsConfig = theBuildConfig["ts"];
var replaceConfig = theBuildConfig["string-replace"] || {};
if (replaceName === true || replaceConfig[name]) {
actions.push("string-replace:" + name);
if (aiMinifyConfig[name]) {
// Make sure all translations are reversed first
actions.push("ai-minify:" + name + "-reverse");
// Attempt to compile without any translations (Validates that the original source code is fine before transforming it)
actions.push("ts:" + name);
actions.push("ai-minify:" + name);
}
// Now perform the "real" final compile after minification
actions.push("ts:" + name);
if (addTests && gruntTsConfig[name + "-tests"]) {
actions.push("ts:" + name + "-tests");
}
if (aiMinifyConfig[name + "-reverse"]) {
actions.push("ai-minify:" + name + "-reverse");
}
actions.push("string-replace:" + name + "-reverse");
} else {
if (aiMinifyConfig[name]) {
// Attempt to compile without any translations (Validates that the original source code is fine before transforming it)
actions.push("ts:" + name);
actions.push("ai-minify:" + name);
}
// Now perform the "real" final compile after minification
actions.push("ts:" + name);
if (addTests && gruntTsConfig[name + "-tests"]) {
actions.push("ts:" + name + "-tests");
}
if (aiMinifyConfig[name + "-reverse"]) {
actions.push("ai-minify:" + name + "-reverse");
}
}
actions.push("eslint-ts:" + name + "-lint");
return actions;
}
function tsTestActions(name, minifySrc, compileSrc) {
var gruntTsConfig = theBuildConfig["ts"];
var aiMinifyConfig = theBuildConfig["ai-minify"] || {};
var actions = [
"connect"
];
var replaceConfig = theBuildConfig["string-replace"] || {};
if (replaceConfig[name]) {
actions.push("string-replace:" + name);
}
if (aiMinifyConfig[name]) {
if (minifySrc) {
// Attempt to compile with translations (Validates that the original source code is fine before transforming it)
actions.push("ai-minify:" + name);
} else if (aiMinifyConfig[name + "-reverse"]){
// Attempt to compile without any translations (Validates that the original source code is fine before transforming it)
actions.push("ai-minify:" + name + "-reverse");
}
if (compileSrc && gruntTsConfig[name]) {
actions.push("ts:" + name);
}
}
// If this helper is called then these should always exist
actions.push("ts:" + name + "-tests");
actions.push("qunit:" + name);
if (minifySrc && aiMinifyConfig[name + "-reverse"]) {
actions.push("ai-minify:" + name + "-reverse");
}
if (replaceConfig[name]) {
actions.push("string-replace:" + name + "-reverse");
}
return actions;
}
function minTasks(name) {
var actions = [
];
var aiMinifyConfig = theBuildConfig["ai-minify"] || {};
if (aiMinifyConfig[name]) {
actions.push("ai-minify:" + name);
}
return actions;
}
function restoreTasks(name) {
var actions = [
];
var aiMinifyConfig = theBuildConfig["ai-minify"] || {};
if (aiMinifyConfig[name + "-reverse"]) {
actions.push("ai-minify:" + name + "-reverse");
}
return actions;
}
grunt.initConfig(deepMerge(
theBuildConfig, {
uglify: {
snippetvNext: {
files: {
'AISKU/snippet/snippet.min.js': ['AISKU/snippet/snippet.js']
},
options: {
sourceMap: false,
ie8: true,
compress: {
passes:3,
unsafe: true,
},
output: {
webkit:true
}
}
}
},
'string-replace': {
'generate-snippet': generateNewSnippet()
}
}));
grunt.event.on('qunit.testStart', function (name) {
grunt.log.ok('Running test: ' + name);
});
grunt.loadNpmTasks("@nevware21/grunt-ts-plugin");
grunt.loadNpmTasks("@nevware21/grunt-eslint-ts");
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-string-replace');
grunt.loadTasks('./tools/grunt-tasks');
grunt.registerTask("default", ["ts:rollupuglify", "ts:rollupes3", "ts:rollupes3test", "qunit:rollupes3", "ts:shims", "ts:shimstest", "qunit:shims", "ts:default", "uglify:ai", "uglify:snippet"]);
grunt.registerTask("core", tsBuildActions("core"));
grunt.registerTask("core-min", minTasks("core"));
grunt.registerTask("core-restore", restoreTasks("core"));
grunt.registerTask("coreunittest", tsTestActions("core"));
grunt.registerTask("core-mintest", tsTestActions("core", true));
grunt.registerTask("coreperftest", ["connect", "ts:core-perftest", "qunit:core-perf"]);
grunt.registerTask("common", tsBuildActions("common"));
grunt.registerTask("common-min", minTasks("common"));
grunt.registerTask("common-restore", restoreTasks("common"));
grunt.registerTask("commontest", tsTestActions("common"));
grunt.registerTask("common-mintest", tsTestActions("common", true));
grunt.registerTask("ai", tsBuildActions("appinsights"));
grunt.registerTask("ai-min", minTasks("appinsights"));
grunt.registerTask("ai-restore", restoreTasks("appinsights"));
grunt.registerTask("aitests", tsTestActions("appinsights"));
grunt.registerTask("ai-mintests", tsTestActions("appinsights", true));
grunt.registerTask("aisku", tsBuildActions("aisku"));
grunt.registerTask("aisku-min", minTasks("aisku"));
grunt.registerTask("aisku-restore", restoreTasks("aisku"));
grunt.registerTask("aiskuunittests", tsTestActions("aisku"));
grunt.registerTask("aisku-mintests", tsTestActions("aisku", true));
grunt.registerTask("aiskuperf", ["connect", "ts:aisku-perftest", "qunit:aisku-perf"]);
grunt.registerTask("aiskulite", tsBuildActions("aiskulite"));
grunt.registerTask("aiskulite-min", minTasks("aiskulite"));
grunt.registerTask("aiskulite-restore", restoreTasks("aiskulite"));
grunt.registerTask("aiskuliteunittests", tsTestActions("aiskulite"));
grunt.registerTask("aiskulite-mintests", tsTestActions("aiskulite", true));
grunt.registerTask("snippetvnext", ["uglify:snippetvNext"]);
grunt.registerTask("test", ["connect", "ts:default", "ts:test", "ts:testSchema", "ts:testE2E", "qunit:all"]);
grunt.registerTask("test1ds", ["coretest", "common", "propertiestests", "depstest", "aitests", "aiskutests"]);
grunt.registerTask("perfmarkmeasure", tsBuildActions("perfmarkmeasure"));
grunt.registerTask("perfmarkmeasure-min", minTasks("perfmarkmeasure"));
grunt.registerTask("perfmarkmeasure-restore", restoreTasks("perfmarkmeasure"));
grunt.registerTask("perfmarkmeasuretests", tsTestActions("perfmarkmeasure"));
grunt.registerTask("perfmarkmeasure-mintests", tsTestActions("perfmarkmeasure", true));
grunt.registerTask("properties", tsBuildActions("properties"));
grunt.registerTask("properties-min", minTasks("properties"));
grunt.registerTask("properties-restore", restoreTasks("properties"));
grunt.registerTask("propertiestests", tsTestActions("properties"));
grunt.registerTask("properties-mintests", tsTestActions("properties", true));
grunt.registerTask("deps", tsBuildActions("deps"));
grunt.registerTask("deps-min", minTasks("deps"));
grunt.registerTask("deps-restore", restoreTasks("deps"));
grunt.registerTask("depstest", tsTestActions("deps"));
grunt.registerTask("deps-mintest", tsTestActions("deps", true));
grunt.registerTask("debugplugin", tsBuildActions("debugplugin"));
grunt.registerTask("debugplugin-min", minTasks("debugplugin"));
grunt.registerTask("debugplugin-restore", restoreTasks("debugplugin"));
grunt.registerTask("aichannel", tsBuildActions("aichannel"));
grunt.registerTask("aichannel-min", minTasks("aichannel"));
grunt.registerTask("aichannel-restore", restoreTasks("aichannel"));
grunt.registerTask("aichanneltest", tsTestActions("aichannel"));
grunt.registerTask("aichannel-mintest", tsTestActions("aichannel", true));
grunt.registerTask("rollupuglify", tsBuildActions("rollupuglify"));
grunt.registerTask("rollupes3", tsBuildActions("rollupes3").concat(["ts:rollupes3-tests", "qunit:rollupes3"]));
grunt.registerTask("rollupes3test", [ "ts:rollupes3-tests", "qunit:rollupes3" ]);
grunt.registerTask("shims", tsBuildActions("shims").concat(["ts:shims-tests", "qunit:shims"]));
grunt.registerTask("shimstest", ["ts:shims-tests", "qunit:shims"]);
grunt.registerTask("chromedebugextension", tsBuildActions("chrome-debug-extension"));
grunt.registerTask("chromedebugextension-min", minTasks("chrome-debug-extension"));
grunt.registerTask("chromedebugextension-restore", restoreTasks("chrome-debug-extension"));
grunt.registerTask("websnippetReplace", ["string-replace:generate-snippet"]);
grunt.registerTask("websnippet", tsBuildActions("applicationinsights-web-snippet"));
grunt.registerTask("clickanalytics", tsBuildActions("clickanalytics"));
grunt.registerTask("clickanalytics-min", minTasks("clickanalytics"));
grunt.registerTask("clickanalytics-restore", restoreTasks("clickanalytics"));
grunt.registerTask("clickanalyticstests", tsTestActions("clickanalytics"));
grunt.registerTask("clickanalytics-mintests", tsTestActions("clickanalytics", true));
grunt.registerTask("tst-framework", tsBuildActions("tst-framework"));
grunt.registerTask("serve", ["connect:server:keepalive"]);
} catch (e) {
console.error(e);
console.error("stack: '" + e.stack + "', message: '" + e.message + "', name: '" + e.name + "'");
}
};