2019-02-05 17:03:46 +08:00
|
|
|
/*---------------------------------------------------------------------------------------------
|
|
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
|
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
|
|
*--------------------------------------------------------------------------------------------*/
|
|
|
|
|
2024-07-06 02:06:43 +08:00
|
|
|
//@ts-check
|
2019-02-05 17:03:46 +08:00
|
|
|
'use strict';
|
|
|
|
|
2019-07-05 23:01:55 +08:00
|
|
|
const gulp = require('gulp');
|
2019-02-05 17:03:46 +08:00
|
|
|
const util = require('./lib/util');
|
2024-07-06 02:06:43 +08:00
|
|
|
const date = require('./lib/date');
|
2019-02-12 22:13:43 +08:00
|
|
|
const task = require('./lib/task');
|
2019-02-05 17:03:46 +08:00
|
|
|
const compilation = require('./lib/compilation');
|
|
|
|
|
2024-07-06 02:06:43 +08:00
|
|
|
/**
|
|
|
|
* @param {boolean} disableMangle
|
|
|
|
*/
|
2023-06-07 21:51:48 +08:00
|
|
|
function makeCompileBuildTask(disableMangle) {
|
|
|
|
return task.series(
|
2021-01-07 03:36:22 +08:00
|
|
|
util.rimraf('out-build'),
|
2024-07-06 02:06:43 +08:00
|
|
|
date.writeISODate('out-build'),
|
2022-10-26 16:59:54 +08:00
|
|
|
compilation.compileApiProposalNamesTask,
|
2024-09-27 14:04:56 +08:00
|
|
|
compilation.compileTask('src', 'out-build', true, { disableMangle })
|
2023-06-07 21:51:48 +08:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Full compile, including nls and inline sources in sourcemaps, mangling, minification, for build
|
|
|
|
const compileBuildTask = task.define('compile-build', makeCompileBuildTask(false));
|
2019-07-05 23:01:55 +08:00
|
|
|
gulp.task(compileBuildTask);
|
2021-01-07 03:36:22 +08:00
|
|
|
exports.compileBuildTask = compileBuildTask;
|
2023-06-07 21:51:48 +08:00
|
|
|
|
|
|
|
// Full compile for PR ci, e.g no mangling
|
|
|
|
const compileBuildTaskPullRequest = task.define('compile-build-pr', makeCompileBuildTask(true));
|
|
|
|
gulp.task(compileBuildTaskPullRequest);
|
|
|
|
exports.compileBuildTaskPullRequest = compileBuildTaskPullRequest;
|