Skip to content

Commit

Permalink
Cleanup examples_angular now that it uses managed directories
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeagle committed May 24, 2019
1 parent 0337d47 commit f96a06b
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions scripts/setup_examples_angular.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ printf "\n\nSetting up /examples/angular\n"

# Replace @bazel/foobar packages in package.json with file paths to locally generated packages
for package in ${PACKAGES[@]} ; do
echo_and_run sedi "s#\"@bazel\/${package}\":[[:blank:]]*\"[_\-\.a-zA-Z0-9]*\"#\"@bazel\/${package}\": \"file://${RULES_NODEJS_DIR}/dist/npm_bazel_${package}\"#" package.json
echo_and_run sedi "s#\"@bazel\/${package}\":[[:blank:]]*\"[~_\-\.a-zA-Z0-9]*\"#\"@bazel\/${package}\": \"file://${RULES_NODEJS_DIR}/dist/npm_bazel_${package}\"#" package.json
done

# We can't do multi-line replacements with sed so we'll keep the http_archive
Expand All @@ -43,15 +43,6 @@ printf "\n\nSetting up /examples/angular\n"
echo_and_run sedi "s#urls* = \[*\"https:\/\/github\.com\/[a-zA-Z_]*\/rules_nodejs[^\"]*\"\]*#url = \"file://${RULES_NODEJS_DIR}/dist/build_bazel_rules_nodejs/release.tar.gz\"#" WORKSPACE
echo_and_run sedi "s#sha256 =#\# sha256 =#" WORKSPACE

# TEMPORARY for managed_directories
echo_and_run sedi "s#name \= \"angular_bazel_example\"#name = \"angular_bazel_example\", managed_directories = {\"@npm\": [\"node_modules\"]}#" WORKSPACE
echo_and_run sedi "s#\"\@bazel\/bazel\"\: \"0\.25\.1\"#\"@bazel/bazel\": \"file:../../node_modules/@bazel/bazel\"#" package.json
echo "" >> .bazelrc
echo "##################################################" >> .bazelrc
echo "# Turn on managed_directories" >> .bazelrc
echo "build --experimental_allow_incremental_repository_updates" >> .bazelrc
echo "query --experimental_allow_incremental_repository_updates" >> .bazelrc

# Check that above replacements worked
if ! grep -q "dist/npm_bazel_" package.json; then
echo "package.json replacements failed!"
Expand Down

0 comments on commit f96a06b

Please sign in to comment.