forked from ghafran/ptz
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
49 lines (41 loc) · 1.17 KB
/
gulpfile.js
File metadata and controls
49 lines (41 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
'use strict';
var $ = require('gulp-load-plugins')(),
gulp = require('gulp'),
chalk = require('chalk'),
runSequence = require('run-sequence');
gulp.task('default', function () {
runSequence(
'lint', 'unit', 'watch'
);
});
gulp.task('test', function () {
runSequence(
'lint', 'unit'
);
});
gulp.task('lint', function () {
return gulp.src(['**/*.js', '!node_modules/**/*'])
.pipe($.jshint('.jshintrc'))
.pipe($.jshint.reporter('jshint-stylish'))
.pipe($.jshint.reporter('fail'));
});
gulp.task('unit', function () {
return gulp
.src(['test/**/*.js', '!node_modules/**/*'])
.pipe($.mocha({
reporter: 'spec'
}));
});
gulp.task('build', $.shell.task(['node-gyp build']));
gulp.task('watch', function () {
gulp.watch(['lib/*.cc'], {
interval: 200
}, ['build']).on('change', function (file) {
console.log(chalk.underline.bold.blue(file.path), 'changed');
});
gulp.watch(['lib/*.js', 'test/**/*.js'], {
interval: 200
}, ['unit']).on('change', function (file) {
console.log(chalk.underline.bold.blue(file.path), 'changed');
});
});