diff options
Diffstat (limited to 'envsetup.sh')
-rw-r--r-- | envsetup.sh | 64 |
1 files changed, 48 insertions, 16 deletions
diff --git a/envsetup.sh b/envsetup.sh index f5aee90..4c62e8e 100644 --- a/envsetup.sh +++ b/envsetup.sh @@ -29,8 +29,8 @@ function get_abs_build_var() echo "Couldn't locate the top of the tree. Try setting TOP." >&2 return fi - CALLED_FROM_SETUP=true BUILD_SYSTEM=build/core \ - make --no-print-directory -C "$T" -f build/core/config.mk dumpvar-abs-$1 + (cd $T; CALLED_FROM_SETUP=true BUILD_SYSTEM=build/core \ + make --no-print-directory -C "$T" -f build/core/config.mk dumpvar-abs-$1) } # Get the exact value of a build variable. @@ -109,16 +109,23 @@ function setpaths() # and in with the new CODE_REVIEWS= prebuiltdir=$(getprebuilt) - toolchaindir=toolchain/arm-eabi-4.4.3/bin + # The gcc toolchain does not exists for windows/cygwin. In this case, do not reference it. + export ANDROID_EABI_TOOLCHAIN= + toolchaindir=toolchain/arm-linux-androideabi-4.4.x/bin if [ -d "$prebuiltdir/$toolchaindir" ]; then export ANDROID_EABI_TOOLCHAIN=$prebuiltdir/$toolchaindir - else - export ANDROID_EABI_TOOLCHAIN= fi + + export ARM_EABI_TOOLCHAIN= + toolchaindir=toolchain/arm-eabi-4.4.3/bin + if [ -d "$prebuiltdir/$toolchaindir" ]; then + export ARM_EABI_TOOLCHAIN=$prebuiltdir/$toolchaindir + fi + export ANDROID_TOOLCHAIN=$ANDROID_EABI_TOOLCHAIN export ANDROID_QTOOLS=$T/development/emulator/qtools - export ANDROID_BUILD_PATHS=:$(get_build_var ANDROID_BUILD_PATHS):$ANDROID_QTOOLS:$ANDROID_TOOLCHAIN:$ANDROID_EABI_TOOLCHAIN$CODE_REVIEWS + export ANDROID_BUILD_PATHS=:$(get_build_var ANDROID_BUILD_PATHS):$ANDROID_QTOOLS:$ANDROID_TOOLCHAIN:$ARM_EABI_TOOLCHAIN$CODE_REVIEWS export PATH=$PATH$ANDROID_BUILD_PATHS unset ANDROID_JAVA_TOOLCHAIN @@ -573,6 +580,19 @@ function lunch() printconfig } +# Tab completion for lunch. +function _lunch() +{ + local cur prev opts + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + + COMPREPLY=( $(compgen -W "${LUNCH_MENU_CHOICES[*]}" -- ${cur}) ) + return 0 +} +complete -F _lunch lunch + # Configures the build to build unbundled apps. # Run tapas with one ore more app names (from LOCAL_PACKAGE_NAME) function tapas() @@ -711,6 +731,8 @@ function mmm() ARGS="$ARGS showcommands" elif [ "$DIR" = dist ]; then ARGS="$ARGS dist" + elif [ "$DIR" = incrementaljavac ]; then + ARGS="$ARGS incrementaljavac" else echo "No Android.mk in $DIR." return 1 @@ -814,7 +836,7 @@ function gdbclient() echo >>"$OUT_ROOT/gdbclient.cmds" "target remote $PORT" echo >>"$OUT_ROOT/gdbclient.cmds" "" - arm-eabi-gdb -x "$OUT_ROOT/gdbclient.cmds" "$OUT_EXE_SYMBOLS/$EXE" + arm-linux-androideabi-gdb -x "$OUT_ROOT/gdbclient.cmds" "$OUT_EXE_SYMBOLS/$EXE" else echo "Unable to determine build system output dir." fi @@ -948,10 +970,9 @@ function runhat() # runhat options local targetPid=$1 - local outputFile=$2 if [ "$targetPid" = "" ]; then - echo "Usage: runhat [ -d | -e | -s serial ] target-pid [output-file]" + echo "Usage: runhat [ -d | -e | -s serial ] target-pid" return fi @@ -961,18 +982,14 @@ function runhat() return fi - adb ${adbOptions} shell >/dev/null mkdir /data/misc - adb ${adbOptions} shell chmod 777 /data/misc - - # send a SIGUSR1 to cause the hprof dump + # issue "am" command to cause the hprof dump + local devFile=/sdcard/hprof-$targetPid echo "Poking $targetPid and waiting for data..." - adb ${adbOptions} shell kill -10 $targetPid + adb ${adbOptions} shell am dumpheap $targetPid $devFile echo "Press enter when logcat shows \"hprof: heap dump completed\"" echo -n "> " read - local availFiles=( $(adb ${adbOptions} shell ls /data/misc | grep '^heap-dump' | sed -e 's/.*heap-dump-/heap-dump-/' | sort -r | tr '[:space:][:cntrl:]' ' ') ) - local devFile=/data/misc/${availFiles[0]} local localFile=/tmp/$$-hprof echo "Retrieving file $devFile..." @@ -1023,6 +1040,21 @@ function isviewserverstarted() adb shell service call window 3 } +function key_home() +{ + adb shell input keyevent 3 +} + +function key_back() +{ + adb shell input keyevent 4 +} + +function key_menu() +{ + adb shell input keyevent 82 +} + function smoketest() { if [ ! "$ANDROID_PRODUCT_OUT" ]; then |