-
Notifications
You must be signed in to change notification settings - Fork 6.8k
build(bazel): create script to run on top of ng_package output #10776
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build(bazel): create script to run on top of ng_package output #10776
Conversation
scripts/bazel/build-packages.sh
Outdated
./scripts/bazel/update-material-metadata-reexports.js | ||
|
||
# Update the Angular version used as a peerDependency for all of the packages. | ||
ng_version=$(echo "console.log(require('./build-config').angularVersion)" | node) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 that's what it's for
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, didn't know that was there. I don't like that our gulp and bazel setups use a different constant, but it's tolerable.
scripts/bazel/build-packages.sh
Outdated
./scripts/bazel/update-material-metadata-reexports.js | ||
|
||
# Update the Angular version used as a peerDependency for all of the packages. | ||
ng_version=$(echo "console.log(require('./build-config').angularVersion)" | node) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 that's what it's for
scripts/bazel/build-packages.sh
Outdated
set -e | ||
|
||
# Source directories for packages to build with bazel and copy into dist/ | ||
packages=(cdk lib cdk-experimental material-experimental material-moment-adapter) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could consider doing a bazel query here like we do in Angular.
Then the configuration is more local (eg. use a tag on each package you want to pick up)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, I think. Not sure if it's exactly what you had in mind.
# The dist/ directory where we want to copy the final result. Clear it out to avoid | ||
# any artifacts from earlier builds being retained. | ||
packages_dist="./dist/bazel-packages" | ||
rm -rf ${packages_dist} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this actually do what you want? you want bazel clean but I think you'll just create another symlink into the output directory which is read-only
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't follow what you mean. I'm copying the the output from bazel-bin, copying it to ./dist
and then modifying it (no symlink). I wipe out the directory in ./dist
to make sure something from an earlier bazel build doesn't stick around.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved inperson
|
||
# Source directories for packages to build with bazel and copy into dist/ | ||
# We use the bazel tag "publish" as a marker for rules we care about here. | ||
packages=$(bazel query --output=package 'attr(tags, publish, ...)' | xargs -n1 basename) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you test this? I'm surprised you don't need to deal with tags being array-valued
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, works great. Copied this pattern from a bunch of similar examples via codesearch
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
No description provided.