forked from versatica/mediasoup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
39 lines (34 loc) · 873 Bytes
/
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
const gulp = require('gulp');
const clangFormat = require('gulp-clang-format');
const workerFiles =
[
'worker/src/**/*.cpp',
'worker/include/**/*.hpp',
'worker/test/src/**/*.cpp',
'worker/test/include/helpers.hpp',
'worker/fuzzer/src/**/*.cpp',
'worker/fuzzer/include/**/*.hpp'
];
gulp.task('lint:worker', () =>
{
const src = workerFiles.concat(
// Ignore Ragel generated files.
'!worker/src/Utils/IP.cpp',
// Ignore json.hpp.
'!worker/include/json.hpp'
);
return gulp.src(src)
.pipe(clangFormat.checkFormat('file', null, { verbose: true, fail: true }));
});
gulp.task('format:worker', () =>
{
const src = workerFiles.concat(
// Ignore Ragel generated files.
'!worker/src/Utils/IP.cpp',
// Ignore json.hpp.
'!worker/include/json.hpp'
);
return gulp.src(src, { base: '.' })
.pipe(clangFormat.format('file'))
.pipe(gulp.dest('.'));
});