Android Java Jar包整合Shell脚本
2010-09-15 00:11:00 来源:WEB开发网用法:
./my_script.sh android_root_path dist_full.jar
脚本:
#!/bin/bash
# ./update_full_jar.sh android_root_dir ./dest_name.jar
#MYSRC=/home/baozaochao/work/_s7_eclair_svn_C00_bak/out/target/common/obj/JAVA_LIBRARIES/
#MYDST=/home/baozaochao/work/jars/dst/
MYDST=/tmp/__jar__temp/
ENDPATH=out/target/common/obj/JAVA_LIBRARIES/
CUR_PATH=$PWD
if [ ! -d "$1$ENDPATH" ];then
echo The directory $1 is not root of the project.
echo The commond like ./update_full_jar.sh projectRootPath/ buildToPath/
exit 1
fi
MYSRC="$PWD"/$1$ENDPATH
echo $MYSRC
if [ "$2" = "" ];then
echo The second parameter is required.
echo The commond like ./update_full_jar.sh projectRootPath/ dest.jar
exit 2
fi
JARDST=$2
JARDST="$PWD"/${JARDST%/}/
echo $JARDST
#exit 0
if [ -d "$MYDST" ];then
rm -rf $MYDST
fi
mkdir $MYDST
cd $MYDST
for dir in `ls $MYSRC`
do
if [ -d "$MYSRC$dir" ];then
src="$MYSRC$dir"/classes.jar
src2="$MYSRC$dir"/javalib.jar
dst=$MYDST${dir%_intermediates}.jar
if [ -f "$src" ];then
#echo #$src
cp $src $dst
jar xvf $dst
rm $dst -f
#break
elif [ -f "$src2" ];then
echo $src2
cp $src2 $dst
jar xvf $dst
rm $dst -f
#break
fi
fi
done
jar cvf "$JARDST" * && echo **** Build "$JARDST" success. **** && rm -rf $MYDST
- ››JavaScript项目优化总结
- ››Android 当修改一些代码时,使用什么编译命令可以最...
- ››Android 如何添加一个apk使模拟器和真机都编译进去...
- ››Android 修改Camera拍照的默认保存路径
- ››Android 如何修改默认输入法
- ››android开发中finish()和System.exit(0)的区别
- ››Android手势识别简单封装类
- ››Java获取特殊目录或特殊值
- ››android中查看项目数字证书的两种方法
- ››Android中获取IMEI码的办法
- ››android 相机报错 setParameters failed
- ››Android重启运用程序的代码
更多精彩
赞助商链接