Look at the source to view more functions. The complete list is:
EOF
- T=$(gettop)
- local A
- A=""
+ local T=$(gettop)
+ local A=""
+ local i
for i in `cat $T/build/envsetup.sh | sed -n "/^[[:blank:]]*function /s/function \([a-z_]*\).*/\1/p" | sort | uniq`; do
A="$A $i"
done
# Get all the build variables needed by this script in a single call to the build system.
function build_build_var_cache()
{
- T=$(gettop)
+ local T=$(gettop)
# Grep out the variable names from the script.
cached_vars=`cat $T/build/envsetup.sh | tr '()' ' ' | awk '{for(i=1;i<=NF;i++) if($i~/get_build_var/) print $(i+1)}' | sort -u | tr '\n' ' '`
cached_abs_vars=`cat $T/build/envsetup.sh | tr '()' ' ' | awk '{for(i=1;i<=NF;i++) if($i~/get_abs_build_var/) print $(i+1)}' | sort -u | tr '\n' ' '`
function destroy_build_var_cache()
{
unset BUILD_VAR_CACHE_READY
+ local v
for v in $cached_vars; do
unset var_cache_$v
done
return
fi
- T=$(gettop)
+ local T=$(gettop)
if [ ! "$T" ]; then
echo "Couldn't locate the top of the tree. Try setting TOP." >&2
return
return
fi
- T=$(gettop)
+ local T=$(gettop)
if [ ! "$T" ]; then
echo "Couldn't locate the top of the tree. Try setting TOP." >&2
return
# check to see if the supplied product is one we can build
function check_product()
{
- T=$(gettop)
+ local T=$(gettop)
if [ ! "$T" ]; then
echo "Couldn't locate the top of the tree. Try setting TOP." >&2
return
# check to see if the supplied variant is valid
function check_variant()
{
+ local v
for v in ${VARIANT_CHOICES[@]}
do
if [ "$v" = "$1" ]
function setpaths()
{
- T=$(gettop)
+ local T=$(gettop)
if [ ! "$T" ]; then
echo "Couldn't locate the top of the tree. Try setting TOP."
return
fi
# and in with the new
- prebuiltdir=$(getprebuilt)
- gccprebuiltdir=$(get_abs_build_var ANDROID_GCC_PREBUILTS)
+ local prebuiltdir=$(getprebuilt)
+ local gccprebuiltdir=$(get_abs_build_var ANDROID_GCC_PREBUILTS)
# defined in core/config.mk
- targetgccversion=$(get_build_var TARGET_GCC_VERSION)
- targetgccversion2=$(get_build_var 2ND_TARGET_GCC_VERSION)
+ local targetgccversion=$(get_build_var TARGET_GCC_VERSION)
+ local targetgccversion2=$(get_build_var 2ND_TARGET_GCC_VERSION)
export TARGET_GCC_VERSION=$targetgccversion
# The gcc toolchain does not exists for windows/cygwin. In this case, do not reference it.
export ANDROID_TOOLCHAIN=
export ANDROID_TOOLCHAIN_2ND_ARCH=
local ARCH=$(get_build_var TARGET_ARCH)
+ local toolchaindir toolchaindir2=
case $ARCH in
x86) toolchaindir=x86/x86_64-linux-android-$targetgccversion/bin
;;
export ANDROID_TOOLCHAIN=$gccprebuiltdir/$toolchaindir
fi
- if [ -d "$gccprebuiltdir/$toolchaindir2" ]; then
+ if [ "$toolchaindir2" -a -d "$gccprebuiltdir/$toolchaindir2" ]; then
export ANDROID_TOOLCHAIN_2ND_ARCH=$gccprebuiltdir/$toolchaindir2
fi
function printconfig()
{
- T=$(gettop)
+ local T=$(gettop)
if [ ! "$T" ]; then
echo "Couldn't locate the top of the tree. Try setting TOP." >&2
return
#
function chooseproduct()
{
+ local default_value
if [ "x$TARGET_PRODUCT" != x ] ; then
default_value=$TARGET_PRODUCT
else
PWD= /bin/pwd
else
local HERE=$PWD
- T=
+ local T=
while [ \( ! \( -f $TOPFILE \) \) -a \( $PWD != "/" \) ]; do
\cd ..
T=`PWD= /bin/pwd -P`
function findmakefile()
{
- TOPFILE=build/core/envsetup.mk
+ local TOPFILE=build/core/envsetup.mk
local HERE=$PWD
- T=
+ local T=
while [ \( ! \( -f $TOPFILE \) \) -a \( $PWD != "/" \) ]; do
T=`PWD= /bin/pwd`
if [ -f "$T/Android.mk" -o -f "$T/Android.bp" ]; then
echo "Couldn't locate a makefile from the current directory."
return 1
else
+ local ARG
for ARG in $@; do
case $ARG in
GET-INSTALL-PATH) GET_INSTALL_PATH=$ARG;;
function croot()
{
- T=$(gettop)
+ local T=$(gettop)
if [ "$T" ]; then
if [ "$1" ]; then
\cd $(gettop)/$1
function cproj()
{
- TOPFILE=build/core/envsetup.mk
+ local TOPFILE=build/core/envsetup.mk
local HERE=$PWD
- T=
+ local T=
while [ \( ! \( -f $TOPFILE \) \) -a \( $PWD != "/" \) ]; do
T=$PWD
if [ -f "$T/Android.mk" ]; then
function resgrep()
{
+ local dir
for dir in `find . -name .repo -prune -o -name .git -prune -o -name out -prune -o -name res -type d`; do
find $dir -type f -name '*\.xml' -exec grep --color -n "$@" {} +
done
function tracedmdump()
{
- T=$(gettop)
+ local T=$(gettop)
if [ ! "$T" ]; then
echo "Couldn't locate the top of the tree. Try setting TOP."
return
echo "Couldn't locate output files. Try running 'lunch' first." >&2
return
fi
- T=$(gettop)
+ local T=$(gettop)
if [ ! "$T" ]; then
echo "Couldn't locate the top of the tree. Try setting TOP." >&2
return
# simple shortcut to the runtest command
function runtest()
{
- T=$(gettop)
+ local T=$(gettop)
if [ ! "$T" ]; then
echo "Couldn't locate the top of the tree. Try setting TOP." >&2
return
echo "Usage: godir <regex>"
return
fi
- T=$(gettop)
+ local T=$(gettop)
+ local FILELIST
if [ ! "$OUT_DIR" = "" ]; then
mkdir -p $OUT_DIR
FILELIST=$OUT_DIR/filelist