2014-10-03 01:14:41 +08:00
|
|
|
/* jshint node: true */
|
|
|
|
'use strict';
|
|
|
|
|
2016-03-14 09:46:29 +08:00
|
|
|
module.exports = function (grunt) {
|
2016-03-13 09:21:27 +08:00
|
|
|
|
|
|
|
require('load-grunt-tasks')(grunt);
|
|
|
|
|
2014-10-03 01:14:41 +08:00
|
|
|
// configure Grunt
|
|
|
|
grunt.initConfig({
|
2016-03-13 09:21:27 +08:00
|
|
|
|
|
|
|
jscs: {
|
2016-03-14 08:12:01 +08:00
|
|
|
check: {
|
|
|
|
src: ['**/*.js', '**/*.jsx'],
|
|
|
|
options: {
|
|
|
|
config: '.jscsrc',
|
|
|
|
verbose: true,
|
|
|
|
esnext: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
fix: {
|
|
|
|
src: ['**/*.js', '**/*.jsx'],
|
|
|
|
options: {
|
|
|
|
config: '.jscsrc',
|
|
|
|
verbose: true,
|
|
|
|
esnext: true,
|
|
|
|
fix: true,
|
|
|
|
},
|
|
|
|
},
|
2016-03-13 09:21:27 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
shell: {
|
|
|
|
start_meteor: {
|
2016-03-14 09:46:29 +08:00
|
|
|
command: 'HOME=/usr/share/meteor JASMINE_SERVER_UNIT=0 JASMINE_SERVER_INTEGRATION=0 JASMINE_CLIENT_INTEGRATION=0 JASMINE_BROWSER=PhantomJS JASMINE_MIRROR_PORT=3000 ROOT_URL=http://127.0.0.1/html5client meteor',
|
|
|
|
},
|
|
|
|
},
|
2014-10-03 01:14:41 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-jshint');
|
|
|
|
grunt.loadNpmTasks('grunt-coffeelint');
|
2016-03-13 09:21:27 +08:00
|
|
|
grunt.loadNpmTasks('grunt-jscs');
|
|
|
|
grunt.loadNpmTasks('grunt-force-task');
|
2014-10-03 01:14:41 +08:00
|
|
|
|
2016-03-13 09:21:27 +08:00
|
|
|
// sets the default task to run JSCS first (forcing our way past warnings) and then start Meteor:
|
2016-03-14 08:12:01 +08:00
|
|
|
grunt.registerTask('default', ['force:jscs:check', 'shell:start_meteor']);
|
|
|
|
|
|
|
|
// sets the autofix task to fix JSCS warning when possible and then start Meteor:
|
|
|
|
grunt.registerTask('autofix', ['force:jscs:fix', 'shell:start_meteor']);
|
2014-10-03 01:14:41 +08:00
|
|
|
};
|