forked from openkylin/platform_build
Add cproj function to envsetup.sh that finds an Android.mk and goes to its directory.
This commit is contained in:
parent
1951d0eed9
commit
2a5d4d81b2
20
envsetup.sh
20
envsetup.sh
|
@ -656,6 +656,26 @@ function croot()
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function cproj()
|
||||||
|
{
|
||||||
|
TOPFILE=build/core/envsetup.mk
|
||||||
|
# We redirect cd to /dev/null in case it's aliased to
|
||||||
|
# a command that prints something as a side-effect
|
||||||
|
# (like pushd)
|
||||||
|
local HERE=$PWD
|
||||||
|
T=
|
||||||
|
while [ \( ! \( -f $TOPFILE \) \) -a \( $PWD != "/" \) ]; do
|
||||||
|
T=$PWD
|
||||||
|
if [ -f "$T/Android.mk" ]; then
|
||||||
|
cd $T
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
cd .. > /dev/null
|
||||||
|
done
|
||||||
|
cd $HERE > /dev/null
|
||||||
|
echo "can't find Android.mk"
|
||||||
|
}
|
||||||
|
|
||||||
function pid()
|
function pid()
|
||||||
{
|
{
|
||||||
local EXE="$1"
|
local EXE="$1"
|
||||||
|
|
Loading…
Reference in New Issue