70cae3c75da162e293274bc7d53dc3f14c690c81
[platform/framework/web/crosswalk-tizen.git] /
1 (function() {
2   var ESLINT_OPTION, SOURCE, eslint, gulp, minimist, mocha;
3
4   gulp = require('gulp');
5
6   mocha = require('gulp-mocha');
7
8   eslint = require('gulp-eslint');
9
10   minimist = require('minimist');
11
12   require('coffee-script/register');
13
14   SOURCE = ['*.js'];
15
16   ESLINT_OPTION = {
17     rules: {
18       'quotes': 0,
19       'eqeqeq': 0,
20       'no-use-before-define': 0,
21       'no-shadow': 0,
22       'no-new': 0,
23       'no-underscore-dangle': 0,
24       'no-multi-spaces': false,
25       'no-native-reassign': 0,
26       'no-loop-func': 0
27     },
28     env: {
29       'node': true
30     }
31   };
32
33   gulp.task('test', function() {
34     var options;
35     options = minimist(process.argv.slice(2), {
36       string: 'test',
37       "default": {
38         test: 'test/*.coffee'
39       }
40     });
41     return gulp.src(options.test).pipe(mocha({
42       reporter: 'spec'
43     }));
44   });
45
46   gulp.task('lint', function() {
47     return gulp.src(SOURCE).pipe(eslint(ESLINT_OPTION)).pipe(eslint.formatEach('stylish', process.stderr)).pipe(eslint.failOnError());
48   });
49
50   gulp.task('travis', ['lint', 'test']);
51
52   gulp.task('default', ['travis']);
53
54 }).call(this);