构建源码

Posted littleyang

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了构建源码相关的知识,希望对你有一定的参考价值。

 1 echo $HOME
 2 # For macOS 10.12+, new security enforcement need following command.
 3 #security set-key-partition-list -S apple: -k "Password" -D $HOME/Library/Keychains/login.keychain-db
 4 #security set-key-partition-list -S apple-tool:,apple: -s -k "Password" $HOME/Library/Keychains/login.keychain-db
 5 #security unlock-keychain -p "Password" $HOME/Library/Keychains/login.keychain-db
 6 security unlock-keychain -p "yunwei" $HOME/Library/Keychains/login.keychain
 7 rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"
 8 rm -rf ~/Library/Developer/Xcode/DerivedData
 9 rm -rf ~/Library/Caches/com.apple.dt.Xcode
10 /usr/local/bin/pod repo update --verbose lifesense-commonlib_ios-cocoapodsspecs
11 /usr/local/bin/pod install --verbose --no-repo-update
12 
13 if [ "${to_deploy}" == "dev" ];then
14 deploy="Debug"
15 pyname="dev"
16 elif [ "${to_deploy}" == "qa" ];then
17 deploy="Distribution"
18 pyname="qa"
19 elif [ "${to_deploy}" == "alpha" ];then
20 deploy="Distribution"
21 pyname="qa"
22 elif [ "${to_deploy}" == "enterprise" ];then
23 deploy="Enterprise"
24 pyname="enterprise"
25 elif [ "${to_deploy}" == "prerelease" ];then
26 deploy="PreRelease"
27 pyname="prerelease"
28 elif [ "${to_deploy}" == "qaEnterprise" ];then
29 deploy="QaEnterprise"
30 pyname="qaEnterprise"
31 elif [ "${to_deploy}" == "beta" ];then
32 deploy="Release"
33 pyname="release"
34 else 
35 deploy="Release"
36 pyname="release"
37 fi
38 
39 python ${WORKSPACE}/Build_scripts/build_$pyname.py
40 
41 ios_app_version=$(cat BuildProducts/LSWearable_$deploy.xcarchive/Info.plist |grep -A4 CFBundleShortVersionString|awk -F> ‘/string/ {print $2}‘|awk -F< ‘{print $1}‘|xargs |sed ‘s/ /_/‘)
42 mv BuildProducts/LSWearable.ipa BuildProducts/lxyd_${ios_app_version}_${BUILD_NUMBER}.ipa
43 mv Build_scripts/app.plist BuildProducts/
44 sed -i "" "[email protected]@https://app-test.lifesense.com/ios/$JOB_BASE_NAME/${to_deploy}/lxyd_${ios_app_version}_${BUILD_NUMBER}/lxyd_${ios_app_version}_${BUILD_NUMBER}[email protected]" BuildProducts/app.plist
45 mv BuildProducts/app.plist BuildProducts/lxyd_${ios_app_version}_${BUILD_NUMBER}.plist
46 mv BuildProducts/LSWearable_$deploy.xcarchive/dSYMs/LSWearable.app.dSYM/Contents/Resources/DWARF/LSWearable BuildProducts/
47 mv BuildProducts/LSWearable_$deploy.xcarchive/Info.plist BuildProducts/
48 rm -rf BuildProducts/LSWearable_$deploy.xcarchive
49 rm -f BuildProducts/QRCode.png
50 mv Build_scripts/html/* BuildProducts/
51 sed -i "" "[email protected][email protected]/$JOB_BASE_NAME/${to_deploy}/lxyd_${ios_app_version}_${BUILD_NUMBER}/[email protected]" BuildProducts/qrcode.html
52 
53 cat > BuildProducts/install.html << EOF
54 <!Doctype html>
55 <html xmlns=http://www.w3.org/1999/xhtml>
56 <?xml version="1.0" encoding="UTF-16"?>
57 <html>
58 <head><title>install-lxyd-ios</title></head>
59 <body>
60  <ul>
61   <li>
62    <a href="itms-services://?action=download-manifest&url=https://app-test.lifesense.com/ios/$JOB_BASE_NAME/${to_deploy}/lxyd_${ios_app_version}_${BUILD_NUMBER}/lxyd_${ios_app_version}_${BUILD_NUMBER}.plist">点击下载</a>
63   </li>
64  </ul>
65 </body>
66 </html>
67 EOF
68 
69 sed -i "" "[email protected]@https://app-test.lifesense.com/ios/$JOB_BASE_NAME/${to_deploy}/lxyd_${ios_app_version}_${BUILD_NUMBER}/lxyd_${ios_app_version}_${BUILD_NUMBER}[email protected]" BuildProducts/qrcode.html
70 sed -i "" "[email protected]@http://app-test.lifesense.com/ios/$JOB_BASE_NAME/${to_deploy}/lxyd_${ios_app_version}_${BUILD_NUMBER}/[email protected]" BuildProducts/qrcode.html
71 
72 rm -rf ios/$JOB_BASE_NAME/${to_deploy}/lxyd_${ios_app_version}_${BUILD_NUMBER}
73 mkdir -p ios/$JOB_BASE_NAME/${to_deploy}/lxyd_${ios_app_version}_${BUILD_NUMBER}
74 cp BuildProducts/* ios/$JOB_BASE_NAME/${to_deploy}/lxyd_${ios_app_version}_${BUILD_NUMBER}/
75 
76 
77 while [ 0 -eq 0 ]
78 do
79     echo ".................. job begin  ..................."     
80     rsync -Ravz --progress --port=11873 --password-file=/Users/yunwei/node/workspace/rsyncd.pass ios/$JOB_BASE_NAME/${to_deploy}/lxyd_${ios_app_version}_${BUILD_NUMBER}/* [email protected]::static-app-test/
81     if [ $? -eq 0 ]; then
82         echo "--------------- job complete ---------------"
83         break;
84     else
85         echo "...............error occur, retry in 2 seconds .........."
86         sleep 2
87     fi
88 done
89 
90 buildUrl=${BUILD_URL}
91 url=http://app-test.lifesense.com/ios/$JOB_BASE_NAME/${to_deploy}/lxyd_${ios_app_version}_${BUILD_NUMBER}/qrcode.html 
92 python sendemail.py $url [email protected] [email protected] ${buildUrl} ${to_deploy}





 1 if [ ${to_deploy} != "all" ]
 2 then
 3 rm -f weidong/build/outputs/apk/*-release-unaligned.apk
 4 rm -f weidong/build/outputs/mapping/guanwang/release/dump.txt
 5 build_verison=$(ls weidong/build/outputs/apk/lxyd-*|awk -F/ ‘{print $NF}‘|sed ‘s/.apk//‘)-${BUILD_NUMBER}
 6 apkname=$(ls weidong/build/outputs/apk/lxyd-*|awk -F/ ‘{print $NF}‘|sed ‘s/.apk//‘).apk
 7 buildUrl=${BUILD_URL}
 8 apkurl=http://app-test.lifesense.com/android/$JOB_BASE_NAME/${to_deploy}/$build_verison/$apkname
 9 mkdir -p android/$JOB_BASE_NAME/${to_deploy}/$build_verison/mapping
10 mv weidong/build/outputs/apk/*.apk android/$JOB_BASE_NAME/${to_deploy}/$build_verison/
11 mv weidong/build/outputs/mapping/${to_deploy}/release/* android/$JOB_BASE_NAME/${to_deploy}/$build_verison/mapping/
12 #生成qrcode.html
13 mv weidong/HTML/* android/$JOB_BASE_NAME/${to_deploy}/$build_verison/
14 htmlpath=android/$JOB_BASE_NAME/${to_deploy}/$build_verison/qrcode.html
15 sed -i "[email protected]@http://app-test.lifesense.com/android/$JOB_BASE_NAME/${to_deploy}/$build_verison/[email protected]" $htmlpath
16 sed -i "[email protected]@http://app-test.lifesense.com/android/$JOB_BASE_NAME/${to_deploy}/$build_verison/[email protected]" $htmlpath
17 buildDate=`date "+%Y-%m-%d %H:%M:%S"`
18 sed -i "[email protected]@[email protected]" $htmlpath
19 sed -i "[email protected]@[email protected]" $htmlpath
20 
21 
22 
23 rsync -Ravz --port=11873 --password-file=/data/android/rsyncd.pass android/$JOB_BASE_NAME/${to_deploy}/$build_verison/* [email protected]::static-app-test/
24 fi
25 
26 
27 python sendemail.py http://app-test.lifesense.com/android/$JOB_BASE_NAME/${to_deploy}/$build_verison/qrcode.html [email protected] [email protected] ${buildUrl} ${to_deploy} ${to_stage} 

 

 

 







以上是关于构建源码的主要内容,如果未能解决你的问题,请参考以下文章

使用 NodeJS 和 JSDOM/jQuery 从代码片段构建 PHP 页面

C# 获得目录创建时间的源码片段

初识Spring源码 -- doResolveDependency | findAutowireCandidates | @Order@Priority调用排序 | @Autowired注入(代码片段

初识Spring源码 -- doResolveDependency | findAutowireCandidates | @Order@Priority调用排序 | @Autowired注入(代码片段

Android 插件化VirtualApp 源码分析 ( 目前的 API 现状 | 安装应用源码分析 | 安装按钮执行的操作 | 返回到 HomeActivity 执行的操作 )(代码片段

我可以在片段中构建操作栏吗?