第一个Shell脚本-lint检查以及报告收集
2015-11-19 16:14
831 查看
作用
在不需要开发修改android项目配置文件的情况下,执行Android lint检查,检查完后,将各个aar包下的检查结果从远程机器copy到节点机器上来。源码
#!/bin/sh #用于Android Lint检查项目中,将构建任务中的lint文件copy到当前job中 #从pmo机器中将所有的build文件保存到本地机器上来 #lint文件所在的根目录 work_dir=$1 #需要移动到目标目录 target_dir=$2 echo "lint源目录 : "+$work_dir echo "lint将要移动到的目录 : "+$target_dir echo "============================start=============" # 清空结果目录 delete_report_dir(){ if [ ! -d $target_dir/report ];then mkdir $target_dir/report fi for dir2del in $target_dir/report/* ; do if [ -d $dir2del ]; then rm -rf $dir2del fi done } echo "================delete_report_dir_end============" #移动文件到报告目录 move_dir_lint_file(){ currenDir=$1 for i in `find $currenDir`;do if [[ "${i##*/}" =~ "lint-results" ]];then dir_file=$target_dir/report/${currenDir##*/} # echo "目标存放目录"+$dir_file # echo "目标文件:" + $i mkdir -p $dir_file cp -rf $i $dir_file fi done } echo "================move_dir_lint_file============" list_alldir(){ for file2 in `ls -a $work_dir` do if [ x"$file2" != x"." -a x"$file2" != x".." ];then if [ -d "$work_dir/$file2" ];then echo "$work_dir/$file2" move_dir_lint_file $work_dir/$file2 fi fi done } echo "================list_alldir_end============"
相关文章推荐
- spark-shell客户机设置
- Android中执行java命令的方法及java代码执行并解析shell命令
- linux shell pushd popd dirs命令
- XShell配色方案(总结)
- 连续ping IP地址 shell脚本【来自《鸟哥linux的私房菜》】
- shell中字体变色
- bash: useradd: command not found
- 【算法】希尔排序
- Linux Shell编程入门
- Bash Shell注释
- shell脚本学习(一)
- shell安装LAMP环境
- xshell 常用的使用方法
- shell if [ -d filename]
- shell基本命令:使用命令行不全和通配符
- busybox里的init
- Deep Learning in a Nutshell: Core Concepts
- shell调试
- Hadoop2.x HDFS Shell命令
- shell脚本:lvs启动简易脚本