12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- #!/bin/bash
- #qt_com=$(arch)
- qt_com=`arch`
- if [ $qt_com = "aarch64" ];then
- qtmake="/usr/lib/aarch64-linux-gnu/qt5/bin/qmake"
- else
- qtmake="/opt/Qt5.10.1/5.10.1/gcc_64/bin/qmake"
- fi
- check_result()
- {
-
- if [ "$1" != 0 ];then
- echo -e "\e[33m*************************************************\e[0m"
- echo -e "\e[31m Please modify build error first,Exit!\e[0m"
- echo -e "\e[33m*************************************************\e[0m"
- exit 1
- fi
- }
- module=$1
- echo -e "\e[33m module name: \e[1;33m $module \e[0m"
- projectDir=`pwd`
- echo -e "project folder \e[33m$projectDir\e[0m"
- MAKEOPT=-j8
- mkdir bin
- outputDir=$projectDir"/bin"
- echo -e "output folder \e[33m$outputDir\e[0m"
- cd src
- sourceDir=`pwd`
- echo -e "source code folder \e[33m$sourceDir\e[0m"
- moduleDir=`find . -type d -name $module`
- if [ $moduleDir ];then
- moduleDir=$sourceDir${moduleDir#*.}
- echo -e "module code folder \e[33m$moduleDir\e[0m"
- cd $moduleDir
- moduleName=$module".pro"
- echo -e "\e[1;35;47m START BUILD\e[0m"
- $qtmake $moduleName
- make $MAKEOPT
- check_result $?
- make clean
- cp $module $outputDir
- rm Makefile
- rm .qmake.stash
- rm $module
- cd $projectDir
- echo -e "\e[1;33;44m Build $module Success \e[0m"
- sleep 1
- echo -e "\e[35m Start deploy\e[0m"
- cp $outputDir"/"$module ./
- bash deploy.sh $module
- if [ "$?" == 1 ];then
- exit 1
- fi
- rm $module
- echo -e "\e[1;33;44m Deploy $module Success \e[0m"
- else
- echo -e "\e[31m Can't find module code, exit.....\e[0m"
- exit
- fi
- qt_com=`arch`
- if [ $qt_com = "aarch64" ];then
- cp -r /usr/lib/aarch64-linux-gnu/nss/* ./deploy/app/lib/
- else
- cp -r /usr/lib/x86_64-linux-gnu/nss/* ./deploy/app/lib/
- fi
- #cp ./sh/BaiDuMap.html ./deploy/app/
- #cp ./sh/car.png ./deploy/app/
- #cp ./sh/asphalt.jpg ./deploy/app/
|