summaryrefslogtreecommitdiff
path: root/envsetup.sh
diff options
context:
space:
mode:
Diffstat (limited to 'envsetup.sh')
-rw-r--r--envsetup.sh49
1 files changed, 45 insertions, 4 deletions
diff --git a/envsetup.sh b/envsetup.sh
index 253688236c..85545cde2a 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -44,6 +44,12 @@ Invoke ". build/envsetup.sh" from your shell to add the following functions to y
- refreshmod: Refresh list of modules for allmod/gomod/pathmod/outmod/installmod.
- syswrite: Remount partitions (e.g. system.img) as writable, rebooting if necessary.
+EOF
+
+ __print_ice_functions_help
+
+cat <<EOF
+
Environment options:
- SANITIZE_HOST: Set to 'address' to use ASAN for all host modules.
- ANDROID_QUIET_BUILD: set to 'true' to display only the essential messages.
@@ -53,7 +59,7 @@ EOF
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
+ for i in `cat $T/build/envsetup.sh $T/vendor/ice/build/envsetup.sh | sed -n "/^[[:blank:]]*function /s/function \([a-z_]*\).*/\1/p" | sort | uniq`; do
A="$A $i"
done
echo $A
@@ -64,8 +70,8 @@ function build_build_var_cache()
{
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' ' '`)
+ cached_vars=(`cat $T/build/envsetup.sh $T/vendor/ice/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 $T/vendor/ice/build/envsetup.sh | tr '()' ' ' | awk '{for(i=1;i<=NF;i++) if($i~/get_abs_build_var/) print $(i+1)}' | sort -u | tr '\n' ' '`)
# Call the build system to dump the "<val>=<value>" pairs as a shell script.
build_dicts_script=`\builtin cd $T; build/soong/soong_ui.bash --dumpvars-mode \
--vars="${cached_vars[*]}" \
@@ -147,6 +153,13 @@ function check_product()
echo "Couldn't locate the top of the tree. Try setting TOP." >&2
return
fi
+ if (echo -n $1 | grep -q -e "^ice_") ; then
+ ICE_BUILD=$(echo -n $1 | sed -e 's/^ice_//g')
+ else
+ ICE_BUILD=
+ fi
+ export ICE_BUILD
+
TARGET_PRODUCT=$1 \
TARGET_BUILD_VARIANT= \
TARGET_BUILD_TYPE= \
@@ -360,7 +373,6 @@ function set_stuff_for_environment()
setpaths
set_sequence_number
- export ANDROID_BUILD_TOP=$(gettop)
# With this environment variable new GCC can apply colors to warnings/errors
export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
}
@@ -697,12 +709,37 @@ function lunch()
return 1
fi
+ check_product $product
+ if [ $? -ne 0 ]
+ then
+ # if we can't find a product, try to grab it off our github
+ T=$(gettop)
+ cd $T > /dev/null
+ vendor/ice/build/tools/roomservice.py $product
+ cd - > /dev/null
+ check_product $product
+ else
+ T=$(gettop)
+ cd $T > /dev/null
+ vendor/ice/build/tools/roomservice.py $product true
+ cd - > /dev/null
+ fi
+
TARGET_PRODUCT=$product \
TARGET_BUILD_VARIANT=$variant \
TARGET_PLATFORM_VERSION=$version \
build_build_var_cache
if [ $? -ne 0 ]
then
+ echo
+ echo "** Don't have a product spec for: '$product'"
+ echo "** Do you have the right repo manifest?"
+ product=
+ fi
+
+ if [ -z "$product" -o -z "$variant" ]
+ then
+ echo
return 1
fi
export TARGET_PRODUCT=$(get_build_var TARGET_PRODUCT)
@@ -1910,3 +1947,7 @@ function showcommands() {
validate_current_shell
source_vendorsetup
addcompletions
+
+export ANDROID_BUILD_TOP=$(gettop)
+
+. $ANDROID_BUILD_TOP/vendor/ice/build/envsetup.sh