aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2021-06-17 02:34:35 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-06-17 02:34:35 +0000
commit541174975b57be598ff57ba8578a071d2cecdba4 (patch)
tree315dd8abfbd867ba7f3470ed2b1a22e8786ef78a
parent02e6d3ff7465a118a13c64bf471cc436b77938e1 (diff)
parentbb53fe394bb1a8d36bf48806f7d1cebaa0117239 (diff)
downloadbuild-541174975b57be598ff57ba8578a071d2cecdba4.tar.gz
Merge "Show bazel help for `b` called without args." am: bb53fe394b
Original change: https://android-review.googlesource.com/c/platform/build/+/1737501 Change-Id: I973fe2c359649067c115c9af0ed1b1935e1807d0
-rw-r--r--envsetup.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/envsetup.sh b/envsetup.sh
index bbb18e5f5c..c6151559c4 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -1696,12 +1696,19 @@ function _trigger_build()
fi
)
+# Convenience entry point (like m) to use Bazel in AOSP.
function b()
(
# Generate BUILD, bzl files into the synthetic Bazel workspace (out/soong/workspace).
m nothing GENERATE_BAZEL_FILES=true || return 1
# Then, run Bazel using the synthetic workspace as the --package_path.
- "$(gettop)/tools/bazel" "$@" --config=bp2build
+ if [[ -z "$@" ]]; then
+ # If there are no args, show help.
+ "$(gettop)/tools/bazel" help
+ else
+ # Else, always run with the bp2build configuration, which sets Bazel's package path to the synthetic workspace.
+ "$(gettop)/tools/bazel" "$@" --config=bp2build
+ fi
)
function m()