I just wrote this bash script just for fun:
PROJECT="/path/to/the/project"
for file in $(ls $PROJECT/res/drawable -l | awk '{ print $8}' | sed 's/\..\+//g'); do count=0; for SRCFILE in `find $PROJECT -name "*.xml" -print 2> /dev/null`; do let "count+=$(grep -c @drawable/$file $SRCFILE)"; done; for SRCFILE in `find $PROJECT -name "*.java" -print 2> /dev/null`; do let "count+=$(grep -c R.drawable.$file $SRCFILE)"; done; if [ $count -lt 1 ]; then echo -e "\e[0;31m$file\e[0m not used"; else echo -e "\e[0;32m$file\e[0m used"; fi; done;
It works fine, though I'm a bash newbie so it can be highly improved:
It searches drawables resources only (@drawable/name
on the XML files, and R.drawable.name
on the Java files).
By the way, I didn't know that boxscore
and calendarlogos
were not being used in my project. Another funny fact is that most users don't use Linux, so this won't help too many people.