Permalink
Browse files

完善mac下自动构建dmg脚本

  • Loading branch information...
1 parent 01913cc commit 0470285fab45168ed846ae138cd26106c864a161 @iptton iptton committed Sep 19, 2012
Showing with 49 additions and 16 deletions.
  1. +2 −1 Rythem.pro
  2. +38 −12 publish
  3. +8 −2 readme.md
  4. +1 −1 ryupdatechecker.h
View
@@ -151,7 +151,8 @@ OTHER_FILES += \
rythem_zh_CN.qm \
deploy.txt \
qt_zh_CN.qm \
- setupproxy
+ setupproxy \
+ publish
CONFIG(release){
#DEFINES += DEBUGTOFILE
#message("debug")
View
50 publish
@@ -1,21 +1,47 @@
#!/bin/sh
# generate dmg pkg
-macdeployqt $1/Rythem.app -dmg
-hdiutil convert Rythem.dmg -format UDSP -o Rythem-rw.dmg
-tmp=`hdiutil attach Rythem-rw.dmg.sparseimage`;
+
+
+macdeployqt Rythem.app -dmg
+
+# convert to read-write image
+hdiutil convert Rythem.dmg -format UDRW -o Rythem-rw.dmg
+
+# open read-write image
+tmp=`hdiutil attach Rythem-rw.dmg`;
echo "tmp = $tmp"
+
+# get the opened image's device path and file path
dev=`echo "$tmp" | awk 'END{print $1}'`
-targetDir=`echo "$tmp" | awk 'END{print $NF}'`
+
+# targetDir should be "/Volumne/Rythem 1" or "/Volumn/Rythem"
+# if target Dir is number, it should be "/Volumne/Rythem 1"
+targetDir=`echo "$tmp" | awk 'END{
+ match($NF,/^[0-9]+$/)
+ if( RLENGTH -eq -1 ){
+ print $NF;
+ }else{
+ print $(NF-1),$NF;
+ }
+ }'`
+echo $targetDir
+
+# save current directory and jump to opened image file path
tmpDir=`pwd`
-cd $targetDir
-pwd
+cd "$targetDir"
+
+# link /Applications to the image
ln -s /Applications Applications
-echo "introduce: http://www.alloyteam.com/2012/05/web-front-end-tool-rythem-1/" > $targetDir/readme.txt
+
+# make introduce file
+cp $2/readme.md ./
+
+# back
cd $tmpDir
-#/usr/bin/drutil eject $targetDir
-hdiutil convert Rythem-rw.dmg.sparseimage -format UDZO -o Rythem-release.dmg
-mv -f Rythem-release.dmg ~/
hdiutil detach -force $dev
-#rm $tmpDir/Rythem-rw.dmg.sparseimage
-#rm $tmpDir/Rythem.dmg
+rm -f Rythem-release.dmg
+hdiutil convert Rythem-rw.dmg -format UDZO -o Rythem-release.dmg
+mv -f Rythem-release.dmg ~/
+rm $1/Rythem-rw.dmg
+rm $1/Rythem.dmg
View
@@ -4,12 +4,19 @@
By [AlloyTeam](http://www.AlloyTeam.com/)
-使用介绍:http://www.alloyteam.com/2012/05/web-front-end-tool-rythem-1/
+使用介绍:[a](http://www.alloyteam.com/2012/05/web-front-end-tool-rythem-1/)
代码阅读建议:https://github.com/AlloyTeam/Rythem/wiki
<strong>代码在Qt4.7.4 & Qt4.8上运行通过,低于4.7的版本有可能会出问题</strong>
+MAC下开发需增加Build Steps
+<pre>
+command deploy.txt
+working directory: %{buildDir}
+Command arguments: %{sourceDir} %{buildDir}
+</pre>
+
### 功能
* http代理服务
@@ -35,7 +42,6 @@ By [AlloyTeam](http://www.AlloyTeam.com/)
* 规则管理(远程规则的更新机制)
* 各OS/浏览器版本下稳定性测试
-* MacOS下自动设置代理
### 主要代码结构
View
@@ -5,7 +5,7 @@
#include <QtNetwork>
#ifdef Q_OS_MAC
-#define CURRENT_VERSION "0.5.09.13"
+#define CURRENT_VERSION "0.5.09.19"
#endif
#ifdef Q_OS_WIN
#define CURRENT_VERSION "0.5.08.28"

0 comments on commit 0470285

Please sign in to comment.