Commit 871a68ac authored by Mathieu Maret's avatar Mathieu Maret

Add tool to generate cscope file for aosp

parent 37f34f8a
DIR="dalvik device frameworks hardware libnativehelper system packages"
TMP=$(mktemp /tmp/XXXXX-cscope.files)
gettop ()
{
local TOPFILE=build/core/envsetup.mk;
if [ -n "$TOP" -a -f "$TOP/$TOPFILE" ]; then
echo $TOP;
else
if [ -f $TOPFILE ]; then
PWD= /bin/pwd;
else
local HERE=$PWD;
T=;
while [ \( ! \( -f $TOPFILE \) \) -a \( $PWD != "/" \) ]; do
\cd ..;
T=`PWD= /bin/pwd`;
done;
\cd $HERE;
if [ -f "$T/$TOPFILE" ]; then
echo $T;
fi;
fi;
fi
}
T=$(gettop);
if [ "$T" ]; then
\cd $(gettop);
else
echo "Couldn't locate the top of the tree. Try setting TOP.";
exit
fi
for dir in $DIR;
do
echo "Looking for files in $dir"
find $PWD/$dir -name .git -prune -o -type f \( -iname '*.c' -o -iname '*.cc' -o -iname '*.cpp' -o -iname '*.h' -o -iname '*.hpp' -o -iname "*.mk" -o -iname "*.java" -o -iname "*.aidl" \) | egrep -v "/\.git$" >> $TMP
done
echo "generate cscope"
cscope -bkq -i $TMP
rm $TMP
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment