随着项目越来越多,服务器的磁盘空间捉襟见肘,这个脚本是在同一套code上建立新的project,这样可以根据不用的配置build不同的project,这样就能大大的节省磁盘空间了。
把这个脚本放在alps的跟目录下。
运行方式: ./autoClone project1 projcet2
project1为当前code中已经存在的project
projcet2为你需要新建的project
例如:./autoClone ztenj77_sz_cu_jb mt6577_sz_cu_jb 这样就能新建mt6577_sz_cu_jb的工程了
注意:编译的时候需要加上你要编译的工程
各个工程之间的编译不会影响(当然,共用的文件有错了肯定是都编不过的)。
autoClone.dat 下载链接:点击打开链接
#!/bin/bash
project=$1
newproject=$2
echo "start to create a new project"
cp -a mediatek/config/${project} mediatek/config/${newproject}
cp -a mediatek/custom/${project} mediatek/custom/${newproject}
cp -a build/target/product/${project}.mk build/target/product/${newproject}.mk
cp -a vendor/mediatek/${project} vendor/mediatek/${newproject}
cp -a vendor/mediatek/${newproject}/artifacts/out/target/product/${project} vendor/mediatek/${newproject}/artifacts/out/target/product/${newproject}
if [ ! -d "vendor/mediatek/${newproject}/artifacts/out/target/product/${project}" ]; then
echo "vendor/mediatek/${newproject}/artifacts/out/target/product/${project} is not existed"
else
rm -rf vendor/mediatek/${newproject}/artifacts/out/target/product/${project}
fi
if [ ! -f "bootable/bootloader/lk/project/${project}.mk" ]; then
echo "bootable/bootloader/lk/project/${project}.mk is not existed. Fail to copy. it's for android4.1"
else
cp -a bootable/bootloader/lk/project/${project}.mk bootable/bootloader/lk/project/${newproject}.mk
fi
echo "create done"
#Don't copy result to out/../$project
#./copyResult $path