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 (cd $T; 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 ##################################################################
99 if [ -n $ANDROID_BUILD_PATHS ] ; then
100 export PATH=${PATH/$ANDROID_BUILD_PATHS/}
102 if [ -n $ANDROID_PRE_BUILD_PATHS ] ; then
103 export PATH=${PATH/$ANDROID_PRE_BUILD_PATHS/}
106 # and in with the new
108 prebuiltdir=$(getprebuilt)
109 export ANDROID_EABI_TOOLCHAIN=$prebuiltdir/toolchain/arm-linux-androideabi-4.4.x/bin
110 export ARM_EABI_TOOLCHAIN=$prebuiltdir/toolchain/arm-eabi-4.4.3/bin
111 export ANDROID_TOOLCHAIN=$ANDROID_EABI_TOOLCHAIN
112 export ANDROID_QTOOLS=$T/development/emulator/qtools
113 export ANDROID_BUILD_PATHS=:$(get_build_var ANDROID_BUILD_PATHS):$ANDROID_QTOOLS:$ANDROID_TOOLCHAIN:$ARM_EABI_TOOLCHAIN$CODE_REVIEWS
114 export PATH=$PATH$ANDROID_BUILD_PATHS
116 unset ANDROID_JAVA_TOOLCHAIN
117 if [ -n "$JAVA_HOME" ]; then
118 export ANDROID_JAVA_TOOLCHAIN=$JAVA_HOME/bin
120 export ANDROID_PRE_BUILD_PATHS=$ANDROID_JAVA_TOOLCHAIN
121 if [ -n "$ANDROID_PRE_BUILD_PATHS" ]; then
122 export PATH=$ANDROID_PRE_BUILD_PATHS:$PATH
125 unset ANDROID_PRODUCT_OUT
126 export ANDROID_PRODUCT_OUT=$(get_abs_build_var PRODUCT_OUT)
127 export OUT=$ANDROID_PRODUCT_OUT
129 unset ANDROID_HOST_OUT
130 export ANDROID_HOST_OUT=$(get_abs_build_var HOST_OUT)
132 # needed for building linux on MacOS
134 #export HOST_EXTRACFLAGS="-I "$T/system/kernel_headers/host_include
136 # needed for OProfile to post-process collected samples
137 export OPROFILE_EVENTS_DIR=$prebuiltdir/oprofile
140 function printconfig()
144 echo "Couldn't locate the top of the tree. Try setting TOP." >&2
147 get_build_var report_config
150 function set_stuff_for_environment()
157 export ANDROID_BUILD_TOP=$(gettop)
160 function set_sequence_number()
162 export BUILD_ENV_SEQUENCE_NUMBER=10
167 if [ "$STAY_OFF_MY_LAWN" = "" ]; then
168 local product=$TARGET_PRODUCT
169 local variant=$TARGET_BUILD_VARIANT
170 local apps=$TARGET_BUILD_APPS
171 if [ -z "$apps" ]; then
172 export PROMPT_COMMAND="echo -ne \"\033]0;[${product}-${variant}] ${USER}@${HOSTNAME}: ${PWD}\007\""
174 export PROMPT_COMMAND="echo -ne \"\033]0;[$apps $variant] ${USER}@${HOSTNAME}: ${PWD}\007\""
183 echo "Build for the simulator or the device?"
188 export TARGET_SIMULATOR=
190 while [ -z $TARGET_SIMULATOR ]
192 echo -n "Which would you like? [1] "
193 if [ -z "$1" ] ; then
201 export TARGET_SIMULATOR=false
204 export TARGET_SIMULATOR=false
207 export TARGET_SIMULATOR=false
210 export TARGET_SIMULATOR=true
213 export TARGET_SIMULATOR=true
217 echo "I didn't understand your response. Please try again."
221 if [ -n "$1" ] ; then
226 set_stuff_for_environment
232 echo "Only device builds are supported for" `uname -s`
233 echo " Forcing TARGET_SIMULATOR=false"
237 echo -n "Press enter: "
241 export TARGET_SIMULATOR=false
242 set_stuff_for_environment
247 function choosetype()
249 echo "Build type choices are:"
254 local DEFAULT_NUM DEFAULT_VALUE
255 if [ $TARGET_SIMULATOR = "false" ] ; then
257 DEFAULT_VALUE=release
263 export TARGET_BUILD_TYPE=
265 while [ -z $TARGET_BUILD_TYPE ]
267 echo -n "Which would you like? ["$DEFAULT_NUM"] "
268 if [ -z "$1" ] ; then
276 export TARGET_BUILD_TYPE=$DEFAULT_VALUE
279 export TARGET_BUILD_TYPE=release
282 export TARGET_BUILD_TYPE=release
285 export TARGET_BUILD_TYPE=debug
288 export TARGET_BUILD_TYPE=debug
292 echo "I didn't understand your response. Please try again."
296 if [ -n "$1" ] ; then
301 set_stuff_for_environment
305 # This function isn't really right: It chooses a TARGET_PRODUCT
306 # based on the list of boards. Usually, that gets you something
307 # that kinda works with a generic product, but really, you should
308 # pick a product by name.
310 function chooseproduct()
312 if [ "x$TARGET_PRODUCT" != x ] ; then
313 default_value=$TARGET_PRODUCT
315 if [ "$TARGET_SIMULATOR" = true ] ; then
322 export TARGET_PRODUCT=
324 while [ -z "$TARGET_PRODUCT" ]
326 echo -n "Which product would you like? [$default_value] "
327 if [ -z "$1" ] ; then
334 if [ -z "$ANSWER" ] ; then
335 export TARGET_PRODUCT=$default_value
337 if check_product $ANSWER
339 export TARGET_PRODUCT=$ANSWER
341 echo "** Not a valid product: $ANSWER"
344 if [ -n "$1" ] ; then
349 set_stuff_for_environment
352 function choosevariant()
354 echo "Variant choices are:"
357 for v in ${VARIANT_CHOICES[@]}
359 # The product name is the name of the directory containing
360 # the makefile we found, above.
365 local default_value=eng
368 export TARGET_BUILD_VARIANT=
369 while [ -z "$TARGET_BUILD_VARIANT" ]
371 echo -n "Which would you like? [$default_value] "
372 if [ -z "$1" ] ; then
379 if [ -z "$ANSWER" ] ; then
380 export TARGET_BUILD_VARIANT=$default_value
381 elif (echo -n $ANSWER | grep -q -e "^[0-9][0-9]*$") ; then
382 if [ "$ANSWER" -le "${#VARIANT_CHOICES[@]}" ] ; then
383 export TARGET_BUILD_VARIANT=${VARIANT_CHOICES[$(($ANSWER-1))]}
386 if check_variant $ANSWER
388 export TARGET_BUILD_VARIANT=$ANSWER
390 echo "** Not a valid variant: $ANSWER"
393 if [ -n "$1" ] ; then
399 function choosecombo()
416 set_stuff_for_environment
420 # Clear this variable. It will be built up again when the vendorsetup.sh
421 # files are included at the end of this file.
422 unset LUNCH_MENU_CHOICES
423 function add_lunch_combo()
427 for c in ${LUNCH_MENU_CHOICES[@]} ; do
428 if [ "$new_combo" = "$c" ] ; then
432 LUNCH_MENU_CHOICES=(${LUNCH_MENU_CHOICES[@]} $new_combo)
435 # add the default one here
436 add_lunch_combo full-eng
437 add_lunch_combo full_x86-eng
439 # if we're on linux, add the simulator. There is a special case
440 # in lunch to deal with the simulator
441 if [ "$(uname)" = "Linux" ] ; then
442 add_lunch_combo simulator
445 function print_lunch_menu()
449 echo "You're building on" $uname
451 echo "Lunch menu... pick a combo:"
455 for choice in ${LUNCH_MENU_CHOICES[@]}
472 echo -n "Which would you like? [full-eng] "
481 elif [ "$answer" = "simulator" ]
484 elif (echo -n $answer | grep -q -e "^[0-9][0-9]*$")
486 if [ $answer -le ${#LUNCH_MENU_CHOICES[@]} ]
488 selection=${LUNCH_MENU_CHOICES[$(($answer-1))]}
490 elif (echo -n $answer | grep -q -e "^[^\-][^\-]*-[^\-][^\-]*$")
495 if [ -z "$selection" ]
498 echo "Invalid lunch combo: $answer"
502 export TARGET_BUILD_APPS=
504 # special case the simulator
505 if [ "$selection" = "simulator" ]
507 export TARGET_PRODUCT=sim
508 export TARGET_BUILD_VARIANT=eng
509 export TARGET_SIMULATOR=true
510 export TARGET_BUILD_TYPE=debug
512 local product=$(echo -n $selection | sed -e "s/-.*$//")
513 check_product $product
517 echo "** Don't have a product spec for: '$product'"
518 echo "** Do you have the right repo manifest?"
522 local variant=$(echo -n $selection | sed -e "s/^[^\-]*-//")
523 check_variant $variant
527 echo "** Invalid variant: '$variant'"
528 echo "** Must be one of ${VARIANT_CHOICES[@]}"
532 if [ -z "$product" -o -z "$variant" ]
538 export TARGET_PRODUCT=$product
539 export TARGET_BUILD_VARIANT=$variant
540 export TARGET_SIMULATOR=false
541 export TARGET_BUILD_TYPE=release
546 set_stuff_for_environment
550 # Tab completion for lunch.
555 cur="${COMP_WORDS[COMP_CWORD]}"
556 prev="${COMP_WORDS[COMP_CWORD-1]}"
558 COMPREPLY=( $(compgen -W "${LUNCH_MENU_CHOICES[*]}" -- ${cur}) )
561 complete -F _lunch lunch
563 # Configures the build to build unbundled apps.
564 # Run tapas with one ore more app names (from LOCAL_PACKAGE_NAME)
567 local variant=$(echo -n $(echo $* | xargs -n 1 echo | grep -E '^(user|userdebug|eng)$'))
568 local apps=$(echo -n $(echo $* | xargs -n 1 echo | grep -E -v '^(user|userdebug|eng)$'))
570 if [ $(echo $variant | wc -w) -gt 1 ]; then
571 echo "tapas: Error: Multiple build variants supplied: $variant"
574 if [ -z "$variant" ]; then
577 if [ -z "$apps" ]; then
581 export TARGET_PRODUCT=full
582 export TARGET_BUILD_VARIANT=$variant
583 export TARGET_SIMULATOR=false
584 export TARGET_BUILD_TYPE=release
585 export TARGET_BUILD_APPS=$apps
587 set_stuff_for_environment
593 local TOPFILE=build/core/envsetup.mk
594 if [ -n "$TOP" -a -f "$TOP/$TOPFILE" ] ; then
597 if [ -f $TOPFILE ] ; then
598 # The following circumlocution (repeated below as well) ensures
599 # that we record the true directory name and not one that is
600 # faked up with symlink names.
603 # We redirect cd to /dev/null in case it's aliased to
604 # a command that prints something as a side-effect
608 while [ \( ! \( -f $TOPFILE \) \) -a \( $PWD != "/" \) ]; do
613 if [ -f "$T/$TOPFILE" ]; then
626 echo "Couldn't locate the top of the tree. Try setting TOP."
630 function findmakefile()
632 TOPFILE=build/core/envsetup.mk
633 # We redirect cd to /dev/null in case it's aliased to
634 # a command that prints something as a side-effect
638 while [ \( ! \( -f $TOPFILE \) \) -a \( $PWD != "/" \) ]; do
640 if [ -f "$T/Android.mk" ]; then
652 # If we're sitting in the root of the build tree, just do a
654 if [ -f build/core/envsetup.mk -a -f Makefile ]; then
657 # Find the closest Android.mk file.
659 local M=$(findmakefile)
660 # Remove the path to top as the makefilepath needs to be relative
661 local M=`echo $M|sed 's:'$T'/::'`
663 echo "Couldn't locate the top of the tree. Try setting TOP."
664 elif [ ! "$M" ]; then
665 echo "Couldn't locate a makefile from the current directory."
667 ONE_SHOT_MAKEFILE=$M make -C $T all_modules $@
679 local DASH_ARGS=$(echo "$@" | awk -v RS=" " -v ORS=" " '/^-.*$/')
680 local DIRS=$(echo "$@" | awk -v RS=" " -v ORS=" " '/^[^-].*$/')
681 for DIR in $DIRS ; do
682 DIR=`echo $DIR | sed -e 's:/$::'`
683 if [ -f $DIR/Android.mk ]; then
684 TO_CHOP=`(cd -P -- $T && pwd -P) | wc -c | tr -d ' '`
685 TO_CHOP=`expr $TO_CHOP + 1`
686 START=`PWD= /bin/pwd`
687 MFILE=`echo $START | cut -c${TO_CHOP}-`
688 if [ "$MFILE" = "" ] ; then
689 MFILE=$DIR/Android.mk
691 MFILE=$MFILE/$DIR/Android.mk
693 MAKEFILE="$MAKEFILE $MFILE"
695 if [ "$DIR" = snod ]; then
697 elif [ "$DIR" = showcommands ]; then
698 ARGS="$ARGS showcommands"
699 elif [ "$DIR" = dist ]; then
701 elif [ "$DIR" = incrementaljavac ]; then
702 ARGS="$ARGS incrementaljavac"
704 echo "No Android.mk in $DIR."
709 ONE_SHOT_MAKEFILE="$MAKEFILE" make -C $T $DASH_ARGS all_modules $ARGS
711 echo "Couldn't locate the top of the tree. Try setting TOP."
721 echo "Couldn't locate the top of the tree. Try setting TOP."
727 TOPFILE=build/core/envsetup.mk
728 # We redirect cd to /dev/null in case it's aliased to
729 # a command that prints something as a side-effect
733 while [ \( ! \( -f $TOPFILE \) \) -a \( $PWD != "/" \) ]; do
735 if [ -f "$T/Android.mk" ]; then
742 echo "can't find Android.mk"
749 local PID=`adb shell ps | fgrep $1 | sed -e 's/[^ ]* *\([0-9]*\).*/\1/'`
752 echo "usage: pid name"
756 # systemstack - dump the current stack trace of all threads in the system process
757 # to the usual ANR traces file
758 function systemstack()
760 adb shell echo '""' '>>' /data/anr/traces.txt && adb shell chmod 776 /data/anr/traces.txt && adb shell kill -3 $(pid system_server)
765 local OUT_ROOT=$(get_abs_build_var PRODUCT_OUT)
766 local OUT_SYMBOLS=$(get_abs_build_var TARGET_OUT_UNSTRIPPED)
767 local OUT_SO_SYMBOLS=$(get_abs_build_var TARGET_OUT_SHARED_LIBRARIES_UNSTRIPPED)
768 local OUT_EXE_SYMBOLS=$(get_abs_build_var TARGET_OUT_EXECUTABLES_UNSTRIPPED)
769 local PREBUILTS=$(get_abs_build_var ANDROID_PREBUILTS)
770 if [ "$OUT_ROOT" -a "$PREBUILTS" ]; then
779 if [ "$PORT" ] ; then
787 if [ "$PROG" ] ; then
789 adb forward "tcp$PORT" "tcp$PORT"
790 adb shell gdbserver $PORT --attach $PID &
794 echo "If you haven't done so already, do this first on the device:"
795 echo " gdbserver $PORT /system/bin/$EXE"
797 echo " gdbserver $PORT --attach $PID"
801 echo >|"$OUT_ROOT/gdbclient.cmds" "set solib-absolute-prefix $OUT_SYMBOLS"
802 echo >>"$OUT_ROOT/gdbclient.cmds" "set solib-search-path $OUT_SO_SYMBOLS"
803 echo >>"$OUT_ROOT/gdbclient.cmds" "target remote $PORT"
804 echo >>"$OUT_ROOT/gdbclient.cmds" ""
806 arm-linux-androideabi-gdb -x "$OUT_ROOT/gdbclient.cmds" "$OUT_EXE_SYMBOLS/$EXE"
808 echo "Unable to determine build system output dir."
817 find -E . -type f -iregex '.*\.(c|h|cpp|S|java|xml|sh|mk)' -print0 | xargs -0 grep --color -n "$@"
824 find . -type f -iregex '.*\.\(c\|h\|cpp\|S\|java\|xml\|sh\|mk\)' -print0 | xargs -0 grep --color -n "$@"
831 find . -type f -name "*\.java" -print0 | xargs -0 grep --color -n "$@"
836 find . -type f \( -name '*.c' -o -name '*.cc' -o -name '*.cpp' -o -name '*.h' \) -print0 | xargs -0 grep --color -n "$@"
841 for dir in `find . -name res -type d`; do find $dir -type f -name '*\.xml' -print0 | xargs -0 grep --color -n "$@"; done;
848 find -E . -type f -iregex '.*/(Makefile|Makefile\..*|.*\.make|.*\.mak|.*\.mk)' -print0 | xargs -0 grep --color -n "$@"
853 find -E . -type f -iregex '.*\.(c|h|cpp|S|java|xml)' -print0 | xargs -0 grep --color -n -i "$@"
860 find . -regextype posix-egrep -iregex '(.*\/Makefile|.*\/Makefile\..*|.*\.make|.*\.mak|.*\.mk)' -type f -print0 | xargs -0 grep --color -n "$@"
865 find . -regextype posix-egrep -iregex '.*\.(c|h|cpp|S|java|xml)' -type f -print0 | xargs -0 grep --color -n -i "$@"
873 get_abs_build_var ANDROID_PREBUILTS
876 function tracedmdump()
880 echo "Couldn't locate the top of the tree. Try setting TOP."
883 local prebuiltdir=$(getprebuilt)
884 local KERNEL=$T/prebuilt/android-arm/kernel/vmlinux-qemu
887 if [ ! "$TRACE" ] ; then
888 echo "usage: tracedmdump tracename"
892 if [ ! -r "$KERNEL" ] ; then
893 echo "Error: cannot find kernel: '$KERNEL'"
897 local BASETRACE=$(basename $TRACE)
898 if [ "$BASETRACE" = "$TRACE" ] ; then
899 TRACE=$ANDROID_PRODUCT_OUT/traces/$TRACE
902 echo "post-processing traces..."
903 rm -f $TRACE/qtrace.dexlist
905 if [ $? -ne 0 ]; then
907 echo "*** Error: malformed trace. Did you remember to exit the emulator?"
911 echo "generating dexlist output..."
912 /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
913 echo "generating dmtrace data..."
914 q2dm -r $ANDROID_PRODUCT_OUT/symbols $TRACE $KERNEL $TRACE/dmtrace || return
915 echo "generating html file..."
916 dmtracedump -h $TRACE/dmtrace >| $TRACE/dmtrace.html || return
917 echo "done, see $TRACE/dmtrace.html for details"
919 echo " traceview $TRACE/dmtrace"
922 # communicate with a running device or emulator, set up necessary state,
923 # and run the hat command.
926 # process standard adb options
928 if [ "$1" = "-d" -o "$1" = "-e" ]; then
931 elif [ "$1" = "-s" ]; then
935 local adbOptions=${adbTarget}
936 echo adbOptions = ${adbOptions}
941 if [ "$targetPid" = "" ]; then
942 echo "Usage: runhat [ -d | -e | -s serial ] target-pid"
946 # confirm hat is available
947 if [ -z $(which hat) ]; then
948 echo "hat is not available in this configuration."
952 # issue "am" command to cause the hprof dump
953 local devFile=/sdcard/hprof-$targetPid
954 echo "Poking $targetPid and waiting for data..."
955 adb ${adbOptions} shell am dumpheap $targetPid $devFile
956 echo "Press enter when logcat shows \"hprof: heap dump completed\""
960 local localFile=/tmp/$$-hprof
962 echo "Retrieving file $devFile..."
963 adb ${adbOptions} pull $devFile $localFile
965 adb ${adbOptions} shell rm $devFile
967 echo "Running hat on $localFile"
968 echo "View the output by pointing your browser at http://localhost:7000/"
973 function getbugreports()
975 local reports=(`adb shell ls /sdcard/bugreports | tr -d '\r'`)
977 if [ ! "$reports" ]; then
978 echo "Could not locate any bugreports."
983 for report in ${reports[@]}
985 echo "/sdcard/bugreports/${report}"
986 adb pull /sdcard/bugreports/${report} ${report}
991 function startviewserver()
994 if [ $# -gt 0 ]; then
997 adb shell service call window 1 i32 $port
1000 function stopviewserver()
1002 adb shell service call window 2
1005 function isviewserverstarted()
1007 adb shell service call window 3
1012 adb shell input keyevent 3
1017 adb shell input keyevent 4
1022 adb shell input keyevent 82
1025 function smoketest()
1027 if [ ! "$ANDROID_PRODUCT_OUT" ]; then
1028 echo "Couldn't locate output files. Try running 'lunch' first." >&2
1033 echo "Couldn't locate the top of the tree. Try setting TOP." >&2
1037 (cd "$T" && mmm tests/SmokeTest) &&
1038 adb uninstall com.android.smoketest > /dev/null &&
1039 adb uninstall com.android.smoketest.tests > /dev/null &&
1040 adb install $ANDROID_PRODUCT_OUT/data/app/SmokeTestApp.apk &&
1041 adb install $ANDROID_PRODUCT_OUT/data/app/SmokeTest.apk &&
1042 adb shell am instrument -w com.android.smoketest.tests/android.test.InstrumentationTestRunner
1045 # simple shortcut to the runtest command
1050 echo "Couldn't locate the top of the tree. Try setting TOP." >&2
1053 ("$T"/development/testrunner/runtest.py $@)
1057 if [[ -z "$1" ]]; then
1058 echo "Usage: godir <regex>"
1062 if [[ ! -f $T/filelist ]]; then
1063 echo -n "Creating index..."
1064 (cd $T; find . -wholename ./out -prune -o -wholename ./.repo -prune -o -type f > filelist)
1069 lines=($(grep "$1" $T/filelist | sed -e 's/\/[^/]*$//' | sort | uniq))
1070 if [[ ${#lines[@]} = 0 ]]; then
1076 if [[ ${#lines[@]} > 1 ]]; then
1077 while [[ -z "$pathname" ]]; do
1080 for line in ${lines[@]}; do
1081 printf "%6s %s\n" "[$index]" $line
1082 index=$(($index + 1))
1085 echo -n "Select one: "
1088 if [[ $choice -gt ${#lines[@]} || $choice -lt 1 ]]; then
1089 echo "Invalid choice"
1092 pathname=${lines[$(($choice-1))]}
1095 pathname=${lines[0]}
1100 # Force JAVA_HOME to point to java 1.6 if it isn't already set
1101 function set_java_home() {
1102 if [ ! "$JAVA_HOME" ]; then
1105 export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home
1108 export JAVA_HOME=/usr/lib/jvm/java-6-sun
1114 case `ps -o command -p $$` in
1118 echo "WARNING: Only bash is supported, use of other shell would lead to erroneous results"
1122 # Execute the contents of any vendorsetup.sh files we can find.
1123 for f in `/bin/ls vendor/*/vendorsetup.sh vendor/*/*/vendorsetup.sh device/*/*/vendorsetup.sh 2> /dev/null`