More gulp task work (#67863)
parent
cf19bcf862
commit
c0c719c651
|
@ -143,4 +143,4 @@ const tasks = compilations.map(function (tsconfigFile) {
|
|||
|
||||
gulp.task('compile-extensions', util.task.parallel(...tasks.map(t => t.compileTask)));
|
||||
gulp.task('watch-extensions', util.task.parallel(...tasks.map(t => t.watchTask)));
|
||||
gulp.task('compile-extensions-build', util.task.parallel(...tasks.map(t => t.compileBuildTask)));
|
||||
exports.compileExtensionsBuildTask = util.task.parallel(...tasks.map(t => t.compileBuildTask));
|
||||
|
|
|
@ -33,6 +33,8 @@ const deps = require('./dependencies');
|
|||
const getElectronVersion = require('./lib/electron').getElectronVersion;
|
||||
const createAsar = require('./lib/asar').createAsar;
|
||||
const minimist = require('minimist');
|
||||
const compilation = require('./lib/compilation');
|
||||
const { compileExtensionsBuildTask } = require('./gulpfile.extensions');
|
||||
|
||||
const productionDependencies = deps.getProductionDependencies(path.dirname(__dirname));
|
||||
// @ts-ignore
|
||||
|
@ -86,17 +88,25 @@ const BUNDLED_FILE_HEADER = [
|
|||
' *--------------------------------------------------------*/'
|
||||
].join('\n');
|
||||
|
||||
gulp.task('clean-optimized-vscode', util.rimraf('out-vscode'));
|
||||
gulp.task('optimize-vscode', ['clean-optimized-vscode', 'compile-build', 'compile-extensions-build'], common.optimizeTask({
|
||||
src: 'out-build',
|
||||
entryPoints: vscodeEntryPoints,
|
||||
otherSources: [],
|
||||
resources: vscodeResources,
|
||||
loaderConfig: common.loaderConfig(nodeModules),
|
||||
header: BUNDLED_FILE_HEADER,
|
||||
out: 'out-vscode',
|
||||
bundleInfo: undefined
|
||||
}));
|
||||
// Full compile, including nls and inline sources in sourcemaps, for build
|
||||
const compileClientBuildTask = util.task.series(util.rimraf('out-build'), compilation.compileTask('src', 'out-build', true));
|
||||
|
||||
// All Build
|
||||
const compileBuildTask = util.task.parallel(compileClientBuildTask, compileExtensionsBuildTask);
|
||||
|
||||
gulp.task('optimize-vscode', util.task.series(
|
||||
util.task.parallel(util.rimraf('out-vscode'), compileBuildTask),
|
||||
common.optimizeTask({
|
||||
src: 'out-build',
|
||||
entryPoints: vscodeEntryPoints,
|
||||
otherSources: [],
|
||||
resources: vscodeResources,
|
||||
loaderConfig: common.loaderConfig(nodeModules),
|
||||
header: BUNDLED_FILE_HEADER,
|
||||
out: 'out-vscode',
|
||||
bundleInfo: undefined
|
||||
}))
|
||||
);
|
||||
|
||||
|
||||
gulp.task('optimize-index-js', ['optimize-vscode'], () => {
|
||||
|
|
|
@ -292,7 +292,7 @@ export namespace task {
|
|||
});
|
||||
}
|
||||
|
||||
export function series(...tasks: Task[]): () => Promise<void> {
|
||||
export function series(...tasks: Task[]): PromiseTask {
|
||||
return async () => {
|
||||
for (let i = 0; i < tasks.length; i++) {
|
||||
await _execute(tasks[i]);
|
||||
|
@ -300,7 +300,7 @@ export namespace task {
|
|||
};
|
||||
}
|
||||
|
||||
export function parallel(...tasks: Task[]): () => Promise<void> {
|
||||
export function parallel(...tasks: Task[]): PromiseTask {
|
||||
return async () => {
|
||||
await Promise.all(tasks.map(t => _execute(t)));
|
||||
};
|
||||
|
|
|
@ -17,9 +17,6 @@ const compilation = require('./build/lib/compilation');
|
|||
gulp.task('compile-client', util.task.series(util.rimraf('out'), compilation.compileTask('src', 'out', false)));
|
||||
gulp.task('watch-client', util.task.series(util.rimraf('out'), compilation.watchTask('out', false)));
|
||||
|
||||
// Full compile, including nls and inline sources in sourcemaps, for build
|
||||
gulp.task('compile-client-build', util.task.series(util.rimraf('out-build'), compilation.compileTask('src', 'out-build', true)));
|
||||
|
||||
// Default
|
||||
gulp.task('default', ['compile']);
|
||||
|
||||
|
@ -27,9 +24,6 @@ gulp.task('default', ['compile']);
|
|||
gulp.task('compile', ['monaco-typecheck', 'compile-client', 'compile-extensions']);
|
||||
gulp.task('watch', [/* 'monaco-typecheck-watch', */ 'watch-client', 'watch-extensions']);
|
||||
|
||||
// All Build
|
||||
gulp.task('compile-build', ['compile-client-build', 'compile-extensions-build']);
|
||||
|
||||
process.on('unhandledRejection', (reason, p) => {
|
||||
console.log('Unhandled Rejection at: Promise', p, 'reason:', reason);
|
||||
process.exit(1);
|
||||
|
|
Loading…
Reference in New Issue