Repository navigation
Expand file tree
/
Copy pathgulpfile.js
More file actions
71 lines (58 loc) · 1.64 KB
/
Copy pathgulpfile.js
File metadata and controls
71 lines (58 loc) · 1.64 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
'use strict';
const gulp = require('gulp');
const jshint = require('gulp-jshint');
const jscs = require('gulp-jscs');
const stylish = require('gulp-jscs-stylish');
const replace = require('gulp-replace');
const touch = require('gulp-touch');
const shell = require('gulp-shell');
let tests =
[
'test/test_mediasoup.js',
'test/test_Server.js',
'test/test_Room.js',
'test/test_Peer.js',
'test/test_Transport.js',
'test/test_RtpReceiver.js',
'test/test_extra.js'
// NOTE: Disable this test until fixed
// 'test/test_scene_1.js'
];
gulp.task('lint', () =>
{
let src = [ 'gulpfile.js', 'lib/**/*.js', 'data/**/*.js', 'test/**/*.js' ];
return gulp.src(src)
.pipe(jshint('.jshintrc'))
.pipe(jscs('.jscsrc'))
.pipe(stylish.combineWithHintResults())
.pipe(jshint.reporter('jshint-stylish', { verbose: true }))
.pipe(jshint.reporter('fail'));
});
gulp.task('capabilities', () =>
{
let capabilities = require('./data/supportedCapabilities');
return gulp.src('worker/src/RTC/Room.cpp')
.pipe(replace(/(std::string capabilities =).*/, `$1 R"(${JSON.stringify(capabilities)})";`))
.pipe(gulp.dest('worker/src/RTC/'))
.pipe(touch());
});
gulp.task('worker', shell.task(
[ `make` ]
));
gulp.task('test', shell.task(
[ `tap --bail --color --reporter=spec ${tests.join(' ')}` ],
{
env : { DEBUG: '*ABORT*' }
}
));
gulp.task('test-debug', shell.task(
[ `tap --bail --reporter=tap ${tests.join(' ')}` ],
{
env : { DEBUG: '*ERROR* *WARN*' },
verbose : true
}
));
gulp.task('t', gulp.series('test'));
gulp.task('td', gulp.series('test-debug'));
gulp.task('make', gulp.series('capabilities', 'worker'));
gulp.task('default', gulp.series('lint'));