build: update scripting and tooling to rely on define=angular_ivy_enabled instream of define=compile (#33983)

We need to migrate to using angular_ivy_enabled value to determine whether to use
Ivy or ViewEngine for package building scripts and for size-tracking and
symbol-extract tooling.

PR Close #33983
This commit is contained in:
Joey Perrott
2019-11-22 12:11:48 -08:00
committed by Matias Niemelä
parent 5e3f6d203d
commit 4022376b3f
10 changed files with 25 additions and 27 deletions

View File

@ -5,4 +5,4 @@ const {buildTargetPackages} = require('./package-builder');
// Build the ivy packages.
buildTargetPackages('dist/packages-dist-ivy-aot', 'aot', 'Ivy AOT');
buildTargetPackages('dist/packages-dist-ivy-aot', true, 'Ivy AOT');

View File

@ -13,7 +13,7 @@ const {
// Build the legacy (view engine) npm packages into `dist/packages-dist/`.
buildTargetPackages('dist/packages-dist', 'legacy', 'Production');
buildTargetPackages('dist/packages-dist', false, 'Production');
// Build the `zone.js` npm package (into `dist/bin/packages/zone.js/npm_package/`), because it might
// be needed by other scripts/tests.

View File

@ -47,10 +47,10 @@ module.exports = {
*
* @param {string} destPath Path to the output directory into which we copy the npm packages.
* This path should either be absolute or relative to the project root.
* @param {'legacy' | 'aot'} compileMode Either `legacy` (view engine) or `aot` (ivy).
* @param {boolean} enableIvy True, if Ivy should be used.
* @param {string} description Human-readable description of the build.
*/
function buildTargetPackages(destPath, compileMode, description) {
function buildTargetPackages(destPath, enableIvy, description) {
console.log('##################################');
console.log(`${scriptPath}:`);
console.log(' Building @angular/* npm packages');
@ -65,7 +65,7 @@ function buildTargetPackages(destPath, compileMode, description) {
const targets = exec(getTargetsCmd, true).split(/\r?\n/);
// Use `--config=release` so that snapshot builds get published with embedded version info.
exec(`${bazelCmd} build --config=release --define=compile=${compileMode} ${targets.join(' ')}`);
exec(`${bazelCmd} build --config=release --config=${enableIvy ? 'ivy' : 'view-engine'} ${targets.join(' ')}`);
// Create the output directory.
const absDestPath = resolve(baseDir, destPath);