forked from DevExpress/DevExtreme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
114 lines (98 loc) · 3.12 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/* eslint-env node */
/* eslint-disable no-console */
const gulp = require('gulp');
const multiProcess = require('gulp-multi-process');
const env = require('./build/gulp/env-variables');
const cache = require('gulp-cache');
const shell = require('gulp-shell');
gulp.task('clean', function(callback) {
require('del').sync('artifacts');
cache.clearAll();
callback();
});
require('./build/gulp/bundler-config');
require('./build/gulp/transpile');
require('./build/gulp/js-bundles');
require('./build/gulp/vectormap');
require('./build/gulp/styles/themebuilder-npm');
require('./build/gulp/styles/style-compiler');
require('./build/gulp/npm');
require('./build/gulp/aspnet');
require('./build/gulp/vendor');
require('./build/gulp/ts');
require('./build/gulp/localization');
require('./build/gulp/generator/gulpfile');
require('./build/gulp/check_licenses');
require('./build/gulp/qunit-in-docker');
require('./build/gulp/renovation-testing-playground');
require('./build/gulp/renovation-npm');
if(!env.TEST_CI) {
require('./build/gulp/create_timezones_data');
require('./build/gulp/test_timezones_data');
}
if(env.TEST_CI) {
console.warn('Using test CI mode!');
}
function createStyleCompilerBatch() {
return gulp.series(env.TEST_CI
? ['style-compiler-themes-ci']
: ['style-compiler-themes']
);
}
function createMiscBatch() {
const tasks = ['vectormap', 'vendor'];
if(!env.TEST_CI) {
tasks.push('aspnet', 'ts');
}
return gulp.parallel(tasks);
}
function createMainBatch(dev) {
const tasks = [];
if(!dev) {
tasks.push('js-bundles-debug');
}
if(!env.TEST_CI) {
tasks.push('js-bundles-prod');
}
tasks.push('style-compiler-batch', 'misc-batch');
return (callback) => multiProcess(tasks, callback, true);
}
function createDefaultBatch(dev) {
const tasks = dev ? [] : ['clean'];
tasks.push('localization');
tasks.push(dev ? 'generate-components-dev' : 'generate-components');
tasks.push('transpile');
tasks.push('version-replace');
tasks.push(dev ? 'main-batch-dev' : 'main-batch');
if(!env.TEST_CI && !dev) {
tasks.push('npm');
if(!env.SKIP_THEMEBUILDER) {
tasks.push('themebuilder-npm');
}
tasks.push('check-license-notices');
}
tasks.push('discover-declarations');
return gulp.series(tasks);
}
gulp.task('discover-declarations', shell.task('npm run discover-declarations'));
gulp.task('misc-batch', createMiscBatch());
gulp.task('style-compiler-batch', createStyleCompilerBatch());
gulp.task('main-batch', createMainBatch(false));
gulp.task('main-batch-dev', createMainBatch(true));
gulp.task('default', createDefaultBatch());
gulp.task('default-dev', createDefaultBatch(true));
gulp.task('test-env', shell.task('node ./testing/launch'));
gulp.task('dev-watch', gulp.parallel(
'generate-jquery-components-watch',
'generate-inferno-components-watch',
'transpile-watch',
'renovated-components-watch',
'bundler-config-watch',
'js-bundles-watch',
'style-compiler-themes-watch',
'test-env'
));
gulp.task('dev', gulp.series(
'default-dev',
'dev-watch'
));