HackMyResume/Gruntfile.js

113 lines
2.5 KiB
JavaScript
Raw Normal View History

2015-10-26 16:30:00 +00:00
module.exports = function (grunt) {
2015-12-10 02:44:18 +00:00
'use strict';
2015-10-26 16:30:00 +00:00
var opts = {
pkg: grunt.file.readJSON('package.json'),
2016-01-25 15:34:57 +00:00
copy: {
main: {
expand: true,
cwd: 'src',
src: ['**/*','!**/*.coffee'],
2016-01-27 10:29:26 +00:00
dest: 'dist/',
}
2016-01-25 15:34:57 +00:00
},
coffee: {
main: {
2016-02-02 02:14:36 +00:00
options: {
sourceMap: true
},
2016-01-25 15:34:57 +00:00
expand: true,
cwd: 'src',
src: ['**/*.coffee'],
2016-01-25 15:34:57 +00:00
dest: 'dist/',
ext: '.js'
}
},
2015-10-26 16:30:00 +00:00
simplemocha: {
options: {
globals: ['expect', 'should'],
timeout: 3000,
ignoreLeaks: false,
ui: 'bdd',
reporter: 'spec'
},
all: { src: ['test/*.js'] }
2015-11-21 08:10:11 +00:00
},
2018-02-12 05:05:29 +00:00
// jsdoc : {
// dist : {
// src: ['src/**/*.js'],
// options: {
// private: true,
// destination: 'doc'
// }
// }
// },
2016-01-18 02:46:58 +00:00
2016-01-25 15:55:25 +00:00
clean: {
test: ['test/sandbox'],
dist: ['dist']
},
2015-12-18 20:33:18 +00:00
2018-02-12 05:05:29 +00:00
// yuidoc: {
// compile: {
// name: '<%= pkg.name %>',
// description: '<%= pkg.description %>',
// version: '<%= pkg.version %>',
// url: '<%= pkg.homepage %>',
// options: {
// paths: 'src/',
// outdir: 'docs/'
// }
// }
// },
2015-12-10 02:44:18 +00:00
jshint: {
options: {
laxcomma: true,
expr: true,
2018-02-12 05:05:29 +00:00
eqnull: true,
esversion: 6
2015-12-10 02:44:18 +00:00
},
2016-01-27 10:29:26 +00:00
all: ['Gruntfile.js', 'dist/cli/**/*.js', 'test/*.js']
2015-10-26 16:30:00 +00:00
}
};
grunt.initConfig( opts );
2016-01-25 15:34:57 +00:00
grunt.loadNpmTasks('grunt-contrib-coffee');
grunt.loadNpmTasks('grunt-contrib-copy');
2015-10-26 16:30:00 +00:00
grunt.loadNpmTasks('grunt-simple-mocha');
2018-02-12 05:05:29 +00:00
//grunt.loadNpmTasks('grunt-contrib-yuidoc');
//grunt.loadNpmTasks('grunt-jsdoc');
2015-12-10 02:44:18 +00:00
grunt.loadNpmTasks('grunt-contrib-jshint');
2015-12-18 20:33:18 +00:00
grunt.loadNpmTasks('grunt-contrib-clean');
2015-12-10 02:44:18 +00:00
2016-01-25 15:55:25 +00:00
// Use 'grunt test' for local testing
2016-01-25 15:34:57 +00:00
grunt.registerTask('test', 'Test the HackMyResume application.',
function( config ) {
2018-02-12 05:05:29 +00:00
grunt.task.run(['clean:test','build',/*'jshint',*/'simplemocha:all']);
2016-01-25 15:34:57 +00:00
});
2016-01-25 15:55:25 +00:00
// Use 'grunt document' to build docs
2018-02-12 05:05:29 +00:00
// grunt.registerTask('document', 'Generate HackMyResume documentation.',
// function( config ) {
// grunt.task.run( ['jsdoc'] );
// });
2016-01-25 15:34:57 +00:00
2016-01-25 15:55:25 +00:00
// Use 'grunt build' to build HMR
2016-01-25 15:34:57 +00:00
grunt.registerTask('build', 'Build the HackMyResume application.',
function( config ) {
2016-01-25 15:55:25 +00:00
grunt.task.run( ['clean:dist','copy','coffee'] );
2016-01-25 15:34:57 +00:00
});
2016-01-25 15:55:25 +00:00
// Default task does everything
grunt.registerTask('default', [ 'test', 'document' ]);
2015-10-26 16:30:00 +00:00
};