forked from BroadSoft-Xtended/Product-Phone-for-Chrome
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
33 lines (27 loc) · 812 Bytes
/
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
module.exports = function(grunt) {
var includeAll;
includeAll = require('include-all');
function loadTasks(relPath) {
return includeAll({
dirname: require('path').resolve(__dirname, relPath),
filter: /(.+)\.js$/
}) || {};
}
function invokeConfigFn(tasks) {
for (var taskName in tasks) {
if (tasks.hasOwnProperty(taskName)) {
tasks[taskName](grunt);
}
}
}
// Load task functions
var taskConfigurations = loadTasks('tasks/config'),
registerDefinitions = loadTasks('tasks/register');
// (ensure that a default task exists)
if (!registerDefinitions.default) {
registerDefinitions.default = function (grunt) { grunt.registerTask('default', []); };
}
// Run task functions to configure Grunt.
invokeConfigFn(taskConfigurations);
invokeConfigFn(registerDefinitions);
};