forked from DevExpress/DevExtreme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
72 lines (60 loc) · 1.95 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
/* eslint-env node */
/* eslint-disable no-console */
const gulp = require('gulp');
const multiProcess = require('gulp-multi-process');
gulp.task('clean', function(callback) {
require('del').sync('artifacts');
callback();
});
require('./build/gulp/bundler-config');
require('./build/gulp/transpile');
require('./build/gulp/js-bundles');
require('./build/gulp/vectormap');
require('./build/gulp/css-bundles');
require('./build/gulp/npm');
require('./build/gulp/themebuilder-npm');
require('./build/gulp/aspnet');
require('./build/gulp/vendor');
require('./build/gulp/ts');
require('./build/gulp/localization');
require('./build/gulp/style-compiler');
require('./build/gulp/scss/tasks');
const TEST_CI = Boolean(process.env['DEVEXTREME_TEST_CI']);
const DOCKER_CI = Boolean(process.env['DEVEXTREME_DOCKER_CI']);
if(TEST_CI) {
console.warn('Using test CI mode!');
}
function createStyleCompilerBatch() {
return gulp.series(TEST_CI
? ['style-compiler-themes-ci']
: ['style-compiler-themes', 'style-compiler-tb-assets']
);
}
function createMiscBatch() {
const tasks = ['vectormap', 'vendor'];
if(!TEST_CI) {
tasks.push('aspnet', 'ts');
}
return gulp.parallel(tasks);
}
function createMainBatch() {
const tasks = ['js-bundles-debug'];
if(!TEST_CI) {
tasks.push('js-bundles-prod');
}
tasks.push('style-compiler-batch', 'misc-batch');
return DOCKER_CI
? gulp.series(tasks)
: (callback) => multiProcess(tasks, callback, true);
}
function createDefaultBatch() {
const tasks = [ 'clean', 'localization', createMainBatch() ];
if(!TEST_CI) {
tasks.push('npm', 'themebuilder-npm');
}
return gulp.series(tasks);
}
gulp.task('misc-batch', createMiscBatch());
gulp.task('style-compiler-batch', createStyleCompilerBatch());
gulp.task('default', createDefaultBatch());
gulp.task('dev', gulp.parallel('bundler-config-dev', 'js-bundles-dev', 'style-compiler-themes-dev'));