angular-cn/scripts/build-packages-dist.sh
George Kalpakas 74b7d1ace1 test(ngcc): build zone.js from source in scripts/build-packages-dist.sh (#33733)
In #33046, internal uses of `zone.js` were switched to reference it
directly from source (built with Bazel) instead of npm. As a result, the
necessary scripts were updated to build `zone.js` as necessary. However,
some `integration/**/debug-test.sh` scripts were missed (apparently
because they are not used on CI, but only locally as helpers for
debugging the integration projects).

This commit updates the `scripts/build-packages-dist.sh` script to also
build `zone.js`, so that other scripts (such as the various
`debug-test.sh` scripts) can use it.

PR Close #33733
2019-11-12 09:55:16 -08:00

27 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
source $(dirname $0)/package-builder.sh
# Build the legacy (view engine) npm packages into dist/packages-dist
buildTargetPackages "dist/packages-dist" "legacy" "Production"
# Build the `zone.js` npm package (into `dist/bin/packages/zone.js/npm_package/`), because it might be needed
# by other scripts/tests.
#
# NOTE: The `zone.js` package is not built as part of `buildTargetPackages()` above, nor is it
# copied into the `dist/packages-dist/` directory (despite its source's being in `packages/`),
# because it is not published to npm under the `@angular` scope (as happens for the rest of
# the packages).
echo "# Building zone.js npm package..."
yarn --silent bazel build //packages/zone.js:npm_package
# Copy artifacts to `dist/zone.js-dist/`, so they can be easier persisted on CI.
readonly buildOutputDir="$base_dir/dist/bin/packages/zone.js/npm_package"
readonly distTargetDir="$base_dir/dist/zone.js-dist/zone.js"
echo "# Copying artifacts to '$distTargetDir'..."
mkdir -p $distTargetDir
rm -rf $distTargetDir
cp -R $buildOutputDir $distTargetDir
chmod -R u+w $distTargetDir