3 Invoke ". build/envsetup.sh" from your shell to add the following functions to your environment:
4 - croot: Changes directory to the top of the tree.
5 - m: Makes from the top of the tree.
6 - mm: Builds all of the modules in the current directory.
7 - mmm: Builds all of the modules in the supplied directories.
8 - cgrep: Greps on all local C/C++ files.
9 - jgrep: Greps on all local Java files.
10 - resgrep: Greps on all local res/*.xml files.
11 - godir: Go to the directory containing a file.
13 Look at the source to view more functions. The complete list is:
18 for i in `cat $T/build/envsetup.sh | sed -n "/^function /s/function \([a-z_]*\).*/\1/p" | sort`; do
24 # Get the value of a build variable as an absolute path.
25 function get_abs_build_var()
29 echo "Couldn't locate the top of the tree. Try setting TOP." >&2
32 CALLED_FROM_SETUP=true BUILD_SYSTEM=build/core \
33 make --no-print-directory -C "$T" -f build/core/config.mk dumpvar-abs-$1
36 # Get the exact value of a build variable.
37 function get_build_var()
41 echo "Couldn't locate the top of the tree. Try setting TOP." >&2
44 CALLED_FROM_SETUP=true BUILD_SYSTEM=build/core \
45 make --no-print-directory -C "$T" -f build/core/config.mk dumpvar-$1
48 # check to see if the supplied product is one we can build
49 function check_product()
53 echo "Couldn't locate the top of the tree. Try setting TOP." >&2
56 CALLED_FROM_SETUP=true BUILD_SYSTEM=build/core \
57 TARGET_PRODUCT=$1 TARGET_BUILD_VARIANT= \
58 TARGET_SIMULATOR= TARGET_BUILD_TYPE= \
60 get_build_var TARGET_DEVICE > /dev/null
61 # hide successful answers, but allow the errors to show
64 VARIANT_CHOICES=(user userdebug eng)
66 # check to see if the supplied variant is valid
67 function check_variant()
69 for v in ${VARIANT_CHOICES[@]}
83 echo "Couldn't locate the top of the tree. Try setting TOP."
87 ##################################################################
89 # Read me before you modify this code #
91 # This function sets ANDROID_BUILD_PATHS to what it is adding #
92 # to PATH, and the next time it is run, it removes that from #
93 # PATH. This is required so lunch can be run more than once #
94 # and still have working paths. #
96 ##################################################################
98 # Note: on windows/cygwin, ANDROID_BUILD_PATHS will contain spaces
99 # due to "C:\Program Files" being in the path.
102 if [ -n "$ANDROID_BUILD_PATHS" ] ; then
103 export PATH=${PATH/$ANDROID_BUILD_PATHS/}
105 if [ -n "$ANDROID_PRE_BUILD_PATHS" ] ; then
106 export PATH=${PATH/$ANDROID_PRE_BUILD_PATHS/}
109 # and in with the new
111 prebuiltdir=$(getprebuilt)
112 toolchaindir=toolchain/arm-eabi-4.4.3/bin
113 # The gcc toolchain does not exists for windows/cygwin. In this case, do not reference it.
114 if [ -d "$prebuiltdir/$toolchaindir" ]; then
115 export ANDROID_EABI_TOOLCHAIN=$prebuiltdir/$toolchaindir
117 export ANDROID_EABI_TOOLCHAIN=
119 export ANDROID_TOOLCHAIN=$ANDROID_EABI_TOOLCHAIN
120 export ANDROID_QTOOLS=$T/development/emulator/qtools
121 export ANDROID_BUILD_PATHS=:$(get_build_var ANDROID_BUILD_PATHS):$ANDROID_QTOOLS:$ANDROID_TOOLCHAIN:$ANDROID_EABI_TOOLCHAIN$CODE_REVIEWS
122 export PATH=$PATH$ANDROID_BUILD_PATHS
124 unset ANDROID_JAVA_TOOLCHAIN
125 if [ -n "$JAVA_HOME" ]; then
126 export ANDROID_JAVA_TOOLCHAIN=$JAVA_HOME/bin
128 export ANDROID_PRE_BUILD_PATHS=$ANDROID_JAVA_TOOLCHAIN
129 if [ -n "$ANDROID_PRE_BUILD_PATHS" ]; then
130 export PATH=$ANDROID_PRE_BUILD_PATHS:$PATH
133 unset ANDROID_PRODUCT_OUT
134 export ANDROID_PRODUCT_OUT=$(get_abs_build_var PRODUCT_OUT)
135 export OUT=$ANDROID_PRODUCT_OUT
137 unset ANDROID_HOST_OUT
138 export ANDROID_HOST_OUT=$(get_abs_build_var HOST_OUT)
140 # needed for building linux on MacOS
142 #export HOST_EXTRACFLAGS="-I "$T/system/kernel_headers/host_include
144 # needed for OProfile to post-process collected samples
145 export OPROFILE_EVENTS_DIR=$prebuiltdir/oprofile
148 function printconfig()
152 echo "Couldn't locate the top of the tree. Try setting TOP." >&2
155 get_build_var report_config
158 function set_stuff_for_environment()
165 export ANDROID_BUILD_TOP=$(gettop)
168 function set_sequence_number()
170 export BUILD_ENV_SEQUENCE_NUMBER=10
175 if [ "$STAY_OFF_MY_LAWN" = "" ]; then
176 local product=$TARGET_PRODUCT
177 local variant=$TARGET_BUILD_VARIANT
178 local apps=$TARGET_BUILD_APPS
179 if [ -z "$apps" ]; then
180 export PROMPT_COMMAND="echo -ne \"\033]0;[${product}-${variant}] ${USER}@${HOSTNAME}: ${PWD}\007\""
182 export PROMPT_COMMAND="echo -ne \"\033]0;[$apps $variant] ${USER}@${HOSTNAME}: ${PWD}\007\""
191 echo "Build for the simulator or the device?"
196 export TARGET_SIMULATOR=
198 while [ -z $TARGET_SIMULATOR ]
200 echo -n "Which would you like? [1] "
201 if [ -z "$1" ] ; then
209 export TARGET_SIMULATOR=false
212 export TARGET_SIMULATOR=false
215 export TARGET_SIMULATOR=false
218 export TARGET_SIMULATOR=true
221 export TARGET_SIMULATOR=true
225 echo "I didn't understand your response. Please try again."
229 if [ -n "$1" ] ; then
234 set_stuff_for_environment
240 echo "Only device builds are supported for" `uname -s`
241 echo " Forcing TARGET_SIMULATOR=false"
245 echo -n "Press enter: "
249 export TARGET_SIMULATOR=false
250 set_stuff_for_environment
255 function choosetype()
257 echo "Build type choices are:"
262 local DEFAULT_NUM DEFAULT_VALUE
263 if [ $TARGET_SIMULATOR = "false" ] ; then
265 DEFAULT_VALUE=release
271 export TARGET_BUILD_TYPE=
273 while [ -z $TARGET_BUILD_TYPE ]
275 echo -n "Which would you like? ["$DEFAULT_NUM"] "
276 if [ -z "$1" ] ; then
284 export TARGET_BUILD_TYPE=$DEFAULT_VALUE
287 export TARGET_BUILD_TYPE=release
290 export TARGET_BUILD_TYPE=release
293 export TARGET_BUILD_TYPE=debug
296 export TARGET_BUILD_TYPE=debug
300 echo "I didn't understand your response. Please try again."
304 if [ -n "$1" ] ; then
309 set_stuff_for_environment
313 # This function isn't really right: It chooses a TARGET_PRODUCT
314 # based on the list of boards. Usually, that gets you something
315 # that kinda works with a generic product, but really, you should
316 # pick a product by name.
318 function chooseproduct()
320 if [ "x$TARGET_PRODUCT" != x ] ; then
321 default_value=$TARGET_PRODUCT
323 if [ "$TARGET_SIMULATOR" = true ] ; then
326 default_value=generic
330 export TARGET_PRODUCT=
332 while [ -z "$TARGET_PRODUCT" ]
334 echo -n "Which product would you like? [$default_value] "
335 if [ -z "$1" ] ; then
342 if [ -z "$ANSWER" ] ; then
343 export TARGET_PRODUCT=$default_value
345 if check_product $ANSWER
347 export TARGET_PRODUCT=$ANSWER
349 echo "** Not a valid product: $ANSWER"
352 if [ -n "$1" ] ; then
357 set_stuff_for_environment
360 function choosevariant()
362 echo "Variant choices are:"
365 for v in ${VARIANT_CHOICES[@]}
367 # The product name is the name of the directory containing
368 # the makefile we found, above.
373 local default_value=eng
376 export TARGET_BUILD_VARIANT=
377 while [ -z "$TARGET_BUILD_VARIANT" ]
379 echo -n "Which would you like? [$default_value] "
380 if [ -z "$1" ] ; then
387 if [ -z "$ANSWER" ] ; then
388 export TARGET_BUILD_VARIANT=$default_value
389 elif (echo -n $ANSWER | grep -q -e "^[0-9][0-9]*$") ; then
390 if [ "$ANSWER" -le "${#VARIANT_CHOICES[@]}" ] ; then
391 export TARGET_BUILD_VARIANT=${VARIANT_CHOICES[$(($ANSWER-1))]}
394 if check_variant $ANSWER
396 export TARGET_BUILD_VARIANT=$ANSWER
398 echo "** Not a valid variant: $ANSWER"
401 if [ -n "$1" ] ; then
407 function choosecombo()
424 set_stuff_for_environment
428 # Clear this variable. It will be built up again when the vendorsetup.sh
429 # files are included at the end of this file.
430 unset LUNCH_MENU_CHOICES
431 function add_lunch_combo()
435 for c in ${LUNCH_MENU_CHOICES[@]} ; do
436 if [ "$new_combo" = "$c" ] ; then
440 LUNCH_MENU_CHOICES=(${LUNCH_MENU_CHOICES[@]} $new_combo)
443 # add the default one here
444 add_lunch_combo generic-eng
445 add_lunch_combo generic_x86-eng
447 function print_lunch_menu()
451 echo "You're building on" $uname
453 echo "Lunch menu... pick a combo:"
457 for choice in ${LUNCH_MENU_CHOICES[@]}
474 echo -n "Which would you like? [generic-eng] "
482 selection=generic-eng
483 elif [ "$answer" = "simulator" ]
486 elif (echo -n $answer | grep -q -e "^[0-9][0-9]*$")
488 if [ $answer -le ${#LUNCH_MENU_CHOICES[@]} ]
490 selection=${LUNCH_MENU_CHOICES[$(($answer-1))]}
492 elif (echo -n $answer | grep -q -e "^[^\-][^\-]*-[^\-][^\-]*$")
497 if [ -z "$selection" ]
500 echo "Invalid lunch combo: $answer"
504 export TARGET_BUILD_APPS=
506 # special case the simulator
507 if [ "$selection" = "simulator" ]
509 export TARGET_PRODUCT=sim
510 export TARGET_BUILD_VARIANT=eng
511 export TARGET_SIMULATOR=true
512 export TARGET_BUILD_TYPE=debug
514 local product=$(echo -n $selection | sed -e "s/-.*$//")
515 check_product $product
519 echo "** Don't have a product spec for: '$product'"
520 echo "** Do you have the right repo manifest?"
524 local variant=$(echo -n $selection | sed -e "s/^[^\-]*-//")
525 check_variant $variant
529 echo "** Invalid variant: '$variant'"
530 echo "** Must be one of ${VARIANT_CHOICES[@]}"
534 if [ -z "$product" -o -z "$variant" ]
540 export TARGET_PRODUCT=$product
541 export TARGET_BUILD_VARIANT=$variant
542 export TARGET_SIMULATOR=false
543 export TARGET_BUILD_TYPE=release
548 set_stuff_for_environment
552 # Configures the build to build unbundled apps.
553 # Run tapas with one ore more app names (from LOCAL_PACKAGE_NAME)
556 local variant=$(echo -n $(echo $* | xargs -n 1 echo | grep -E '^(user|userdebug|eng)$'))
557 local apps=$(echo -n $(echo $* | xargs -n 1 echo | grep -E -v '^(user|userdebug|eng)$'))
559 if [ $(echo $variant | wc -w) -gt 1 ]; then
560 echo "tapas: Error: Multiple build variants supplied: $variant"
563 if [ -z "$variant" ]; then
566 if [ -z "$apps" ]; then
570 export TARGET_PRODUCT=generic
571 export TARGET_BUILD_VARIANT=$variant
572 export TARGET_SIMULATOR=false
573 export TARGET_BUILD_TYPE=release
574 export TARGET_BUILD_APPS=$apps
576 set_stuff_for_environment
582 local TOPFILE=build/core/envsetup.mk
583 if [ -n "$TOP" -a -f "$TOP/$TOPFILE" ] ; then
586 if [ -f $TOPFILE ] ; then
587 # The following circumlocution (repeated below as well) ensures
588 # that we record the true directory name and not one that is
589 # faked up with symlink names.
592 # We redirect cd to /dev/null in case it's aliased to
593 # a command that prints something as a side-effect
597 while [ \( ! \( -f $TOPFILE \) \) -a \( $PWD != "/" \) ]; do
602 if [ -f "$T/$TOPFILE" ]; then
615 echo "Couldn't locate the top of the tree. Try setting TOP."
619 function findmakefile()
621 TOPFILE=build/core/envsetup.mk
622 # We redirect cd to /dev/null in case it's aliased to
623 # a command that prints something as a side-effect
627 while [ \( ! \( -f $TOPFILE \) \) -a \( $PWD != "/" \) ]; do
629 if [ -f "$T/Android.mk" ]; then
641 # If we're sitting in the root of the build tree, just do a
643 if [ -f build/core/envsetup.mk -a -f Makefile ]; then
646 # Find the closest Android.mk file.
648 local M=$(findmakefile)
649 # Remove the path to top as the makefilepath needs to be relative
650 local M=`echo $M|sed 's:'$T'/::'`
652 echo "Couldn't locate the top of the tree. Try setting TOP."
653 elif [ ! "$M" ]; then
654 echo "Couldn't locate a makefile from the current directory."
656 ONE_SHOT_MAKEFILE=$M make -C $T all_modules $@
668 local DASH_ARGS=$(echo "$@" | awk -v RS=" " -v ORS=" " '/^-.*$/')
669 local DIRS=$(echo "$@" | awk -v RS=" " -v ORS=" " '/^[^-].*$/')
670 for DIR in $DIRS ; do
671 DIR=`echo $DIR | sed -e 's:/$::'`
672 if [ -f $DIR/Android.mk ]; then
673 TO_CHOP=`(cd -P -- $T && pwd -P) | wc -c | tr -d ' '`
674 TO_CHOP=`expr $TO_CHOP + 1`
675 START=`PWD= /bin/pwd`
676 MFILE=`echo $START | cut -c${TO_CHOP}-`
677 if [ "$MFILE" = "" ] ; then
678 MFILE=$DIR/Android.mk
680 MFILE=$MFILE/$DIR/Android.mk
682 MAKEFILE="$MAKEFILE $MFILE"
684 if [ "$DIR" = snod ]; then
686 elif [ "$DIR" = showcommands ]; then
687 ARGS="$ARGS showcommands"
688 elif [ "$DIR" = dist ]; then
691 echo "No Android.mk in $DIR."
696 ONE_SHOT_MAKEFILE="$MAKEFILE" make -C $T $DASH_ARGS all_modules $ARGS
698 echo "Couldn't locate the top of the tree. Try setting TOP."
708 echo "Couldn't locate the top of the tree. Try setting TOP."
714 TOPFILE=build/core/envsetup.mk
715 # We redirect cd to /dev/null in case it's aliased to
716 # a command that prints something as a side-effect
720 while [ \( ! \( -f $TOPFILE \) \) -a \( $PWD != "/" \) ]; do
722 if [ -f "$T/Android.mk" ]; then
729 echo "can't find Android.mk"
736 local PID=`adb shell ps | fgrep $1 | sed -e 's/[^ ]* *\([0-9]*\).*/\1/'`
739 echo "usage: pid name"
743 # systemstack - dump the current stack trace of all threads in the system process
744 # to the usual ANR traces file
745 function systemstack()
747 adb shell echo '""' '>>' /data/anr/traces.txt && adb shell chmod 776 /data/anr/traces.txt && adb shell kill -3 $(pid system_server)
752 local OUT_ROOT=$(get_abs_build_var PRODUCT_OUT)
753 local OUT_SYMBOLS=$(get_abs_build_var TARGET_OUT_UNSTRIPPED)
754 local OUT_SO_SYMBOLS=$(get_abs_build_var TARGET_OUT_SHARED_LIBRARIES_UNSTRIPPED)
755 local OUT_EXE_SYMBOLS=$(get_abs_build_var TARGET_OUT_EXECUTABLES_UNSTRIPPED)
756 local PREBUILTS=$(get_abs_build_var ANDROID_PREBUILTS)
757 if [ "$OUT_ROOT" -a "$PREBUILTS" ]; then
766 if [ "$PORT" ] ; then
774 if [ "$PROG" ] ; then
776 adb forward "tcp$PORT" "tcp$PORT"
777 adb shell gdbserver $PORT --attach $PID &
781 echo "If you haven't done so already, do this first on the device:"
782 echo " gdbserver $PORT /system/bin/$EXE"
784 echo " gdbserver $PORT --attach $PID"
788 echo >|"$OUT_ROOT/gdbclient.cmds" "set solib-absolute-prefix $OUT_SYMBOLS"
789 echo >>"$OUT_ROOT/gdbclient.cmds" "set solib-search-path $OUT_SO_SYMBOLS"
790 echo >>"$OUT_ROOT/gdbclient.cmds" "target remote $PORT"
791 echo >>"$OUT_ROOT/gdbclient.cmds" ""
793 arm-eabi-gdb -x "$OUT_ROOT/gdbclient.cmds" "$OUT_EXE_SYMBOLS/$EXE"
795 echo "Unable to determine build system output dir."
804 find -E . -type f -iregex '.*\.(c|h|cpp|S|java|xml|sh|mk)' -print0 | xargs -0 grep --color -n "$@"
811 find . -type f -iregex '.*\.\(c\|h\|cpp\|S\|java\|xml\|sh\|mk\)' -print0 | xargs -0 grep --color -n "$@"
818 find . -type f -name "*\.java" -print0 | xargs -0 grep --color -n "$@"
823 find . -type f \( -name '*.c' -o -name '*.cc' -o -name '*.cpp' -o -name '*.h' \) -print0 | xargs -0 grep --color -n "$@"
828 for dir in `find . -name res -type d`; do find $dir -type f -name '*\.xml' -print0 | xargs -0 grep --color -n "$@"; done;
835 find -E . -type f -iregex '.*/(Makefile|Makefile\..*|.*\.make|.*\.mak|.*\.mk)' -print0 | xargs -0 grep --color -n "$@"
840 find -E . -type f -iregex '.*\.(c|h|cpp|S|java|xml)' -print0 | xargs -0 grep --color -n -i "$@"
847 find . -regextype posix-egrep -iregex '(.*\/Makefile|.*\/Makefile\..*|.*\.make|.*\.mak|.*\.mk)' -type f -print0 | xargs -0 grep --color -n "$@"
852 find . -regextype posix-egrep -iregex '.*\.(c|h|cpp|S|java|xml)' -type f -print0 | xargs -0 grep --color -n -i "$@"
860 get_abs_build_var ANDROID_PREBUILTS
863 function tracedmdump()
867 echo "Couldn't locate the top of the tree. Try setting TOP."
870 local prebuiltdir=$(getprebuilt)
871 local KERNEL=$T/prebuilt/android-arm/kernel/vmlinux-qemu
874 if [ ! "$TRACE" ] ; then
875 echo "usage: tracedmdump tracename"
879 if [ ! -r "$KERNEL" ] ; then
880 echo "Error: cannot find kernel: '$KERNEL'"
884 local BASETRACE=$(basename $TRACE)
885 if [ "$BASETRACE" = "$TRACE" ] ; then
886 TRACE=$ANDROID_PRODUCT_OUT/traces/$TRACE
889 echo "post-processing traces..."
890 rm -f $TRACE/qtrace.dexlist
892 if [ $? -ne 0 ]; then
894 echo "*** Error: malformed trace. Did you remember to exit the emulator?"
898 echo "generating dexlist output..."
899 /bin/ls $ANDROID_PRODUCT_OUT/system/framework/*.jar $ANDROID_PRODUCT_OUT/system/app/*.apk $ANDROID_PRODUCT_OUT/data/app/*.apk 2>/dev/null | xargs dexlist > $TRACE/qtrace.dexlist
900 echo "generating dmtrace data..."
901 q2dm -r $ANDROID_PRODUCT_OUT/symbols $TRACE $KERNEL $TRACE/dmtrace || return
902 echo "generating html file..."
903 dmtracedump -h $TRACE/dmtrace >| $TRACE/dmtrace.html || return
904 echo "done, see $TRACE/dmtrace.html for details"
906 echo " traceview $TRACE/dmtrace"
909 # communicate with a running device or emulator, set up necessary state,
910 # and run the hat command.
913 # process standard adb options
915 if [ "$1" = "-d" -o "$1" = "-e" ]; then
918 elif [ "$1" = "-s" ]; then
922 local adbOptions=${adbTarget}
923 echo adbOptions = ${adbOptions}
929 if [ "$targetPid" = "" ]; then
930 echo "Usage: runhat [ -d | -e | -s serial ] target-pid [output-file]"
934 # confirm hat is available
935 if [ -z $(which hat) ]; then
936 echo "hat is not available in this configuration."
940 adb ${adbOptions} shell >/dev/null mkdir /data/misc
941 adb ${adbOptions} shell chmod 777 /data/misc
943 # send a SIGUSR1 to cause the hprof dump
944 echo "Poking $targetPid and waiting for data..."
945 adb ${adbOptions} shell kill -10 $targetPid
946 echo "Press enter when logcat shows \"hprof: heap dump completed\""
950 local availFiles=( $(adb ${adbOptions} shell ls /data/misc | grep '^heap-dump' | sed -e 's/.*heap-dump-/heap-dump-/' | sort -r | tr '[:space:][:cntrl:]' ' ') )
951 local devFile=/data/misc/${availFiles[0]}
952 local localFile=/tmp/$$-hprof
954 echo "Retrieving file $devFile..."
955 adb ${adbOptions} pull $devFile $localFile
957 adb ${adbOptions} shell rm $devFile
959 echo "Running hat on $localFile"
960 echo "View the output by pointing your browser at http://localhost:7000/"
965 function getbugreports()
967 local reports=(`adb shell ls /sdcard/bugreports | tr -d '\r'`)
969 if [ ! "$reports" ]; then
970 echo "Could not locate any bugreports."
975 for report in ${reports[@]}
977 echo "/sdcard/bugreports/${report}"
978 adb pull /sdcard/bugreports/${report} ${report}
983 function startviewserver()
986 if [ $# -gt 0 ]; then
989 adb shell service call window 1 i32 $port
992 function stopviewserver()
994 adb shell service call window 2
997 function isviewserverstarted()
999 adb shell service call window 3
1002 function smoketest()
1004 if [ ! "$ANDROID_PRODUCT_OUT" ]; then
1005 echo "Couldn't locate output files. Try running 'lunch' first." >&2
1010 echo "Couldn't locate the top of the tree. Try setting TOP." >&2
1014 (cd "$T" && mmm tests/SmokeTest) &&
1015 adb uninstall com.android.smoketest > /dev/null &&
1016 adb uninstall com.android.smoketest.tests > /dev/null &&
1017 adb install $ANDROID_PRODUCT_OUT/data/app/SmokeTestApp.apk &&
1018 adb install $ANDROID_PRODUCT_OUT/data/app/SmokeTest.apk &&
1019 adb shell am instrument -w com.android.smoketest.tests/android.test.InstrumentationTestRunner
1022 # simple shortcut to the runtest command
1027 echo "Couldn't locate the top of the tree. Try setting TOP." >&2
1030 ("$T"/development/testrunner/runtest.py $@)
1034 if [[ -z "$1" ]]; then
1035 echo "Usage: godir <regex>"
1039 if [[ ! -f $T/filelist ]]; then
1040 echo -n "Creating index..."
1041 (cd $T; find . -wholename ./out -prune -o -wholename ./.repo -prune -o -type f > filelist)
1046 lines=($(grep "$1" $T/filelist | sed -e 's/\/[^/]*$//' | sort | uniq))
1047 if [[ ${#lines[@]} = 0 ]]; then
1053 if [[ ${#lines[@]} > 1 ]]; then
1054 while [[ -z "$pathname" ]]; do
1057 for line in ${lines[@]}; do
1058 printf "%6s %s\n" "[$index]" $line
1059 index=$(($index + 1))
1062 echo -n "Select one: "
1065 if [[ $choice -gt ${#lines[@]} || $choice -lt 1 ]]; then
1066 echo "Invalid choice"
1069 pathname=${lines[$(($choice-1))]}
1072 pathname=${lines[0]}
1077 # Force JAVA_HOME to point to java 1.6 if it isn't already set
1078 function set_java_home() {
1079 if [ ! "$JAVA_HOME" ]; then
1082 export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home
1085 export JAVA_HOME=/usr/lib/jvm/java-6-sun
1091 if [ "x$SHELL" != "x/bin/bash" ]; then
1092 case `ps -o command -p $$` in
1096 echo "WARNING: Only bash is supported, use of other shell would lead to erroneous results"
1101 # Execute the contents of any vendorsetup.sh files we can find.
1102 for f in `/bin/ls vendor/*/vendorsetup.sh vendor/*/*/vendorsetup.sh device/*/*/vendorsetup.sh 2> /dev/null`