forked from fluid-project/infusion
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGruntfile.js
749 lines (712 loc) · 28.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
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
/*
Copyright The Infusion copyright holders
See the AUTHORS.md file at the top-level directory of this distribution and at
https://github.com/fluid-project/infusion/raw/master/AUTHORS.md.
Licensed under the Educational Community License (ECL), Version 2.0 or the New
BSD license. You may not use this file except in compliance with one these
Licenses.
You may obtain a copy of the ECL 2.0 License and BSD License at
https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
*/
/* eslint-env node */
"use strict";
var _ = require("lodash");
var execSync = require("child_process").execSync;
/**
* Returns a string result from executing a supplied command.
* The command is executed synchronosly.
*
* @param {String} command - the command to execute
* @param {Object} options - optional arguments "verbose" will output a full stack trace when an error occurs,
* "defaultValue" will set the default return value, useful in case of errors or when a result may be an empty string.
* @return {String} - returns a string representation of the result of the command or the defaultValue.
*/
var getFromExec = function (command, options) {
var result = options.defaultValue;
var stderr = options.verbose ? "pipe" : "ignore";
try {
result = execSync(command, {stdio: ["pipe", "pipe", stderr]});
} catch (e) {
if (options.verbose) {
console.log("Error executing command: " + command);
console.log(e.stack);
}
}
return result;
};
/**
* Adds '.min' convention in front of the first period of a filename string
* Example results:
* infusion-all.js -> infusion-all.min.js
* infusion-all.js.map -> infusion-all.min.js.map
* @param {String} fileName - filename string to add '.min' to
* @return {String} The modified filename string.
*/
var addMin = function (fileName) {
var segs = fileName.split(".");
var min = "min";
if (segs[0] && segs.indexOf(min) < 0 ) {
segs.splice(1, 0, min);
}
return segs.join(".");
};
/**
* Rename function for grunt file tasks for adding ".min" convention
* to filename string; won't do anything to strings that already
* include ".min"
* @param {String} dest - supplied by Grunt task, see http://gruntjs.com/configuring-tasks#the-rename-property
* @param {String} src - supplied by Grunt task, see http://gruntjs.com/configuring-tasks#the-rename-property\
* @return {String} - The minified version of the original filename.
*/
var addMinifyToFilename = function (dest, src) {
return dest + addMin(src);
};
module.exports = function (grunt) {
var setBuildSettings = function (settings) {
grunt.config.set("buildSettings", {}); // delete previous settings
_.forEach(settings, function (value, setting) {
var settingPath = ["buildSettings", setting].join(".");
grunt.config.set(settingPath, value);
});
};
/** Verifies that directory contains the files in fileList and
* returns a report for further processing
* @param {Array} fileList - array of string filenames to check, including full directory paths
* @return {Object} A report structure for further processing.
*/
var verifyFiles = function (fileList) {
var report = {
fileList: {},
missingFiles: 0,
expectedFiles: fileList.length
};
_.forEach(fileList, function (fileName) {
var fileExists = grunt.file.exists(fileName);
if (!fileExists) {
report.missingFiles = report.missingFiles + 1;
}
report.fileList[fileName] = {"present": fileExists};
});
return report;
};
/** Displays a file verification report generated by verifyFiles
* @param {Object} report - the report to display
*/
var displayVerifyFilesReport = function (report) {
_.forEach(report.fileList, function (value, fileName) {
var fileExists = value.present;
if (fileExists) {
grunt.log.oklns(fileName + " - ✓ Present".green);
} else {
grunt.log.errorlns(fileName + " - ✗ Missing".red);
}
});
};
/** Processes a file verification report, and fails the build if
* any files are missing
* @param {Object} report - the report to process
*/
var processVerifyFilesReport = function (report) {
if (report.missingFiles > 0) {
grunt.log.error("Verification failed".red);
grunt.fail.fatal(report.missingFiles + " out of " + report.expectedFiles + " expected files not found");
} else {
grunt.log.ok("Verification passed".green);
grunt.log.oklns(report.expectedFiles + " out of " + report.expectedFiles + " expected files were present");
}
};
/** Common function for use by verifyDistFiles task
*
*
* @param {String} message - message to be displayed when running the verify files tasks
* @param {Array} expectedFilenames - array of expected file names
* @param {String} fileDir - base directory expected to contain files
*/
var verifyFilesTaskFunc = function (message, expectedFilenames) {
grunt.log.subhead(message);
var report = verifyFiles(expectedFilenames);
displayVerifyFilesReport(report);
processVerifyFilesReport(report);
};
var verifyFilesListCSSRenameFunc = function (dest, src) {
var replaced = dest + src.replace("styl", "css");
return replaced;
};
var verifyFilesListMinifiedCSSRenameFunc = function (dest, src) {
var replaced = dest + src.replace("styl", "min.css");
return replaced;
};
/** verifyFilesListFunc for building a file list of all expected distribution .js and .map files
* @return {Array} expectedFileNames - the array of expected file names (strings)
*/
var verifyFilesListJSDistributions = function () {
var distributions = grunt.config.get("distributions");
var expectedFilenames = _.flatten(_.map(distributions, function (value, distribution) {
var jsFilename = "infusion-" + distribution + ".js";
var mapFilename = jsFilename + ".map";
var distDirectory = "dist/";
return [distDirectory + jsFilename, distDirectory + mapFilename];
}));
return expectedFilenames;
};
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),
revision: getFromExec("git rev-parse --verify --short HEAD", {defaultValue: "Unknown revision, not within a git repository"}),
branch: getFromExec("git rev-parse --abbrev-ref HEAD", {defaultValue: "Unknown branch, not within a git repository"}),
allBuildName: "<%= pkg.name %>-all",
buildSettings: {}, // set by the build tasks
customBuildName: "<%= pkg.name %>-<%= buildSettings.name %>",
banner: "/*!\n <%= pkg.name %> - v<%= pkg.version %>\n <%= grunt.template.today('dddd, mmmm dS, yyyy, h:MM:ss TT') %>\n branch: <%= branch %> revision: <%= revision %>*/\n",
clean: {
build: "build",
products: "products",
stylus: ["src/components/switch/css/*.css", "src/framework/preferences/css/*.css"],
stylusDist: "dist/assets/**/stylus", // removes the empty stylus directory from the distribution
ciArtifacts: ["*.tap"],
dist: "dist",
postBuild: {
files: [{}]
},
dependencies: [
"src/lib/hypher",
"src/lib/jquery/core",
"src/lib/jquery/plugins",
"src/lib/jquery/ui/js",
"src/lib/normalize",
"src/lib/open-dyslexic",
"src/lib/opensans",
"src/lib/roboto",
"src/lib/url-polyfill",
"tests/lib/jquery-simulate",
"tests/lib/sinon"
]
},
copy: {
all: {
files: [{
expand: true,
src: ["src/**", "tests/**", "demos/**", "examples/**"],
dest: "build/"
}]
},
custom: {
files: [{
expand: true,
src: "<%= modulefiles.custom.output.dirs %>",
dest: "build/"
}]
},
necessities: {
files: [{
src: ["README.*", "ReleaseNotes.*", "Infusion-LICENSE.*"],
dest: "build/"
}, {
// The jQuery license file needs to be copied explicitly since
// "src/lib/jQuery" directory contains several jQuery modules
// that have individual dependencies.json files.
src: "src/lib/jQuery/jQuery-LICENSE.txt",
dest: "build/lib/jQuery/jQuery-LICENSE.txt",
filter: function () {
return grunt.file.exists("build/lib/jQuery/");
}
}]
},
distJS: {
files: [{
expand: true,
cwd: "build/",
src: "<%= allBuildName %>.*",
dest: "dist/",
rename: function (dest, src) {
return grunt.config.get("buildSettings.compress") ? addMinifyToFilename(dest, src) : dest + src;
}
}, {
expand: true,
cwd: "build/",
src: "<%= customBuildName %>.*",
dest: "dist/",
rename: function (dest, src) {
return grunt.config.get("buildSettings.compress") ? addMinifyToFilename(dest, src, "js") : dest + src;
}
}]
},
distAssets: {
files: [{
expand: true,
cwd: "build/",
src: ["src/framework/preferences/fonts/**", "src/framework/preferences/images/**", "src/lib/open-dyslexic/**", "src/lib/opensans/**"],
dest: "dist/assets/"
}]
},
dependencies: {
files: [{
src: "node_modules/hypher/dist/jquery.hypher.js",
dest: "src/lib/hypher/",
expand: true,
flatten: true
}, {
src: "node_modules/@fluid-project/hyphenation-patterns/dist/browser/*",
dest: "src/lib/hypher/patterns/",
expand: true,
flatten: true
}, {
src: "node_modules/jquery/dist/jquery.js",
dest: "src/lib/jquery/core/js/",
expand: true,
flatten: true
}, {
src: "node_modules/jquery.scrollto/jquery.scrollTo.js",
dest: "src/lib/jquery/plugins/scrollTo/js/",
expand: true,
flatten: true
}, {
src: "node_modules/jquery-simulate/jquery.simulate.js",
dest: "tests/lib/jquery-simulate/js/",
expand: true,
flatten: true
}, {
src: "node_modules/jquery-ui-touch-punch/jquery.ui.touch-punch.js",
dest: "src/lib/jquery/plugins/touchPunch/js/",
expand: true,
flatten: true
}, {
src: [
"node_modules/jquery-ui/themes/base/images/*.png"
],
dest: "src/lib/jquery/ui/css/default-theme/images",
expand: true,
flatten: true
}, {
src: [
"node_modules/jquery-ui/themes/base/core.css",
"node_modules/jquery-ui/themes/base/theme.css",
"node_modules/jquery-ui/themes/base/tooltip.css"
],
dest: "src/lib/jquery/ui/css/default-theme/",
expand: true,
flatten: true
}, {
src: [
"node_modules/jquery-ui/ui/version.js",
"node_modules/jquery-ui/ui/widget.js",
"node_modules/jquery-ui/ui/plugin.js",
"node_modules/jquery-ui/ui/safe-active-element.js",
"node_modules/jquery-ui/ui/safe-blur.js",
"node_modules/jquery-ui/ui/position.js",
"node_modules/jquery-ui/ui/data.js",
"node_modules/jquery-ui/ui/keycode.js",
"node_modules/jquery-ui/ui/scroll-parent.js",
"node_modules/jquery-ui/ui/unique-id.js",
"node_modules/jquery-ui/ui/widgets/mouse.js",
"node_modules/jquery-ui/ui/widgets/draggable.js",
"node_modules/jquery-ui/ui/widgets/tooltip.js"
],
dest: "src/lib/jquery/ui/js/",
expand: true,
flatten: true
}, {
src: "node_modules/normalize.css/normalize.css",
dest: "src/lib/normalize/css/",
expand: true,
flatten: true
}, {
src: "node_modules/opensans-webkit/fonts/OpenSans-*.woff",
dest: "src/lib/opensans/fonts/",
expand: true,
flatten: true
}, {
src: "node_modules/open-dyslexic/woff/OpenDyslexic-*.woff",
dest: "src/lib/open-dyslexic/fonts/",
expand: true,
flatten: true
}, {
src: "node_modules/roboto-fontface/fonts/roboto-slab/Roboto-Slab-*.woff",
dest: "src/lib/roboto/fonts/",
expand: true,
flatten: true
}, {
src: "node_modules/sinon/pkg/sinon.js",
dest: "tests/lib/sinon/js/",
expand: true,
flatten: true
}, {
src: "node_modules/url-polyfill/url-polyfill.js",
dest: "src/lib/url-polyfill/js/",
expand: true,
flatten: true
}]
}
},
uglify: {
options: {
banner: "<%= banner %>",
mangle: false,
sourceMap: true,
sourceMapIncludeSources: true
},
all: {
files: [{
src: "<%= modulefiles.all.output.files %>",
dest: "./build/<%= allBuildName %>.js"
}]
},
custom: {
files: [{
src: "<%= modulefiles.custom.output.files %>",
dest: "./build/<%= customBuildName %>.js"
}]
}
},
modulefiles: {
all: {
src: ["src/**/*Dependencies.json"]
},
custom: {
options: {
exclude: "<%= buildSettings.exclude %>",
include: "<%= buildSettings.include %>"
},
src: ["src/**/*Dependencies.json"]
}
},
map: {
// append "/**" to the end of all of all of
// directory paths for copy:custom to ensure that
// all of the subdirectories and files are copied over
copyDirs: {
files: "<%= copy.custom.files %>",
prop: "copy.custom.files.0.src",
fn: function (str) {
return str + "/**";
}
},
postBuildClean: {
files: "<%= clean.postBuild.files %>",
prop: "clean.postBuild.files.0.src",
fn: function (str) {
var buildPath = "build/";
return str.startsWith(buildPath) ? str : buildPath + str;
}
}
},
// Still need the concat task as uglify does not honour the {compress: false} option
// see: https://github.com/mishoo/UglifyJS2/issues/696
concat: {
options: {
separator: ";\n",
banner: "<%= banner %>",
sourceMap: true
},
all: {
nonull: true,
cwd: "./build/", // Src matches are relative to this path.
src: "<%= modulefiles.all.output.files %>",
dest: "./build/<%= allBuildName %>.js"
},
custom: {
nonull: true,
cwd: "./build/", // Src matches are relative to this path.
src: "<%= modulefiles.custom.output.files %>",
dest: "./build/<%= customBuildName %>.js"
}
},
compress: {
all: {
options: {
archive: "products/<%= allBuildName %>-<%= pkg.version %>.zip"
},
files: [{
expand: true, // Enable dynamic expansion.
cwd: "./build/", // Src matches are relative to this path.
src: ["**/*"], // Actual pattern(s) to match.
dest: "./infusion" // Destination path prefix in the zip package
}]
},
custom: {
options: {
archive: "products/<%= customBuildName %>-<%= pkg.version %>.zip"
},
files: "<%= compress.all.files %>"
}
},
lintAll: {
sources: {
md: [ "*.md", "!./src/**/lib/**/*.md", "!./demos/**/lib/**/*.md", "!./tests/**/lib/**/*.md"],
js: ["*.js", "!./src/**/lib/**/*.js", "!./demos/**/lib/**/*.js", "!./dist/**/*.js", "!./tests/**/lib/**/*.js", "!./tests/**/infusion-1.5.js"],
json: ["*.json", "./.nycrc", "./src/thirdPartyDependencies.json", "!./src/lib/**/*.json", "!./dist/**/*.json"],
other: ["./.*"]
}
},
stylus: {
compile: {
options: {
compress: "<%= buildSettings.compress %>",
relativeDest: ".."
},
files: [{
expand: true,
src: ["src/**/css/stylus/*.styl"],
ext: ".css"
}]
},
dist: {
options: {
compress: "<%= buildSettings.compress %>",
relativeDest: ".."
},
files: [{
expand: true,
src: ["src/**/css/stylus/*.styl"],
ext: "<% buildSettings.compress ? print('.min.css') : print('.css') %>",
dest: "dist/assets/"
}]
}
},
// grunt-contrib-watch task to watch and rebuild stylus files
// automatically when doing stylus development
watch: {
buildStylus: {
files: ["src/**/css/stylus/*.styl", "src/**/css/stylus/utils/*.styl"],
tasks: "buildStylus"
}
},
distributions:
{
"all": {},
"all.min": {
options: {
compress: true
}
},
"all-no-jquery": {
options: {
exclude: "jQuery, jQueryUI"
}
},
"all-no-jquery.min": {
options: {
exclude: "jQuery, jQueryUI",
compress: true
}
},
"framework": {
options: {
include: "framework"
}
},
"framework.min": {
options: {
include: "framework",
compress: true
}
},
"framework-no-jquery": {
options: {
include: "framework",
exclude: "jQuery, jQueryUI"
}
},
"framework-no-jquery.min": {
options: {
include: "framework",
exclude: "jQuery, jQueryUI",
compress: true
}
},
"uio": {
options: {
include: "uiOptions"
}
},
"uio.min": {
options: {
include: "uiOptions",
compress: true
}
},
"uio-no-jquery": {
options: {
include: "uiOptions",
exclude: "jQuery, jQueryUI"
}
},
"uio-no-jquery.min": {
options: {
include: "uiOptions",
exclude: "jQuery, jQueryUI",
compress: true
}
}
},
verifyDistFiles: {
fonts: {
files: [{
expand: true,
src: ["*.woff"],
cwd: "src/lib/opensans/fonts/",
dest: "dist/assets/src/lib/opensans/fonts/"
}, {
expand: true,
src: ["*.woff"],
cwd: "src/lib/open-dyslexic/fonts/",
dest: "dist/assets/src/lib/open-dyslexic/fonts/"
}, {
expand: true,
src: ["*.woff"],
cwd: "src/framework/preferences/fonts/",
dest: "dist/assets/src/framework/preferences/fonts/"
}]
},
js: {
verifyFilesListFunc: verifyFilesListJSDistributions
},
css: {
files: [
{
expand: true,
src: ["*.styl"],
cwd: "src/framework/preferences/css/stylus/",
dest: "dist/assets/src/framework/preferences/css/",
rename: verifyFilesListCSSRenameFunc
},
{
expand: true,
src: ["*.styl"],
cwd: "src/framework/preferences/css/stylus/",
dest: "dist/assets/src/framework/preferences/css/",
rename: verifyFilesListMinifiedCSSRenameFunc
},
{
expand: true,
src: ["*.styl"],
cwd: "src/components/switch/css/stylus/",
dest: "dist/assets/src/components/switch/css/",
rename: verifyFilesListCSSRenameFunc
},
{
expand: true,
src: ["*.styl"],
cwd: "src/components/switch/css/stylus/",
dest: "dist/assets/src/components/switch/css/",
rename: verifyFilesListMinifiedCSSRenameFunc
}
]
}
}
});
// Load the plugins:
grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks("grunt-contrib-clean");
grunt.loadNpmTasks("grunt-contrib-copy");
grunt.loadNpmTasks("grunt-contrib-concat");
grunt.loadNpmTasks("grunt-contrib-compress");
grunt.loadNpmTasks("grunt-modulefiles");
grunt.loadNpmTasks("grunt-contrib-stylus");
grunt.loadNpmTasks("grunt-contrib-watch");
grunt.loadNpmTasks("gpii-grunt-lint-all");
// Custom tasks:
// Simple task for transforming a property
grunt.registerMultiTask("map", "a task wrapper around the map function from lodash", function () {
var transformed = _.map(this.filesSrc, this.data.fn);
grunt.config.set(this.data.prop, transformed);
});
grunt.registerTask("pathMap", "Triggers the map task for the specified build target", function (target) {
grunt.task.run("map:postBuildClean");
if (target === "custom") {
grunt.task.run("map:copyDirs");
}
});
grunt.registerTask("setPostBuildCleanUp", "Sets the file source for post build cleanup", function (target) {
grunt.config.set("clean.postBuild.files.0.src", "<%= modulefiles." + target + ".output.files %>");
});
// Task for organizing the build
grunt.registerTask("build", "Generates a minified or source distribution for the specified build target", function (target) {
target = target || "all";
setBuildSettings({
name: grunt.option("name") || "custom",
exclude: grunt.option("exclude"),
include: grunt.option("include"),
compress: !grunt.option("source"),
target: target
});
var concatTask = grunt.config.get("buildSettings.compress") ? "uglify:" : "concat:";
var tasks = [
"clean",
"copy:dependencies",
"lint",
"stylus:compile",
"modulefiles:" + target,
"setPostBuildCleanUp:" + target,
"pathMap:" + target,
"copy:" + target,
"copy:necessities",
concatTask + target,
"compress:" + target,
"clean:postBuild"
];
grunt.task.run(tasks);
});
grunt.registerMultiTask("distributions", "Enables a project to split its files into a set of modules. A module's information is stored in a json file containing a name for the module, the files it contains, and other modules it depends on. The module files can then be accumulated into various configurations of included and excluded modules, which can be fed into other plugins (e.g. grunt-contrib-concat) for packaging.", function () {
// Merge task-specific and/or target-specific options with these defaults.
var options = this.options({
name: this.target,
source: true,
target: "all",
compress: false
});
if (options.exclude || options.include) {
options.target = "custom";
}
setBuildSettings(options);
var concatTask = options.compress ? "uglify:" : "concat:";
var tasks = [
"cleanForDist",
"stylus:dist",
"modulefiles:" + options.target,
"pathMap:" + options.target,
"copy:" + options.target,
"copy:necessities",
concatTask + options.target,
"copy:distJS",
"copy:distAssets"
];
grunt.task.run(tasks);
});
grunt.registerTask("buildDists", "Tasks to run before publishing to NPM", function (target) {
var tasks = [
"clean",
"copy:dependencies",
"lint",
"distributions" + ( target ? ":" + target : "" ),
"cleanForDist",
"verifyDistFiles",
"buildStylus" // put back stylus files needed for development
];
grunt.task.run(tasks);
});
grunt.registerMultiTask("verifyDistFiles", "Verify distribution files", function () {
var message = "Verifying all \"" + this.target + "\" files are in /dist";
var expectedFiles;
// If the target uses the standard Grunt file options
if (this.files.length > 1) {
expectedFiles = _.map(this.files, function (file) {
return file.dest;
});
// If the target has specified a custom function for generating the list of files to check
} else if (this.data.verifyFilesListFunc) {
if (typeof this.data.verifyFilesListFunc === "function") {
expectedFiles = this.data.verifyFilesListFunc();
}
} else {
grunt.log("Task target must either use standard Grunt 'file' options to produce a set of files to check or specify a 'verifyFilesListFunc' returning an array of file paths to check");
}
verifyFilesTaskFunc(message, expectedFiles);
});
grunt.registerTask("cleanForDist", ["clean:build", "clean:products", "clean:stylusDist", "clean:ciArtifacts"]);
grunt.registerTask("buildStylus", ["clean:stylus", "stylus:compile"]);
grunt.registerTask("default", ["build:all"]);
grunt.registerTask("custom", ["build:custom"]);
grunt.registerTask("lint", "Perform all standard lint checks.", ["lint-all"]);
grunt.registerTask("loadDependencies", "Load lib files from node_modules", ["clean:dependencies", "copy:dependencies"]);
};