android 删除android应用下面未被引用到的资源
来源:互联网 发布:递归算法计算树的度 编辑:程序博客网 时间:2024/05/21 18:43
下面为我同事阿庆书写
draw
./draw.check.sh /work/project/f0400s_app/packages/f0204capps/IndividualCenter/res/ /work/project/f0400s_app/packages/f0204capps/IndividualCenter/src/com/pateo/#!/bin/bashdeclare -a LAYOUTSdeclare -a PNGSdeclare -a LAYOUT_PATHSdeclare -a DRAWABLE_PATHSSEARCH_DIR=$1EXCLUDE_DIR=${SEARCH_DIR}/.gitSOURCE_DIR=$2EXCLUDE_SOURCE_DIR=${SOURCE_DIR}/.gitif [[ $# -ne 2 ]]; thenecho "$0 code_path java_path"exit 1ficd $SEARCH_DIRLAYOUT_PATH=$(find $SEARCH_DIR -type d -name layout)for LAYOUT_PATH in ${LAYOUT_PATHS[@]}doif [[ -z $LAYOUT_PATH ]]; thenecho "No layout/ find"elsecd $LAYOUT_PATHLAYOUTS=$(find . -name "*.xml" | sed -e 's#\./##')for LAYOUT in ${LAYOUTS[@]}doNO_POSTFIX=$(echo $LAYOUT | sed -e 's#\.xml##')result=$(grep -r -l -s --exclude-dir=${EXCLUDE_DIR} ${NO_POSTFIX} ${SEARCH_DIR})if [[ -z $result ]]; thenecho $LAYOUTrm $LAYOUT_PATH/$layoutfidonefidonecd $SEARCH_DIRDRAWABLE_PATHS=$(find $SEARCH_DIR -type d -name drawable)for DRAWABLE_PATH in ${DRAWABLE_PATHS[@]}doif [[ -z $DRAWABLE_PATH ]]; thenecho "No drawable/ found"elsecd $DRAWABLE_PATHPNGS=$(find . -name "*.png" | sed -e 's#\./##')for PNG in ${PNGS[@]}doNO_POSTFIX=$(echo ${PNG} | sed -e 's#\.png##g' | sed -e 's#\.[0-9]##g')result=$(grep -r -l -s --exclude-dir=${EXCLUDE_DIR} ${NO_POSTFIX} ${SEARCH_DIR})source_ref=$(grep -r -l -s --exclude-dir=${EXCLUDE_SOURCE_DIR} ${NO_POSTFIX} ${SOURCE_DIR})if [[ -z $result && -z $source_ref ]]; thenecho $PNGrm $DRAWABLE_PATH/$PNGfidonefidone
xml
./xml_check.sh /work/project/f0400s_app/packages/f0204capps/IndividualCenter/res/ /work/project/f0400s_app/packages/f0204capps/IndividualCenter/src/com/pateo/ /work/project/f0400s_app/packages/f0204capps/IndividualCenter/res/layout/
#!/bin/bashdeclare -a LAYOUTSdeclare -a PNGSdeclare -a LAYOUT_PATHSdeclare -a DRAWABLE_PATHSSEARCH_DIR=$1EXCLUDE_DIR=${SEARCH_DIR}/.gitSOURCE_DIR=$2EXCLUDE_SOURCE_DIR=${SOURCE_DIR}/.gitLAYOUT_DIR=$3EXCLUDE_LAYOUT_DIR=${LAYOUT_DIR}/.gitif [[ $# -ne 3 ]]; thenecho "$0 code_path java_path layout_path"exit 1ficd $SEARCH_DIRLAYOUT_PATHS=$(find $SEARCH_DIR -type d -name drawable)for LAYOUT_PATH in ${LAYOUT_PATHS[@]}doif [[ -z $LAYOUT_PATH ]]; thenecho "No drawable/ find"elsecd $LAYOUT_PATHLAYOUTS=$(find . -name "*.xml" | sed -e 's#\./##')cd $SOURCE_DIRfor LAYOUT in ${LAYOUTS[@]}doNO_POSTFIX=$(echo $LAYOUT | sed -e 's#\.xml##')result=$(grep -r -l -s --exclude-dir=${EXCLUDE_SOURCE_DIR} ${NO_POSTFIX} ${SOURCE_DIR})layout_ref=$(grep -r -l -s --exclude-dir=${EXCLUDE_LAYOUT_DIR} ${NO_POSTFIX} ${LAYOUT_DIR})if [[ -z $result && -z $layout_ref ]]; thenecho $LAYOUTrm $LAYOUT_PATH/$LAYOUTfidonefidone
layout
./layout_check.sh /work/project/f0400s_app/packages/f0204capps/IndividualCenter/res/ /work/project/f0400s_app/packages/f0204capps/IndividualCenter/src/com/pateo/
#!/bin/bashdeclare -a LAYOUTSdeclare -a PNGSdeclare -a LAYOUT_PATHSdeclare -a DRAWABLE_PATHSSEARCH_DIR=$1EXCLUDE_DIR=${SEARCH_DIR}/.gitSOURCE_DIR=$2EXCLUDE_SOURCE_DIR=${SOURCE_DIR}/.gitif [[ $# -ne 2 ]]; thenecho "$0 code_path java_path"exit 1ficd $SEARCH_DIRLAYOUT_PATHS=$(find $SEARCH_DIR -type d -name layout)for LAYOUT_PATH in ${LAYOUT_PATHS[@]}doif [[ -z $LAYOUT_PATH ]]; thenecho "No layout/ find"elsecd $LAYOUT_PATHLAYOUTS=$(find . -name "*.xml" | sed -e 's#\./##')for LAYOUT in ${LAYOUTS[@]}doNO_POSTFIX=$(echo $LAYOUT | sed -e 's#\.xml##')result=$(grep -r -l -s --exclude-dir=${EXCLUDE_DIR} ${NO_POSTFIX} ${SEARCH_DIR})source_ref=$(grep -r -l -s --exclude-dir=${EXCLUDE_SOURCE_DIR} ${NO_POSTFIX} ${SOURCE_DIR})if [[ -z $result && -z $source_ref ]]; thenecho $LAYOUTrm $LAYOUT_PATH/$LAYOUTfidonefidone
0 0
- android 删除android应用下面未被引用到的资源
- android删除未使用的资源文件
- Lint删除未引用的资源
- 一键删除android下面无用资源
- 自动删除Android项目中未使用的资源
- 清除Android工程中没用到/未用到的资源
- android studio lint(查看未被应用的资源文件)的使用
- android studio lint(查看未被应用的资源文件)的使用
- android得到assets下面的资源
- Android 下面资源的一些介绍
- Android之引用其它已安装或未安装apk文件的资源
- android 资源引用的例子
- android 资源引用的例子
- Android引用资源的方法
- Android的应用资源
- Android应用的资源
- Android应用的资源
- Android自动清理 无用 多余 未引用 未关联资源工具
- android PopupWindow实现从底部弹出或滑出选择菜单或窗口
- OpenGL ES2.0 – Iphone开发指引
- eclipse中配置c++开发环境 Eclipse + CDT + MinGW
- 记第一场Codeforces
- struts2 #parameters.XXX获取参数 在s:if标签中判断要注意!
- android 删除android应用下面未被引用到的资源
- MP4V2 ARM编译后,运行总是ABORT
- 面试题备忘
- Android中常见的MVC模式
- hdu 1002大数相加
- 程序员学习能力提升三要素
- C++ 备注
- linux 设置文件夹的权限
- 深入理解Java对象序列化