Support running soong_ui.bash from anywhere in the tree

am: 1b82286736

Change-Id: Ibb81f6ae7be7d6fbcb8332565948a6e2d7305ccb
This commit is contained in:
Dan Willemsen 2017-07-13 21:41:30 +00:00 committed by android-build-merger
commit 1a5a707ab6
2 changed files with 9 additions and 2 deletions

View file

@ -39,9 +39,12 @@ function getoutdir
if [ "${OUT_DIR_COMMON_BASE-}" ]; then
out_dir="${OUT_DIR_COMMON_BASE}/$(basename ${TOP})"
else
out_dir="${TOP}/out"
out_dir="out"
fi
fi
if [[ "${out_dir}" != /* ]]; then
out_dir="${TOP}/${out_dir}"
fi
echo "${out_dir}"
}

View file

@ -47,8 +47,12 @@ function gettop
fi
}
# Save the current PWD for use in soong_ui
export ORIGINAL_PWD=${PWD}
export TOP=$(gettop)
source build/soong/cmd/microfactory/microfactory.bash
source ${TOP}/build/soong/cmd/microfactory/microfactory.bash
build_go soong_ui android/soong/cmd/soong_ui
cd ${TOP}
exec "$(getoutdir)/soong_ui" "$@"