0c8d6869 by Adam Heath

Allow for mainDirs, viewDirs, and modelDirs to be specified.

1 parent 9a528e55
......@@ -240,7 +240,7 @@ module.exports = function (grunt) {
function jscheckerAddExtra(src, container, dest) {
if (src) {
container[dest] = container[dest].concat(src);
container[dest] = (container[dest] || []).concat(src);
}
}
function createJschecker(name, browserOptions, modelOptions, viewOptions) {
......@@ -254,27 +254,27 @@ module.exports = function (grunt) {
],
main: {
options: _.extend({}, mpConfig[name].browserOptions, browserOptions),
files: {
src: [
mpConfig.base + '/scripts/*.js',
],
},
files: _.map(_.concat([], mpConfig.mainDirs), function (value) {
return {
src: mpConfig.base + '/scripts/' + value + '/{,**/}*.js',
};
}),
},
model: {
options: _.extend({}, mpConfig[name].modelOptions, modelOptions, mpConfig[name].browserOptions, browserOptions),
files: {
src: [
mpConfig.base + '/scripts/' + mpConfig.modelDir + '/**/*.js',
],
},
files: _.map(_.concat([mpConfig.modelDir], mpConfig.modelDirs), function (value) {
return {
src: mpConfig.base + '/scripts/' + value + '/{,**/}*.js',
};
}),
},
view: {
options: _.extend({}, mpConfig[name].viewOptions, viewOptions, mpConfig[name].browserOptions, browserOptions),
files: {
src: [
mpConfig.base + '/scripts/' + mpConfig.viewDir + '/**/*.js',
],
},
files: _.map(_.concat([mpConfig.viewDir], mpConfig.viewDirs), function (value) {
return {
src: mpConfig.base + '/scripts/' + value + '/{,**/}*.js',
};
}),
},
};
jscheckerAddExtra(mpConfig[name].all, initConfig[name], 'all');
......