首页 > 代码库 > android 5.0 clone project 的方式
android 5.0 clone project 的方式
Clone Project 指的是对现有的Project创建出新的Project
后面指令中使用的变量含义如下:
$BASE_PROJECT 指的是新Project的基础Project
$NEW_PROJECT 指的是将创建的新的Project
$PLATFORM 指的是平台信息,如MT6795等
$COMPANY 指的是开案公司的名字,如lenovo, tinno, huawei等等。
cd bootable/bootloader/preloader/custom :(clone preloader)
输入以下指令
cp -r ${BASE_PROJECT} ${NEW_PROJECT}
mv ${NEW_PROJECT}/${BASE_PROJECT}.mk ${NEW_PROJECT}/${NEW_PROJECT}.mk
sed -i s/${BASE_PROJECT}/${NEW_PROJECT}/g ${NEW_PROJECT}/${NEW_PROJECT}.mk
cd bootable/bootloader/lk : (clone lk)
输入以下指令
cp project/${BASE_PROJECT}.mk project/${NEW_PROJECT}.mk
cp -r target/${BASE_PROJECT} target/${NEW_PROJECT}
sed -i s/${BASE_PROJECT}/${NEW_PROJECT}/g project/${NEW_PROJECT}.mk
sed -i s /${BASE_PROJECT}/${NEW_PROJECT}/g target/${NEW_PROJECT}/include/target/cust_usb.h
cd kernel-3.10/ :(clone kernel)
输入以下指令
cp -r drivers/misc/mediatek/mach/mt6795/${BASE_PROJECT} drivers/misc/mediatek/mach/mt6795/${NEW_PROJECT}
cp arch/arm64/configs/${BASE_PROJECT}_defconfig arch/arm64/configs/${NEW_PROJECT}_defconfig
cp arch/arm64/configs/${BASE_PROJECT}_debug_defconfig arch/arm64/configs/${NEW_PROJECT}_debug_defconfig
cd kernel-3.10/arch/arm64/
sed -i s/${BASE_PROJECT}/${NEW_PROJECT}/g configs/${NEW_PROJECT}_defconfig
sed -i s/${BASE_PROJECT}/${NEW_PROJECT}/g configs/${NEW_PROJECT}_debug_defconfig
cp boot/dts/ ${BASE_PROJECT}.dts boot/dts/ ${NEW_PROJECT}.dts
clone android
cp -r device/${COMPANY}/${BASE_PROJECT} device/${COMPANY}/${NEW_PROJECT}
mv device/${COMPANY}/${NEW_PROJECT}/full_${BASE_PROJECT}.mk device/${COMPANY}/ ${NEW_PROJECT}/full_${NEW_PROJECT}.mk
cp -r vendor/mediatek/proprietary/custom/${BASE_PROJECT} vendor/mediatek/proprietary/custom/${NEW_PROJECT}
cp vendor/mediatek/proprietary/trustzone/project /${BASE_PROJECT} mk vendor/mediatek/proprietary/trustzone/project /${NEW_PROJECT } mk
cp md32/md32/project /${BASE_PROJECT} .mk md32/md32/project /${NEW_PROJECT} .mk
sed -i s/${BASE_PROJECT}/${NEW_PROJECT}/g device/${COMPANY}/${NEW_PROJECT}/AndroidProducts.mk
sed -i s/${BASE_PROJECT}/${NEW_PROJECT}/g device/${COMPANY}/${NEW_PROJECT}/BoardConfig.mk
sed -i s/${BASE_PROJECT}/${NEW_PROJECT}/g device/${COMPANY}/${NEW_PROJECT}/device.mk
sed -i s/${BASE_PROJECT}/${NEW_PROJECT}/g device/${COMPANY}/${NEW_PROJECT}/full_${NEW_PROJECT}.mk
sed -i s/${BASE_PROJECT}/${NEW_PROJECT}/g device/${COMPANY}/${NEW_PROJECT}/vendorsetup.sh
sed -i s/${BASE_PROJECT}/${NEW_PROJECT}/g vendor/mediatek/proprietary/custom/${NEW_PROJECT}/Android.mk
If share libraries with ${BASE_PROJECT}
sed -i s#vendor/${COMPANY}/libs/${NEW_PROJECT}#vendor/${COMPANY}/libs/${BASE_PROJECT}#g device/${COMPANY}/${NEW_PROJECT}/device.mk
If not share libraries with ${BASE_PROJECT}
cp –r vendor/${COMPANY}/libs/${BASE_PROJECT} vendor/${COMPANY}/libs/${NEW_PROJECT}
后面指令中使用的变量含义如下:
$BASE_PROJECT 指的是新Project的基础Project
$NEW_PROJECT 指的是将创建的新的Project
$PLATFORM 指的是平台信息,如MT6795等
$COMPANY 指的是开案公司的名字,如lenovo, tinno, huawei等等。
cd bootable/bootloader/preloader/custom :(clone preloader)
输入以下指令
cp -r ${BASE_PROJECT} ${NEW_PROJECT}
mv ${NEW_PROJECT}/${BASE_PROJECT}.mk ${NEW_PROJECT}/${NEW_PROJECT}.mk
sed -i s/${BASE_PROJECT}/${NEW_PROJECT}/g ${NEW_PROJECT}/${NEW_PROJECT}.mk
cd bootable/bootloader/lk : (clone lk)
输入以下指令
cp project/${BASE_PROJECT}.mk project/${NEW_PROJECT}.mk
cp -r target/${BASE_PROJECT} target/${NEW_PROJECT}
sed -i s/${BASE_PROJECT}/${NEW_PROJECT}/g project/${NEW_PROJECT}.mk
sed -i s /${BASE_PROJECT}/${NEW_PROJECT}/g target/${NEW_PROJECT}/include/target/cust_usb.h
cd kernel-3.10/ :(clone kernel)
输入以下指令
cp -r drivers/misc/mediatek/mach/mt6795/${BASE_PROJECT} drivers/misc/mediatek/mach/mt6795/${NEW_PROJECT}
cp arch/arm64/configs/${BASE_PROJECT}_defconfig arch/arm64/configs/${NEW_PROJECT}_defconfig
cp arch/arm64/configs/${BASE_PROJECT}_debug_defconfig arch/arm64/configs/${NEW_PROJECT}_debug_defconfig
cd kernel-3.10/arch/arm64/
sed -i s/${BASE_PROJECT}/${NEW_PROJECT}/g configs/${NEW_PROJECT}_defconfig
sed -i s/${BASE_PROJECT}/${NEW_PROJECT}/g configs/${NEW_PROJECT}_debug_defconfig
cp boot/dts/ ${BASE_PROJECT}.dts boot/dts/ ${NEW_PROJECT}.dts
clone android
cp -r device/${COMPANY}/${BASE_PROJECT} device/${COMPANY}/${NEW_PROJECT}
mv device/${COMPANY}/${NEW_PROJECT}/full_${BASE_PROJECT}.mk device/${COMPANY}/ ${NEW_PROJECT}/full_${NEW_PROJECT}.mk
cp -r vendor/mediatek/proprietary/custom/${BASE_PROJECT} vendor/mediatek/proprietary/custom/${NEW_PROJECT}
cp vendor/mediatek/proprietary/trustzone/project /${BASE_PROJECT} mk vendor/mediatek/proprietary/trustzone/project /${NEW_PROJECT } mk
cp md32/md32/project /${BASE_PROJECT} .mk md32/md32/project /${NEW_PROJECT} .mk
sed -i s/${BASE_PROJECT}/${NEW_PROJECT}/g device/${COMPANY}/${NEW_PROJECT}/AndroidProducts.mk
sed -i s/${BASE_PROJECT}/${NEW_PROJECT}/g device/${COMPANY}/${NEW_PROJECT}/BoardConfig.mk
sed -i s/${BASE_PROJECT}/${NEW_PROJECT}/g device/${COMPANY}/${NEW_PROJECT}/device.mk
sed -i s/${BASE_PROJECT}/${NEW_PROJECT}/g device/${COMPANY}/${NEW_PROJECT}/full_${NEW_PROJECT}.mk
sed -i s/${BASE_PROJECT}/${NEW_PROJECT}/g device/${COMPANY}/${NEW_PROJECT}/vendorsetup.sh
sed -i s/${BASE_PROJECT}/${NEW_PROJECT}/g vendor/mediatek/proprietary/custom/${NEW_PROJECT}/Android.mk
If share libraries with ${BASE_PROJECT}
sed -i s#vendor/${COMPANY}/libs/${NEW_PROJECT}#vendor/${COMPANY}/libs/${BASE_PROJECT}#g device/${COMPANY}/${NEW_PROJECT}/device.mk
If not share libraries with ${BASE_PROJECT}
cp –r vendor/${COMPANY}/libs/${BASE_PROJECT} vendor/${COMPANY}/libs/${NEW_PROJECT}
android 5.0 clone project 的方式
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。