@@ -21,7 +21,7 @@ const releaseTargetTag = 'release-package';
2121const projectDir = join ( __dirname , '../' ) ;
2222
2323/** Command that runs Bazel. */
24- const bazelCmd = process . env . BAZEL_COMMAND || `bazel` ;
24+ const bazelCmd = process . env . BAZEL || `yarn -s bazel` ;
2525
2626/** Command that queries Bazel for all release package targets. */
2727const queryPackagesCmd =
@@ -69,7 +69,8 @@ function buildReleasePackages(distPath: string, isSnapshotBuild: boolean): Built
6969 const targets = exec ( queryPackagesCmd , true ) . split ( / \r ? \n / ) ;
7070 const packageNames = getPackageNamesOfTargets ( targets ) ;
7171 const bazelBinPath = exec ( `${ bazelCmd } info bazel-bin` , true ) ;
72- const getOutputPath = ( pkgName : string ) => join ( bazelBinPath , 'src' , pkgName , 'npm_package' ) ;
72+ const getBazelOutputPath = ( pkgName : string ) => join ( bazelBinPath , 'src' , pkgName , 'npm_package' ) ;
73+ const getDistPath = ( pkgName : string ) => join ( distPath , pkgName ) ;
7374
7475 // Build with "--config=release" or `--config=snapshot-build` so that Bazel
7576 // runs the workspace stamping script. The stamping script ensures that the
@@ -80,7 +81,7 @@ function buildReleasePackages(distPath: string, isSnapshotBuild: boolean): Built
8081 // a workaround for: https://github.com/bazelbuild/rules_nodejs/issues/1219. We need to
8182 // do this to ensure that the version placeholders are properly populated.
8283 packageNames . forEach ( pkgName => {
83- const outputPath = getOutputPath ( pkgName ) ;
84+ const outputPath = getBazelOutputPath ( pkgName ) ;
8485 if ( test ( '-d' , outputPath ) ) {
8586 chmod ( '-R' , 'u+w' , outputPath ) ;
8687 rm ( '-rf' , outputPath ) ;
@@ -96,18 +97,17 @@ function buildReleasePackages(distPath: string, isSnapshotBuild: boolean): Built
9697
9798 // Copy the package output into the specified distribution folder.
9899 packageNames . forEach ( pkgName => {
99- const outputPath = getOutputPath ( pkgName ) ;
100- const targetFolder = join ( distPath , pkgName ) ;
100+ const outputPath = getBazelOutputPath ( pkgName ) ;
101+ const targetFolder = getDistPath ( pkgName ) ;
101102 console . log ( `> Copying package output to "${ targetFolder } "` ) ;
102103 cp ( '-R' , outputPath , targetFolder ) ;
103104 chmod ( '-R' , 'u+w' , targetFolder ) ;
104105 } ) ;
105106
106107 return packageNames . map ( pkg => {
107- const outputPath = getOutputPath ( pkg ) ;
108108 return {
109109 name : `@angular/${ pkg } ` ,
110- outputPath,
110+ outputPath : getDistPath ( pkg ) ,
111111 } ;
112112 } ) ;
113113}
0 commit comments