diff --git a/.ng-dev/release.ts b/.ng-dev/release.ts index 12f5b4a71c..1867eab1b3 100644 --- a/.ng-dev/release.ts +++ b/.ng-dev/release.ts @@ -18,14 +18,16 @@ export const release: ReleaseConfig = { '@angular/platform-browser', '@angular/platform-browser-dynamic', '@angular/platform-server', - '@angular/platform-webworker', - '@angular/platform-webworker-dynamic', '@angular/router', '@angular/service-worker', '@angular/upgrade', ], - // TODO: Implement release package building here. - buildPackages: async () => [], + buildPackages: async () => { + // The buildTargetPackages function is loaded at runtime as the loading the script causes an + // invocation of bazel. + const {buildTargetPackages} = require(join(__dirname, '../scripts/build/package-builder')); + return buildTargetPackages('dist/release-output', false, 'Release'); + }, // TODO: This can be removed once there is an org-wide tool for changelog generation. generateReleaseNotesForHead: async () => { exec('yarn -s gulp changelog', {cwd: join(__dirname, '../')}); diff --git a/scripts/build/package-builder.js b/scripts/build/package-builder.js index 619457d327..bb0c90b688 100644 --- a/scripts/build/package-builder.js +++ b/scripts/build/package-builder.js @@ -62,6 +62,7 @@ module.exports = { * This path should either be absolute or relative to the project root. * @param {boolean} enableIvy True, if Ivy should be used. * @param {string} description Human-readable description of the build. + * @returns {Array<{name: string, outputPath: string}} A list of packages built. */ function buildTargetPackages(destPath, enableIvy, description) { console.info('##################################'); @@ -70,6 +71,8 @@ function buildTargetPackages(destPath, enableIvy, description) { console.info(` Mode: ${description}`); console.info('##################################'); + /** The list of packages which were built. */ + const builtPackages = []; // List of targets to build, e.g. core, common, compiler, etc. Note that we want to also remove // all carriage return (`\r`) characters form the query output, because otherwise the carriage // return is part of the bazel target name and bazel will complain. @@ -97,10 +100,12 @@ function buildTargetPackages(destPath, enableIvy, description) { rm('-rf', destDir); cp('-R', srcDir, destDir); chmod('-R', 'u+w', destDir); + builtPackages.push({name: `@angular/${pkg}`, outputPath: destDir}); } }); console.info(''); + return builtPackages; } /**