Merge "Move common functions to script_utils.sh"
This commit is contained in:
@@ -18,34 +18,8 @@
|
|||||||
# that's detected in the Go code, which skips calculating the startup time.
|
# that's detected in the Go code, which skips calculating the startup time.
|
||||||
export TRACE_BEGIN_SOONG=$(date +%s%N)
|
export TRACE_BEGIN_SOONG=$(date +%s%N)
|
||||||
|
|
||||||
# Function to find top of the source tree (if $TOP isn't set) by walking up the
|
source $(cd $(dirname $BASH_SOURCE) &> /dev/null && pwd)/../make/shell_utils.sh
|
||||||
# tree.
|
require_top
|
||||||
function gettop
|
|
||||||
{
|
|
||||||
local TOPFILE=build/soong/root.bp
|
|
||||||
if [ -n "${TOP-}" -a -f "${TOP-}/${TOPFILE}" ] ; then
|
|
||||||
# The following circumlocution ensures we remove symlinks from TOP.
|
|
||||||
(cd $TOP; PWD= /bin/pwd)
|
|
||||||
else
|
|
||||||
if [ -f $TOPFILE ] ; then
|
|
||||||
# The following circumlocution (repeated below as well) ensures
|
|
||||||
# that we record the true directory name and not one that is
|
|
||||||
# faked up with symlink names.
|
|
||||||
PWD= /bin/pwd
|
|
||||||
else
|
|
||||||
local HERE=$PWD
|
|
||||||
T=
|
|
||||||
while [ \( ! \( -f $TOPFILE \) \) -a \( $PWD != "/" \) ]; do
|
|
||||||
\cd ..
|
|
||||||
T=`PWD= /bin/pwd -P`
|
|
||||||
done
|
|
||||||
\cd $HERE
|
|
||||||
if [ -f "$T/$TOPFILE" ]; then
|
|
||||||
echo $T
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Save the current PWD for use in soong_ui
|
# Save the current PWD for use in soong_ui
|
||||||
export ORIGINAL_PWD=${PWD}
|
export ORIGINAL_PWD=${PWD}
|
||||||
|
@@ -85,7 +85,7 @@ function create_mock_soong {
|
|||||||
create_mock_bazel
|
create_mock_bazel
|
||||||
copy_directory build/blueprint
|
copy_directory build/blueprint
|
||||||
copy_directory build/soong
|
copy_directory build/soong
|
||||||
copy_directory build/make/tools/rbcrun
|
copy_directory build/make
|
||||||
|
|
||||||
symlink_directory prebuilts/sdk
|
symlink_directory prebuilts/sdk
|
||||||
symlink_directory prebuilts/go
|
symlink_directory prebuilts/go
|
||||||
|
Reference in New Issue
Block a user