summaryrefslogtreecommitdiff
path: root/envsetup.sh
diff options
context:
space:
mode:
Diffstat (limited to 'envsetup.sh')
-rw-r--r--envsetup.sh48
1 files changed, 43 insertions, 5 deletions
diff --git a/envsetup.sh b/envsetup.sh
index ae8d331148..94779a7a34 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -101,6 +101,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.
@@ -110,7 +116,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
@@ -121,8 +127,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[*]}" \
@@ -204,6 +210,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= \
@@ -411,8 +424,6 @@ function set_stuff_for_environment()
{
set_lunch_paths
set_sequence_number
-
- export ANDROID_BUILD_TOP=$(gettop)
}
function set_sequence_number()
@@ -821,6 +832,21 @@ function lunch()
return 1
fi
+ if ! check_product $product
+ 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 \
@@ -831,6 +857,15 @@ function lunch()
then
echo "Did you mean -${product/*_/}? (dash instead of underscore)"
fi
+ 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)
@@ -2149,3 +2184,6 @@ set_global_paths
source_vendorsetup
addcompletions
+export ANDROID_BUILD_TOP=$(gettop)
+
+. $ANDROID_BUILD_TOP/vendor/ice/build/envsetup.sh