YellowLabTools/Gruntfile.js

137 lines
3.7 KiB
JavaScript
Raw Normal View History

2014-08-07 17:27:32 +00:00
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
2014-09-04 14:15:24 +00:00
font: {
icons: {
src: ['app/public/fonts/svg-icons/*.svg'],
destCss: 'app/public/styles/less/icons.less',
destFonts: 'app/public/fonts/icons.woff',
// Optional: Custom routing of font filepaths for CSS
cssRouter: function (fontpath) {
var pathArray = fontpath.split('/');
var fileName = pathArray[pathArray.length - 1];
return '/public/fonts/' + fileName;
}
}
},
less: {
2014-09-26 21:22:43 +00:00
all: {
files: {
'app/public/styles/main.css': [ 'app/public/styles/less/main.less' ],
'app/public/styles/index.css': [ 'app/public/styles/less/index.less' ],
'app/public/styles/launchTest.css': [ 'app/public/styles/less/launchTest.less' ],
'app/public/styles/results.css': [ 'app/public/styles/less/results.less' ]
}
2014-09-04 14:15:24 +00:00
}
},
2014-08-07 17:27:32 +00:00
jshint: {
all: [
'*.js',
'app/lib/*.js',
'bin/*.js',
'lib/**/*.js',
2014-08-07 17:27:32 +00:00
'app/nodeControllers/*.js',
'app/public/scripts/*.js',
'phantomas_custom/**/*.js'
]
2014-09-03 07:06:35 +00:00
},
clean: {
2014-09-04 14:15:24 +00:00
icons: {
src: ['tmp']
},
2014-09-03 07:06:35 +00:00
coverage: {
src: ['coverage/']
}
},
copy: {
coverage: {
2014-11-28 16:22:32 +00:00
files: [
{src: ['test/**'], dest: 'coverage/'},
{src: ['lib/metadata/**'], dest: 'coverage/'}
]
2014-09-03 07:06:35 +00:00
}
},
blanket: {
coverageApp: {
2014-09-03 07:06:35 +00:00
src: ['app/'],
dest: 'coverage/app/'
},
coverageLib: {
src: ['lib/'],
dest: 'coverage/lib/'
2014-09-03 07:06:35 +00:00
}
},
mochaTest: {
test: {
options: {
reporter: 'spec',
},
src: ['coverage/test/api/*.js']
},
'test-current-work': {
options: {
reporter: 'spec',
},
2014-11-28 16:22:32 +00:00
src: ['coverage/test/api/yellowlabtoolsTest.js']
2014-09-03 07:06:35 +00:00
},
coverage: {
options: {
reporter: 'html-cov',
quiet: true,
captureFile: 'coverage/coverage.html'
},
src: ['coverage/test/api/*.js']
}
},
express: {
test: {
options: {
port: 8388,
bases: 'test/www'
}
2014-09-03 07:06:35 +00:00
}
2014-08-07 17:27:32 +00:00
}
});
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
grunt.registerTask('icons', [
2014-09-04 14:15:24 +00:00
'font:icons',
'less',
2014-09-04 14:15:24 +00:00
'clean:icons'
]);
2014-08-07 17:27:32 +00:00
grunt.registerTask('build', [
'less'
]);
2014-09-03 07:06:35 +00:00
grunt.registerTask('hint', [
'jshint'
]);
grunt.registerTask('test', [
'build',
'jshint',
'express:test',
'clean:coverage',
'blanket',
'copy:coverage',
'mochaTest:test',
'mochaTest:coverage'
]);
grunt.registerTask('test-current-work', [
'build',
'jshint',
'express:test',
2014-09-03 07:06:35 +00:00
'clean:coverage',
'blanket',
'copy:coverage',
'mochaTest:test-current-work'
2014-09-03 07:06:35 +00:00
]);
2014-08-07 17:27:32 +00:00
};