123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- module.exports = function(grunt) {
- // Project configuration.
- grunt.initConfig({
- pkg: grunt.file.readJSON('package.json'),
-
- 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: {
- 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' ]
- }
- }
- },
- jshint: {
- all: [
- '*.js',
- 'app/lib/*',
- 'app/nodeControllers/*.js',
- 'app/public/scripts/*.js',
- 'phantomas_custom/**/*.js'
- ]
- },
- clean: {
- icons: {
- src: ['tmp']
- },
- coverage: {
- src: ['coverage/']
- }
- },
- copy: {
- coverage: {
- src: ['test/**'],
- dest: 'coverage/'
- }
- },
- blanket: {
- coverage: {
- src: ['app/'],
- dest: 'coverage/app/'
- }
- },
- mochaTest: {
- test: {
- options: {
- reporter: 'spec',
- },
- src: ['coverage/test/server/*.js']
- },
- coverage: {
- options: {
- reporter: 'html-cov',
- // use the quiet flag to suppress the mocha console output
- quiet: true,
- // specify a destination file to capture the mocha
- // output (the quiet option does not suppress this)
- captureFile: 'coverage/coverage.html'
- },
- src: ['coverage/test/server/*.js']
- }
- }
- });
- require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
- grunt.registerTask('icons', [
- 'font:icons',
- 'less',
- 'clean:icons'
- ]);
- grunt.registerTask('build', [
- 'jshint',
- 'less'
- ]);
- grunt.registerTask('hint', [
- 'jshint'
- ]);
- grunt.registerTask('test', [
- 'clean:coverage',
- 'blanket',
- 'copy:coverage',
- 'mochaTest'
- ]);
- };
|