1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- #!/bin/sh
- # Shell主目录;
- SHELL_HOME="/home/data/ApkAutoCompile/shell"
- # 源码主目录;
- SRC_HOME="/home/data/ApkAutoCompile/cacheAndroidSrc"
- # 日志文件;
- if [ ! -d '/home/data/ApkAutoCompile/shell/log' ];then
- mkdir '/home/data/ApkAutoCompile/shell/log'
- fi
- #LOG_FILE="/home/data/ApkAutoCompile/shell/log/gradlewall-$(date '+%d-%H%M%S').log"
- LOG_FILE="/home/data/ApkAutoCompile/shell/log/gradlewall.log"
- function updateAll()
- {
- # 遍历源码主目录;
- for folder in $(ls ${SRC_HOME})
- do
- APK_SRC_DIR="${SRC_HOME}/${folder}"
- if [ -d ${APK_SRC_DIR}/.svn ];then
- echo -e "\r\n\r\n======================>开始更新:${APK_SRC_DIR}<======================"
- svn up ${APK_SRC_DIR}
- if [ -f ${APK_SRC_DIR}/update_modules.sh ];then
- echo -e "===========>has update_modules<==========="
- cd ${APK_SRC_DIR}
- chmod 777 update_modules.sh
- ./update_modules.sh
- fi
- echo -e "======================>更新完成:${APK_SRC_DIR}<======================\r\n\r\n"
- else
- echo -e "${APK_SRC_DIR} \t\t不是svn目录\r\n\r\n"
- fi
- done
- }
- function compileAll()
- {
- cd ${SHELL_HOME}
- for folder in $(ls ${SRC_HOME})
- do
- APK_SRC_DIR="${SRC_HOME}/${folder}"
- if [ -d ${APK_SRC_DIR}/.svn ];then
- echo -e "\r\n\r\n======================>开始编译: ${APK_SRC_DIR}<======================"
- ./gradlew.sh ${APK_SRC_DIR} 1
- echo -e "======================>完成编译: ${APK_SRC_DIR}<======================\r\n\r\n"
- fi
- done
- }
- function main()
- {
- # 更新全部apk
- updateAll
- # 编译全部apk
- compileAll
- echo -e "\r\nmain end."
- }
- main 2>&1 | tee ${LOG_FILE}
|