Merge "Add a showcommands function to envsetup."
This commit is contained in:
commit
00daf9d906
1 changed files with 35 additions and 0 deletions
35
envsetup.sh
35
envsetup.sh
|
@ -1613,6 +1613,41 @@ function source_vendorsetup() {
|
|||
done
|
||||
}
|
||||
|
||||
function showcommands() {
|
||||
local T=$(gettop)
|
||||
if [[ -z "$TARGET_PRODUCT" ]]; then
|
||||
>&2 echo "TARGET_PRODUCT not set. Run lunch."
|
||||
return
|
||||
fi
|
||||
case $(uname -s) in
|
||||
Darwin)
|
||||
PREBUILT_NAME=darwin-x86
|
||||
;;
|
||||
Linux)
|
||||
PREBUILT_NAME=linux-x86
|
||||
;;
|
||||
*)
|
||||
>&2 echo Unknown host $(uname -s)
|
||||
return
|
||||
;;
|
||||
esac
|
||||
if [[ -z "$OUT_DIR" ]]; then
|
||||
if [[ -z "$OUT_DIR_COMMON_BASE" ]]; then
|
||||
OUT_DIR=out
|
||||
else
|
||||
OUT_DIR=${OUT_DIR_COMMON_BASE}/${PWD##*/}
|
||||
fi
|
||||
fi
|
||||
if [[ "$1" == "--regenerate" ]]; then
|
||||
shift 1
|
||||
NINJA_ARGS="-t commands $@" m
|
||||
else
|
||||
(cd $T && prebuilts/build-tools/$PREBUILT_NAME/bin/ninja \
|
||||
-f $OUT_DIR/combined-${TARGET_PRODUCT}.ninja \
|
||||
-t commands "$@")
|
||||
fi
|
||||
}
|
||||
|
||||
validate_current_shell
|
||||
source_vendorsetup
|
||||
addcompletions
|
||||
|
|
Loading…
Reference in a new issue