function __print_build_functions_help() { cat < /dev/null` do echo "including $f" . $f done unset f if [ $# -eq 0 ]; then # No arguments, so let's have the full menu lunch else echo "z$target" | grep -q "-" if [ $? -eq 0 ]; then # A buildtype was specified, assume a full device name lunch $target else # This is probably just the model name if [ -z "$variant" ]; then variant="userdebug" fi lunch twrp_$target-$variant fi fi return $? } alias bib=breakfast function fixup_common_out_dir() { common_out_dir=$(get_build_var OUT_DIR)/target/common target_device=$(get_build_var TARGET_DEVICE) if [ ! -z $ANDROID_FIXUP_COMMON_OUT ]; then if [ -d ${common_out_dir} ] && [ ! -L ${common_out_dir} ]; then mv ${common_out_dir} ${common_out_dir}-${target_device} ln -s ${common_out_dir}-${target_device} ${common_out_dir} else [ -L ${common_out_dir} ] && rm ${common_out_dir} mkdir -p ${common_out_dir}-${target_device} ln -s ${common_out_dir}-${target_device} ${common_out_dir} fi else [ -L ${common_out_dir} ] && rm ${common_out_dir} mkdir -p ${common_out_dir} fi } # Make using all available CPUs function mka() { m "$@" } function pushboot() { if [ ! -f $OUT/$* ]; then echo "File not found: $OUT/$*" return 1 fi adb root sleep 1 adb wait-for-device adb remount adb push $OUT/$* /$* adb reboot } function repopick() { set_stuff_for_environment T=$(gettop) $T/vendor/twrp/build/tools/repopick.py $@ } function aospremote() { if ! git rev-parse --git-dir &> /dev/null then echo ".git directory not found. Please run this from the root directory of the Android repository you wish to set up." return 1 fi git remote rm aosp 2> /dev/null local PROJECT=$(pwd -P | sed -e "s#$ANDROID_BUILD_TOP\/##; s#-caf.*##; s#\/default##") # Google moved the repo location in Oreo if [ $PROJECT = "build/make" ] then PROJECT="build" fi if (echo $PROJECT | grep -qv "^device") then local PFX="platform/" fi git remote add aosp https://android.googlesource.com/$PFX$PROJECT echo "Remote 'aosp' created" } function cafremote() { if ! git rev-parse --git-dir &> /dev/null then echo ".git directory not found. Please run this from the root directory of the Android repository you wish to set up." return 1 fi git remote rm caf 2> /dev/null local PROJECT=$(pwd -P | sed -e "s#$ANDROID_BUILD_TOP\/##; s#-caf.*##; s#\/default##") # Google moved the repo location in Oreo if [ $PROJECT = "build/make" ] then PROJECT="build" fi if [[ $PROJECT =~ "qcom/opensource" ]]; then PROJECT=$(echo $PROJECT | sed -e "s#qcom\/opensource#qcom-opensource#") fi if (echo $PROJECT | grep -qv "^device") then local PFX="platform/" fi git remote add caf https://source.codeaurora.org/quic/la/$PFX$PROJECT echo "Remote 'caf' created" } # Enable SD-LLVM if available if [ -d $(gettop)/vendor/qcom/sdclang ]; then export SDCLANG=true export SDCLANG_PATH="vendor/qcom/sdclang/4.0.2/prebuilt/linux-x86_64/bin" export SDCLANG_LTO_DEFS="vendor/qcom/sdclang/sdllvm-lto-defs.mk" export SDCLANG_CONFIG="vendor/qcom/sdclang/sdclang.json" export SDCLANG_AE_CONFIG="vendor/qcom/sdclang/sdclangAE.json" fi