-
Notifications
You must be signed in to change notification settings - Fork 185
/
gulpfile.js
57 lines (50 loc) · 1.05 KB
/
gulpfile.js
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
50
51
52
53
54
55
56
57
import gulp from 'gulp';
import gulpESlint from 'gulp-eslint';
import gulpMocha from 'gulp-mocha';
import runSequence from 'run-sequence';
const IGNOREDDIRS = ['!**/node_modules/**'];
const SRCDIR = 'src';
const EXAMPLESDIR = 'examples';
const SPECDIR = 'spec';
gulp.task('lint', () => gulp
.src([
`${SRCDIR}/**/*.js`,
`${SPECDIR}/**/*.js`,
`${EXAMPLESDIR}/**/*.js`,
'gulpfile.js',
...IGNOREDDIRS,
])
.pipe(gulpESlint())
.pipe(gulpESlint.format())
.pipe(gulpESlint.failAfterError()),
);
gulp.task('spec', () =>
gulp.src([
`${SPECDIR}/**/*.spec.js`,
])
.pipe(gulpMocha({
reporter: 'spec',
ui: 'bdd',
})));
gulp.task('copy', () =>
gulp.src([
`${SRCDIR}/**/*.js`,
])
.pipe(gulp.dest(
`examples/Simple/node_modules/react-native-foldview/${SRCDIR}`,
)),
);
gulp.task('default', done => {
runSequence(
'spec',
'lint',
done,
);
});
gulp.task('watch', () => {
gulp.watch([
`${SRCDIR}/**/*`,
`${SPECDIR}/**/*`,
'gulpfile.js',
], ['copy', 'default']);
});