2020-12-14 16:24:34 +03:00
|
|
|
/*---------------------------------------------------------------------------------------------
|
|
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
|
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
|
|
*--------------------------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
// Increase max listeners for event emitters
|
|
|
|
require('events').EventEmitter.defaultMaxListeners = 100;
|
|
|
|
|
|
|
|
const gulp = require('gulp');
|
|
|
|
const util = require('./lib/util');
|
|
|
|
const task = require('./lib/task');
|
2022-08-26 16:02:01 +03:00
|
|
|
const { transpileClientSWC, transpileTask, compileTask, watchTask, compileApiProposalNamesTask, watchApiProposalNamesTask } = require('./lib/compilation');
|
2020-12-14 16:24:34 +03:00
|
|
|
const { monacoTypecheckTask/* , monacoTypecheckWatchTask */ } = require('./gulpfile.editor');
|
2021-03-19 05:15:59 +03:00
|
|
|
const { compileExtensionsTask, watchExtensionsTask, compileExtensionMediaTask } = require('./gulpfile.extensions');
|
2020-12-14 16:24:34 +03:00
|
|
|
|
2021-12-10 17:05:42 +03:00
|
|
|
// API proposal names
|
|
|
|
gulp.task(compileApiProposalNamesTask);
|
|
|
|
gulp.task(watchApiProposalNamesTask);
|
|
|
|
|
2022-08-26 16:02:01 +03:00
|
|
|
// SWC Client Transpile
|
2024-10-04 12:23:51 +03:00
|
|
|
const transpileClientSWCTask = task.define('transpile-client-esbuild', task.series(util.rimraf('out'), transpileTask('src', 'out', true)));
|
2022-08-26 16:02:01 +03:00
|
|
|
gulp.task(transpileClientSWCTask);
|
|
|
|
|
2022-06-15 17:52:48 +03:00
|
|
|
// Transpile only
|
2024-09-27 09:04:23 +03:00
|
|
|
const transpileClientTask = task.define('transpile-client', task.series(util.rimraf('out'), transpileTask('src', 'out')));
|
2022-06-15 17:52:48 +03:00
|
|
|
gulp.task(transpileClientTask);
|
|
|
|
|
2020-12-14 16:24:34 +03:00
|
|
|
// Fast compile for development time
|
2024-09-27 09:04:23 +03:00
|
|
|
const compileClientTask = task.define('compile-client', task.series(util.rimraf('out'), compileApiProposalNamesTask, compileTask('src', 'out', false)));
|
2020-12-14 16:24:34 +03:00
|
|
|
gulp.task(compileClientTask);
|
|
|
|
|
2024-09-27 09:04:23 +03:00
|
|
|
const watchClientTask = task.define('watch-client', task.series(util.rimraf('out'), task.parallel(watchTask('out', false), watchApiProposalNamesTask)));
|
2020-12-14 16:24:34 +03:00
|
|
|
gulp.task(watchClientTask);
|
|
|
|
|
|
|
|
// All
|
2021-12-10 17:05:42 +03:00
|
|
|
const _compileTask = task.define('compile', task.parallel(monacoTypecheckTask, compileClientTask, compileExtensionsTask, compileExtensionMediaTask));
|
|
|
|
gulp.task(_compileTask);
|
2020-12-14 16:24:34 +03:00
|
|
|
|
|
|
|
gulp.task(task.define('watch', task.parallel(/* monacoTypecheckWatchTask, */ watchClientTask, watchExtensionsTask)));
|
|
|
|
|
|
|
|
// Default
|
2021-12-10 17:05:42 +03:00
|
|
|
gulp.task('default', _compileTask);
|
2020-12-14 16:24:34 +03:00
|
|
|
|
|
|
|
process.on('unhandledRejection', (reason, p) => {
|
|
|
|
console.log('Unhandled Rejection at: Promise', p, 'reason:', reason);
|
|
|
|
process.exit(1);
|
|
|
|
});
|
|
|
|
|
|
|
|
// Load all the gulpfiles only if running tasks other than the editor tasks
|
|
|
|
require('glob').sync('gulpfile.*.js', { cwd: __dirname })
|
|
|
|
.forEach(f => require(`./${f}`));
|