-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
73 lines (64 loc) · 1.33 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
const gulp = require('gulp');
const mocha = require('gulp-mocha');
const lint = require('gulp-eslint');
const ts = require('gulp-typescript');
const sources =
[
'./*.js',
'./src/*.js',
'./test/*.js',
'./finance/**/*.js',
'./lemke-howson/**/*.js',
'./minmax/**/*.js',
'./montecarlo/**/*.js'
];
const tsSources =
[
'./*.ts',
'./src/*.ts',
'./test/*.ts',
'./finance/**/*.ts',
'./lemke-howson/**/*.ts',
'./minmax/**/*.ts',
'./montecarlo/**/*.ts'
];
const tests =
[
'./test/*.js',
'./src/test/*.js',
'./finance/test/*.js',
'./lemke-howson/test/*.js',
'./minmax/test/*.js',
'./montecarlo/test/*.js'
];
gulp.task('lint', () =>
{
return gulp.src(sources)
.pipe(lint({}))
.pipe(lint.format());
});
gulp.task('tsx', () =>
{
return gulp.src(tsSources)
.pipe(ts({
noImplicitAny: false
}))
.pipe(gulp.dest('built/local'));
});
gulp.task('test', gulp.series('lint', () =>
{
return gulp.src(tests, { read: false })
.pipe(mocha({
reporter: 'spec',
globals: {}
}));
}));
gulp.task('default', gulp.series(['lint', 'tsx', 'test'], (done) => { done() }));
gulp.task('watch', () =>
{
gulp.watch(sources, () =>
{
gulp.run('lint');
gulp.run('test');
});
});