Fix findunusedresources to handle package name different from path

Change-Id: Ia010d0f71e3e7141f762fc83ff34d3426bac85a0
This commit is contained in:
Marco Nelissen
2012-01-27 16:07:59 -08:00
parent 2b53ba5897
commit 936e648ce9

View File

@@ -35,6 +35,7 @@ do
if [ -d $app/res ]
then
appname=$(basename $app)
iappname=$(grep LOCAL_PACKAGE_NAME $app/Android.mk | sed 's/.*:= *//')
resources=
for res in $(echo $app/res/* $(find $ANDROID_BUILD_TOP/vendor -type d -wholename $ANDROID_BUILD_TOP/vendor/*/$appname/res | grep overlay))
do
@@ -51,7 +52,7 @@ do
fi
# find the R.java file that contains all the generated resource identifiers
rDotJava=$(find $ANDROID_BUILD_TOP/out/target/common/obj/APPS/${appname}_intermediates/ -name R.java)
rDotJava=$(find $ANDROID_BUILD_TOP/out/target/common/obj/APPS/${iappname}_intermediates/ -name R.java)
# Simplistically process the content of the file to get the names of all the constants,
# and try to find a reference to each constant.